:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #1e293b;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.full-loading {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* --- Login --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-logo { max-width: 220px; width: 100%; height: auto; display: block; margin: 0 auto 4px; }
.login-card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; text-align: center; }

/* --- Layout general --- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: white;
  padding: 0 10px 20px;
}
.sidebar-brand-icon { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--sidebar-text);
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.sidebar-link:hover { background: var(--sidebar-active); }
.sidebar-link.active { background: var(--primary); color: white; }
.sidebar-link .icon { font-size: 16px; }

/* Menú flotante de Ajustes */
.sidebar-settings { position: relative; margin-top: auto; }
.settings-dropdown {
  position: absolute;
  left: 100%;
  bottom: 0;
  margin-left: 8px;
  background: white;
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 210px;
  z-index: 50;
}
.settings-dropdown button {
  background: transparent;
  border: none;
  text-align: left;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}
.settings-dropdown button:hover { background: #f1f5f9; }
.settings-dropdown button.danger { color: var(--danger-dark); }
.settings-dropdown-divider { height: 1px; background: var(--border); margin: 4px 6px; }

.app-main {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

.view { max-width: 1100px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.topbar h1 { font-size: 22px; margin: 0; }
.lang-select {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
}

/* --- Formularios / botones genéricos --- */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 12px;
}
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-ghost.small { padding: 5px 9px; font-size: 12px; }
.btn-danger { background: #fee2e2; color: var(--danger-dark); }
.btn-danger:hover { background: #fecaca; }
.btn-block { width: 100%; }

.error-message { color: var(--danger); font-size: 13px; margin-top: 10px; }
.empty-state { color: var(--text-muted); font-size: 14px; padding: 10px 0; }
.empty-state.small { font-size: 13px; padding: 4px 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.section-header h3 { margin: 0; font-size: 15px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  margin-right: 6px;
}
.badge.muted { background: #f1f5f9; color: var(--text-muted); }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-off { background: #fee2e2; color: var(--danger-dark); }
.badge-admin { background: #ede9fe; color: #6d28d9; }
.badge-admin { background: #ede9fe; color: #6d28d9; }

/* --- Agenda --- */
.agenda-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-label { font-size: 14px; font-weight: 600; margin-left: 8px; }
.agenda-toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.agenda-toolbar-right select { width: auto; }
.agenda-toolbar-right .btn-primary,
.agenda-toolbar-right .btn-ghost { white-space: nowrap; }

.agenda-week {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.agenda-day {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-height: 120px;
}
.agenda-day-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.appointment-item {
  background: #eff6ff;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
}
.appointment-item:hover { filter: brightness(0.95); }
.appt-time { font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.appt-patient .name { font-size: 13px; font-weight: 600; }
.appt-note-icon { margin-left: 4px; font-size: 11px; }

.appointment-item.cancelled { opacity: 0.7; }
.appointment-item.cancelled .name { text-decoration: line-through; }
.cancelled-label { color: var(--danger-dark) !important; font-weight: 600; }
.appt-patient .title { font-size: 12px; color: var(--text-muted); }

/* Cuando la cita tiene un tipo de sesión con color propio, el color se aplica
   como fondo real de la tarjeta (via style inline) y el texto interno debe
   heredarlo en vez de usar los colores fijos de arriba, para mantener contraste. */
.appointment-item.has-type .appt-time,
.appointment-item.has-type .appt-patient .title {
  color: inherit;
  opacity: 0.85;
}
.appointment-item.has-type .appt-patient .name { color: inherit; }

/* --- Pacientes --- */
.patients-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
.patients-list-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.search-row { margin-bottom: 10px; }
.patients-list { margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.patient-item {
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.patient-item:hover { background: #f1f5f9; }
.patient-item.active { background: #dbeafe; }
.patient-item .name { font-weight: 600; }
.patient-item .meta { color: var(--text-muted); font-size: 12px; }

.patient-detail-panel { min-height: 300px; }
.form-grid { display: flex; flex-direction: column; }
.form-row-split { display: flex; gap: 12px; }
.form-row-split .form-row { flex: 1; }

.patient-problems { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.problem-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.problem-item:last-child { border-bottom: none; }
.problem-title { font-size: 13px; font-weight: 600; }
.meta { color: var(--text-muted); font-size: 12px; }

/* --- Patient picker (autocompletar) --- */
.patient-picker { position: relative; }
.patient-picker-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.patient-picker-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.patient-picker-item:hover { background: #f1f5f9; }

/* --- Usuarios --- */
.users-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row-main { flex: 1 1 140px; min-width: 140px; }
.user-row-main .name { font-size: 14px; font-weight: 600; }
.user-row-main .meta { font-size: 12px; }
.user-row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* --- Modales --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-box {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box.modal-wide { max-width: 620px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  color: var(--text-muted);
}
.modal-body { padding: 18px 20px; }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}
.modal-actions .spacer { flex: 1; }

/* --- Responsive --- */
@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 10px 14px; }
  .sidebar-brand { padding: 0 8px 0 0; }
  .sidebar-brand-text { display: none; }
  .sidebar-nav { flex-direction: row; flex: 1; align-items: center; }
  .sidebar-settings { margin-top: 0; margin-left: auto; }
  .app-main { padding: 16px; }
  .patients-layout { grid-template-columns: 1fr; }
  .form-row-split { flex-direction: column; }
  .agenda-week { grid-template-columns: 1fr; }

  /* Ahorra espacio: en móvil solo se ve el texto de la pestaña activa,
     el resto queda solo con su icono. Así no hace falta hacer scroll
     horizontal para encontrar los botones. */
  .sidebar-link .label { display: none; }
  .sidebar-link.active .label { display: inline; }

  .settings-dropdown {
    left: auto;
    right: 0;
    top: 100%;
    bottom: auto;
    margin-left: 0;
    margin-top: 8px;
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* --- Pestañas genéricas (usuarios, pacientes, ajustes, agenda) --- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tabs.compact { border-bottom: none; margin-bottom: 0; gap: 2px; }
.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 0;
}
.tabs.compact .tab {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs.compact .tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* --- Tarjeta rápida de paciente dentro del modal de cita --- */
.patient-quick-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
}
.phone-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.phone-link:hover { text-decoration: underline; }

/* --- Botón de llamada junto a un campo de teléfono editable --- */
.phone-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.phone-input-row input { flex: 1; }
.call-btn {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
}

/* --- Documentos del paciente --- */
.documents-list { display: flex; flex-direction: column; gap: 6px; }
.document-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.document-item:hover { background: #f8fafc; }
.document-icon { font-size: 22px; }
.document-info { flex: 1; }
.document-info .name { font-size: 13px; font-weight: 600; }
.expired-warning { color: var(--danger-dark); font-weight: 600; }

.substitution-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.substitution-row {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.substitution-row:last-child { border-bottom: none; }
.substitution-row-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.substitution-row-info { cursor: pointer; flex: 1 1 200px; }
.substitution-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.substitution-contracts {
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
}

/* --- Prescripciones (ordonnances) --- */
.prescriptions-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.prescription-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.prescription-item:last-child { border-bottom: none; }
.prescription-item-main { flex: 1 1 200px; }
.prescription-item-main .name { font-size: 13px; font-weight: 600; }
.prescription-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.quick-add-physician {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 8px;
}
.quick-add-physician input { flex: 1 1 120px; }

/* --- Ficha de médico (Ajustes > Médicos) --- */
.physician-card {
  margin-top: 10px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}
.physician-card .form-row { margin-top: 8px; }
.physician-card .form-row:first-child { margin-top: 0; }
.physician-patients-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
}
.physician-patients-list li { margin-bottom: 2px; }

/* --- Tipos de cita (Ajustes) --- */
.type-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.type-row:last-child { border-bottom: none; }
.type-row input[type="color"] { width: 36px; height: 32px; padding: 2px; flex-shrink: 0; }
.type-row-label { flex: 1 1 120px; min-width: 120px; }
.type-row-active { display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

/* --- Agenda: vista día y mes --- */
.agenda-day-single { max-width: 480px; }

.agenda-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.agenda-month-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.agenda-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.agenda-month-cell {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.agenda-month-cell:hover { background: #f1f5f9; }
.agenda-month-cell.muted { opacity: 0.4; }
.agenda-month-cell.today { border-color: var(--primary); border-width: 2px; }
.agenda-month-cell.has-exception { background: #fef2f2; }
.agenda-month-daynum { font-size: 12px; font-weight: 600; }

.agenda-month-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-self: flex-end;
  justify-content: flex-end;
}
.agenda-month-dot {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: white;
  border-radius: 999px;
  padding: 2px 5px;
  min-width: 14px;
  text-align: center;
}

/* Ausencia: tacha el día con una línea en vez de mostrar puntos de citas,
   con un icono pequeño para saber el motivo sin que ocupe espacio. */
.agenda-month-exception {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2px;
}
.agenda-month-exception::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  right: -6px;
  height: 2px;
  background: #ef4444;
  transform: rotate(-8deg);
}
.agenda-month-exception-icon { font-size: 14px; z-index: 1; }
.agenda-month-exception-label {
  font-size: 8px;
  font-weight: 700;
  color: #b91c1c;
  text-transform: uppercase;
  z-index: 1;
  text-align: center;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-card { margin-top: 20px; }
.version-card h3 { margin-bottom: 6px; }
.version-card .meta { margin: 2px 0; }
.adventurebase-logo { max-width: 220px; width: 100%; height: auto; display: block; margin: 14px 0 6px; }

.weekday-picker { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.weekday-chip {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.weekday-chip.active { background: var(--primary); border-color: var(--primary); color: white; }

.timeline-free {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
}
.timeline-free:hover { background: #f8fafc; border-color: var(--primary); color: var(--primary); }
.timeline-free-plus { margin-left: auto; font-weight: 700; }

.timeline-exception {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
  background: repeating-linear-gradient(45deg, #fee2e2, #fee2e2 8px, #fecaca 8px, #fecaca 16px);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 12px;
  color: #991b1b;
  font-weight: 600;
}

.warning-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 0 0 4px;
}
.warning-banner.exception-warning {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.recurrence-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
}
.recurrence-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  cursor: pointer;
}
.recurrence-fields {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recurrence-end-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.recurrence-end-mode label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
}
.recurrence-end-mode input[type="number"],
.recurrence-end-mode input[type="date"] {
  width: 140px;
}

.type-row-duration { width: 70px; flex-shrink: 0; }

/* --- Aviso de sin conexión --- */
.offline-banner {
  background: #7c2d12;
  color: white;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
}

/* --- Rueda de carga --- */
.loading-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: kinesio-spin 0.8s linear infinite;
}
.loading-spinner.small { width: 18px; height: 18px; border-width: 2px; }
.loading-spinner-label { font-size: 13px; color: var(--text-muted); }
@keyframes kinesio-spin {
  to { transform: rotate(360deg); }
}

/* --- Campanita de notificaciones --- */
.notification-bell { position: relative; }
.notification-bell-btn {
  position: relative;
  background: transparent;
  border: none;
  font-size: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  cursor: pointer;
}
.notification-bell-btn:hover { background: var(--sidebar-active); }
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notification-dropdown {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 8px;
  background: white;
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  width: 300px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.notification-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}
.notification-list { overflow-y: auto; }
.notification-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: #f8fafc; }
.notification-item.unread { background: #eff6ff; }
.notification-item.unread .notification-item-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 6px;
}
.notification-item-title { font-size: 13px; font-weight: 600; }
.notification-item-body { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notification-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 800px) {
  .notification-dropdown {
    left: auto;
    right: 0;
    top: 100%;
    margin-left: 0;
    margin-top: 8px;
    width: 280px;
  }
}
