* { box-sizing: border-box; }

.page { display: block; }
.page.hidden { display: none; }

.nav-link.active {
  background-color: #4f46e5;
  color: white;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.email-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.email-card:hover {
  border-color: #6366f1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.email-card.unread .email-subject { font-weight: 700; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
}

input, select, textarea {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #111827;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

button.btn-primary {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
button.btn-primary:hover { background: #4338ca; }

button.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
button.btn-danger:hover { background: #b91c1c; }

button.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
button.btn-secondary:hover { background: #e5e7eb; border-color: #d1d5db; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
  padding-top: 4px;
}

/* When the sidebar is collapsed the floating toggle button at top-left
   overlaps the page header — give the page some left breathing room so
   the title and its action buttons clear the toggle. */
#main-content.ml-0 {
  padding-left: 3.5rem;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.spinner {
  border: 3px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  width: 28px; height: 28px;
  animation: spin 0.7s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.similarity-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.similarity-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  border-radius: 2px;
}

/* Searchable combobox */
.combobox {
  position: relative;
  width: 14rem;
}
.combobox input.combobox-input {
  width: 100%;
  padding-right: 28px;
}
.combobox .combobox-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}
.combobox .combobox-clear:hover { color: #4b5563; }
.combobox-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  max-height: 240px;
  overflow-y: auto;
  z-index: 40;
}
.combobox-menu .combobox-option {
  padding: 7px 10px;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
}
.combobox-menu .combobox-option:hover,
.combobox-menu .combobox-option.active {
  background: #eef2ff;
  color: #4338ca;
}
.combobox-menu .combobox-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}
