* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: #e2e8f0;
  color: #1f2937;
  position: relative;
  overflow-x: hidden;
}
.screen { min-height: 100vh; }
.hidden { display: none !important; }

#login-screen, #forgot-screen, #reset-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  width: 320px;
}
.card h1 { margin: 0 0 4px; font-size: 20px; }
.subtitle { color: #6b7280; font-size: 14px; margin-bottom: 20px; }
label { display: block; font-size: 13px; margin: 12px 0 4px; color: #374151; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  padding: 0; color: #9ca3af; display: flex; align-items: center;
  width: auto; min-width: unset; line-height: 1; margin: 0;
}
.pw-toggle:hover { color: #6b7280; }
.pw-toggle svg { width: 18px; height: 18px; }

input, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; }
button {
  margin-top: 18px;
  width: 100%;
  padding: 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
button.secondary {
  background: #e5e7eb;
  color: #1f2937;
  width: auto;
  margin-top: 0;
}
.error { color: #dc2626; font-size: 13px; margin-top: 10px; min-height: 16px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
header h1 { margin: 0; font-size: 18px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions button { width: auto; margin-top: 0; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 16px;
  row-gap: 20px;
  margin-bottom: 20px;
}

.stats { display: contents; }
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-value { display: block; font-size: 24px; font-weight: 700; color: #2563eb; }
.stat-label { font-size: 13px; color: #6b7280; }

.filters {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  padding: 0;
  margin-top: auto;
  flex-wrap: wrap;
}
.filters-dates {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.filters-buttons {
  display: flex;
  gap: 10px;
}
.filters label { font-size: 13px; color: #374151; margin: 0; display: flex; align-items: center; gap: 6px; }
.filters input[type="date"] { width: auto; margin: 0; padding: 3px 8px; }
.filters button { width: auto; margin-top: 0; padding: 3px 16px; }

#appointments-list { padding: 0 24px 40px; }
.date-group { margin-bottom: 20px; }
.date-group h3 {
  font-size: 14px;
  color: #374151;
  text-transform: capitalize;
  margin-bottom: 8px;
}
.appt-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.appt-time { font-weight: 700; color: #2563eb; min-width: 60px; }
.appt-info { flex: 1; margin-left: 12px; }
.appt-name { font-weight: 600; font-size: 14px; }
.appt-name-link { cursor: pointer; }
.appt-name-link:hover { text-decoration: underline; color: #2563eb; }
.appt-reason { font-size: 13px; color: #6b7280; }
.appt-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.status-scheduled { background: #dbeafe; color: #1e40af; }
.appt-card-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ver-cita-btn { margin: 0; width: auto; padding: 4px 10px; font-size: 12px; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-completed { background: #dcfce7; color: #166534; }
.status-blocked { background: #fef3c7; color: #92400e; }
.block-card {
  border-left-color: #f59e0b;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 6px,
    rgba(245,158,11,0.06) 6px,
    rgba(245,158,11,0.06) 12px
  );
}
.block-label { color: #92400e; }
.block-time { color: #b45309; }
body.dark .block-card { border-left-color: #f59e0b; background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(245,158,11,0.08) 6px, rgba(245,158,11,0.08) 12px); }
body.dark .block-label { color: #fcd34d; }
body.dark .block-time { color: #fbbf24; }
body.dark .status-blocked { background: rgba(245,158,11,0.15); color: #fcd34d; }
body.indigo .block-card { border-left-color: #f59e0b; background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(245,158,11,0.08) 6px, rgba(245,158,11,0.08) 12px); }
body.indigo .block-label { color: #fcd34d; }
body.indigo .block-time { color: #fbbf24; }
body.indigo .status-blocked { background: rgba(245,158,11,0.15); color: #fcd34d; }
body.phantom .block-card { border-left-color: #00e5ff; background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(0,229,255,0.06) 6px, rgba(0,229,255,0.06) 12px); }
body.phantom .block-label { color: #00e5ff; }
body.phantom .block-time { color: #00e5ff; }
body.phantom .status-blocked { background: rgba(0,229,255,0.15); color: #00e5ff; }
body.java .block-card { border-left-color: #ffdd00; background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(255,221,0,0.07) 6px, rgba(255,221,0,0.07) 12px); }
body.java .block-label { color: #ffdd00; }
body.java .block-time { color: #ffb400; }
body.java .status-blocked { background: rgba(255,221,0,0.15); color: #ffdd00; }
.empty-state { text-align: center; color: #6b7280; padding: 40px; }

.appointments-toolbar {
  display: flex;
  gap: 12px;
  padding: 0 24px 16px;
  align-items: center;
}
.appointments-toolbar #patient-search { flex: 1; }
.appointments-toolbar button { width: auto; margin-top: 0; }

.badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

.actions {
  display: flex;
  gap: 12px;
  padding: 0 0 12px;
}
.actions button { width: auto; margin-top: 0; padding: 10px 16px; }

.quick-actions {
  display: flex;
  gap: 12px;
  padding: 0 0 12px;
}
.quick-actions button { width: auto; margin-top: 0; padding: 10px 16px; }

.actions-chart-row { display: contents; }
.actions-stack {
  grid-column: 1 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}
.actions-stack .quick-actions,
.actions-stack .actions { padding: 0; }

.month-chart-container {
  grid-column: 3 / 5;
  min-width: 0;
  height: 170px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}
.chart-title { margin: 0 0 6px; font-size: 12px; color: #6b7280; }
.month-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.chart-bar {
  width: 100%;
  max-width: 14px;
  min-height: 2px;
  background: linear-gradient(to bottom, #93c5fd, #1d4ed8);
  border-radius: 2px 2px 0 0;
  position: relative;
}
body.dark .chart-bar  { background: linear-gradient(to bottom, #60a5fa, #1e3a8a); }
body.indigo .chart-bar { background: linear-gradient(to bottom, #c4b5fd, #3730a3); }
.chart-value {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #2563eb;
  font-weight: 600;
  white-space: nowrap;
}
.chart-day-label {
  font-size: 8px;
  color: #9ca3af;
  margin-top: 2px;
}
.chart-dow-label {
  font-size: 7px;
  color: #c4c9d4;
  margin-top: 1px;
}

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h2 { margin: 0 0 4px; font-size: 18px; }
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { margin-top: 18px; }
.modal-top-bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.modal-top-bar h2 { margin: 0 0 4px; font-size: 18px; }
.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0 4px;
  margin: 0;
  width: auto;
  flex-shrink: 0;
}
.modal-close-btn:hover { color: #1f2937; background: none; }
body.dark .modal-close-btn { color: #94a3b8; }
body.dark .modal-close-btn:hover { color: #f1f5f9; background: none; }
body.indigo .modal-close-btn { color: #a5b4fc; }
body.indigo .modal-close-btn:hover { color: #e0e7ff; background: none; }
body.phantom .modal-close-btn { color: #94a3b8; }
body.phantom .modal-close-btn:hover { color: #00e5ff; background: none; }
body.java .modal-close-btn { color: #a78bca; }
body.java .modal-close-btn:hover { color: #ff2d78; background: none; }

.block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border-left: 3px solid #f59e0b;
  margin-bottom: 8px;
  gap: 12px;
}
.block-row-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.block-row-date { font-weight: 600; font-size: 13px; }
.block-row-time { font-size: 13px; color: #6b7280; }
.block-row-reason { font-size: 12px; color: #9ca3af; font-style: italic; }
.block-delete-btn { width: auto; margin-top: 0; padding: 4px 12px; font-size: 12px; flex-shrink: 0; }
body.dark .block-row { background: #0f172a; border-left-color: #f59e0b; }
body.dark .block-row-date { color: #e2e8f0; }
body.indigo .block-row { background: #1e1b4b; border-left-color: #f59e0b; }
body.indigo .block-row-date { color: #e0e7ff; }
body.phantom .block-row { background: #0d0b1e; border-left-color: #00e5ff; }
body.phantom .block-row-date { color: #e0e7ff; }
body.java .block-row { background: #12102a; border-left-color: #ffdd00; }
body.java .block-row-date { color: #f0e6ff; }

.main-layout {
  display: flex;
  gap: 20px;
  padding: 20px 24px 40px;
  align-items: flex-start;
}
.main-col { flex: 1; min-width: 0; }
.main-col #appointments-list { padding: 0; }
.main-col .appointments-toolbar { padding: 0 0 16px; }

.sidebar-col {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-col {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-header span { font-weight: 600; text-transform: capitalize; font-size: 14px; cursor: pointer; }
.calendar-header span:hover { text-decoration: underline; }
.calendar-header button { width: auto; padding: 4px 10px; margin-top: 0; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-grid .cal-dow {
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  padding-bottom: 4px;
}
.calendar-grid .cal-day {
  position: relative;
  text-align: center;
  padding: 8px 0;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #f9fafb;
}
.calendar-grid .cal-day.empty { background: none; cursor: default; }
.calendar-grid .cal-day:hover:not(.empty) { background: #e5e7eb; }
.calendar-grid .cal-day.today { font-weight: 700; border: 1px solid #2563eb; }
.calendar-grid .cal-day.selected { background: #2563eb; color: #fff; }
.calendar-grid .cal-day .cal-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
}
.calendar-grid .cal-day.selected .cal-dot { background: #fff; }

.notes-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.notes-header span { font-weight: 600; font-size: 14px; }
.notes-header button { width: auto; padding: 4px 10px; margin-top: 0; font-size: 12px; }
.note-item {
  background: #f9fafb;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  word-break: break-word;
}
.note-item:hover { background: #e5e7eb; }
.note-content-text { white-space: pre-wrap; color: #374151; font-size: 14px; }

/* ── Waves ─────────────────────────────────────────────────── */
.waves-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  line-height: 0;
}
.waves-container svg { display: block; width: 200%; }
.wave { animation: waveMove 8s cubic-bezier(.55,.5,.45,.5) infinite; }
.wave1 { animation-duration: 9s; }
.wave2 { animation-duration: 12s; animation-delay: -3s; }
.wave3 { animation-duration: 7s;  animation-delay: -5s; }
@keyframes waveMove {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* ── Floating particles ─────────────────────────────────────── */
.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  10%  { opacity: 0.6; }
  80%  { opacity: 0.3; }
  100% { transform: translateY(-110vh) scale(0.4); opacity: 0; }
}

/* Default (light) particle color */
.particle { background: rgba(37,99,235,0.15); }
body.dark    .particle { background: rgba(99,102,241,0.18); }
body.indigo  .particle { background: rgba(129,140,248,0.18); }
body.phantom .particle { background: rgba(0,229,255,0.12); }
body.java    .particle { background: rgba(255,45,120,0.14); }

#app-screen, #login-screen { position: relative; z-index: 1; }

/* ── Dark mode ────────────────────────────────────────────── */
body.dark {
  background: #0f172a;
  color: #e2e8f0;
}
body.dark .wave1 { fill: rgba(99,102,241,0.12); }
body.dark .wave2 { fill: rgba(99,102,241,0.08); }
body.dark .wave3 { fill: rgba(99,102,241,0.06); }
body.dark header { background: #1e293b; border-bottom-color: #334155; }
body.dark header h1 { color: #f1f5f9; }
body.dark .stat-card,
body.dark .appt-card,
body.dark .month-chart-container,
body.dark .calendar-col,
body.dark .notes-section,
body.dark .modal-content { background: #1e293b; box-shadow: none; }
body.dark .card { background: #1e293b; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
body.dark .card h1,
body.dark .modal-content h2,
body.dark .appt-name,
body.dark .date-group h3 { color: #f1f5f9; }
body.dark label,
body.dark .filters label { color: #94a3b8; }
body.dark input,
body.dark textarea,
body.dark select {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
body.dark .appt-reason,
body.dark .stat-label,
body.dark .chart-title,
body.dark .note-content-text,
body.dark .subtitle,
body.dark .empty-state { color: #94a3b8; }
body.dark .calendar-grid .cal-day { background: #0f172a; color: #e2e8f0; }
body.dark .calendar-grid .cal-day.empty { background: none; }
body.dark .calendar-grid .cal-day.today { background: #1d4ed8; color: #fff; }
body.dark .calendar-grid .cal-day.selected { background: #2563eb; color: #fff; }
body.dark .note-item { background: #0f172a; color: #e2e8f0; }
body.dark .note-item:hover { background: #334155; }
body.dark button.secondary { background: #334155; color: #e2e8f0; }
body.dark .appointments-toolbar #patient-search { background: #0f172a; border-color: #334155; color: #e2e8f0; }

.icon-btn { width: auto; margin-top: 0; padding: 6px 10px; font-size: 16px; display: flex; align-items: center; }

/* ── Theme menu ────────────────────────────────────────────── */
.theme-menu-wrapper { position: relative; }
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  z-index: 1000;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  width: 100%;
  text-align: left;
  margin: 0;
}
.theme-option:hover { background: #f1f5f9; }
.theme-option.active { background: #dbeafe; color: #1e40af; font-weight: 600; }

/* dark theme-menu */
body.dark .theme-menu { background: #1e293b; border-color: #334155; }
body.dark .theme-option { color: #e2e8f0; }
body.dark .theme-option:hover { background: #334155; }
body.dark .theme-option.active { background: #1e3a8a; color: #bfdbfe; }

/* ── Indigo theme ──────────────────────────────────────────── */
body.indigo {
  background: #1e1b4b;
  color: #e0e7ff;
}
body.indigo .wave1 { fill: rgba(129,140,248,0.15); }
body.indigo .wave2 { fill: rgba(129,140,248,0.10); }
body.indigo .wave3 { fill: rgba(129,140,248,0.07); }
body.indigo header { background: #312e81; border-bottom-color: #4338ca; }
body.indigo header h1 { color: #e0e7ff; }
body.indigo .stat-card,
body.indigo .appt-card,
body.indigo .month-chart-container,
body.indigo .calendar-col,
body.indigo .notes-section,
body.indigo .card,
body.indigo .modal-content { background: #2e2b63; box-shadow: none; color: #e0e7ff; }
body.indigo .stat-value { color: #a5b4fc; }
body.indigo .stat-label { color: #c7d2fe; }
body.indigo label, body.indigo .appt-time, body.indigo .subtitle,
body.indigo .empty-state, body.indigo .chart-title,
body.indigo .note-content-text { color: #c7d2fe; }
body.indigo .appt-name, body.indigo .date-group h3,
body.indigo .modal-content h2 { color: #e0e7ff; }
body.indigo .calendar-grid .cal-day { background: #1e1b4b; color: #e0e7ff; }
body.indigo .calendar-grid .cal-day.today { background: #4338ca; color: #fff; }
body.indigo .calendar-grid .cal-day.selected { background: #6366f1; color: #fff; }
body.indigo .note-item { background: #1e1b4b; color: #e0e7ff; }
body.indigo .note-item:hover { background: #3730a3; }
body.indigo input, body.indigo select, body.indigo textarea { background: #3730a3; border-color: #4338ca; color: #e0e7ff; }
body.indigo button.secondary { background: #3730a3; color: #e0e7ff; }
body.indigo .appointments-toolbar #patient-search { background: #1e1b4b; border-color: #4338ca; color: #e0e7ff; }
body.indigo .theme-menu { background: #312e81; border-color: #4338ca; }
body.indigo .theme-option { color: #e0e7ff; }
body.indigo .theme-option:hover { background: #3730a3; }
body.indigo .theme-option.active { background: #4338ca; color: #e0e7ff; }

/* ── Phantom theme ─────────────────────────────────────────── */
body.phantom {
  background: #0d0b1e;
  color: #e0e7ff;
}
body.phantom .wave1 { fill: rgba(0,229,255,0.10); }
body.phantom .wave2 { fill: rgba(224,64,251,0.07); }
body.phantom .wave3 { fill: rgba(0,229,255,0.05); }
body.phantom header {
  background: #13102b;
  border-bottom: 1px solid rgba(0,229,255,0.25);
}
body.phantom header h1 { color: #00e5ff; letter-spacing: 0.04em; }
body.phantom .stat-card,
body.phantom .appt-card,
body.phantom .month-chart-container,
body.phantom .calendar-col,
body.phantom .notes-section,
body.phantom .card,
body.phantom .modal-content {
  background: #1a1535;
  border: 1px solid rgba(0,229,255,0.15);
  box-shadow: 0 0 20px rgba(0,229,255,0.05);
  color: #e0e7ff;
}
body.phantom .stat-value { color: #00e5ff; text-shadow: 0 0 10px rgba(0,229,255,0.5); }
body.phantom .stat-label { color: #9ca3af; }
body.phantom .appt-name, body.phantom .date-group h3,
body.phantom .modal-content h2 { color: #e0e7ff; }
body.phantom label, body.phantom .appt-time,
body.phantom .chart-title, body.phantom .note-content-text,
body.phantom .subtitle, body.phantom .empty-state { color: #94a3b8; }
body.phantom .appt-card { border-left: 3px solid #e040fb; }
body.phantom .calendar-grid .cal-day { background: #0d0b1e; color: #e0e7ff; border-color: rgba(0,229,255,0.1); }
body.phantom .calendar-grid .cal-day.empty { background: none; }
body.phantom .calendar-grid .cal-day.today {
  background: rgba(0,229,255,0.2);
  color: #00e5ff;
  border: 1px solid rgba(0,229,255,0.5);
}
body.phantom .calendar-grid .cal-day.selected {
  background: rgba(224,64,251,0.25);
  color: #e040fb;
  border: 1px solid rgba(224,64,251,0.5);
}
body.phantom .cal-day.has-appt::after { background: #e040fb; box-shadow: 0 0 6px #e040fb; }
body.phantom .note-item { background: #0d0b1e; color: #e0e7ff; border: 1px solid rgba(0,229,255,0.1); }
body.phantom .note-item:hover { background: #1a1535; border-color: rgba(0,229,255,0.3); }
body.phantom input, body.phantom select, body.phantom textarea {
  background: #0d0b1e;
  border-color: rgba(0,229,255,0.25);
  color: #e0e7ff;
}
body.phantom input:focus, body.phantom select:focus, body.phantom textarea:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0,229,255,0.15);
  outline: none;
}
body.phantom button { background: linear-gradient(135deg, #00b4cc, #7b2ff7); color: #fff; border: none; }
body.phantom button:hover { opacity: 0.88; }
body.phantom button.secondary {
  background: transparent;
  border: 1px solid rgba(0,229,255,0.35);
  color: #00e5ff;
}
body.phantom button.secondary:hover { background: rgba(0,229,255,0.1); }
body.phantom .appointments-toolbar #patient-search {
  background: #0d0b1e;
  border-color: rgba(0,229,255,0.25);
  color: #e0e7ff;
}
body.phantom .chart-bar { background: linear-gradient(to bottom, #e040fb, #00b4cc); }
body.phantom .badge, body.phantom .status-badge { background: rgba(0,229,255,0.15); color: #00e5ff; }
body.phantom .theme-menu { background: #1a1535; border-color: rgba(0,229,255,0.25); }
body.phantom .theme-option { color: #e0e7ff; }
body.phantom .theme-option:hover { background: rgba(0,229,255,0.1); }
body.phantom .theme-option.active { background: rgba(0,229,255,0.2); color: #00e5ff; font-weight: 600; }

/* ── Java theme ────────────────────────────────────────────── */
body.java {
  background: #12102a;
  color: #f0e6ff;
}
body.java .wave1 { fill: rgba(255,45,120,0.12); }
body.java .wave2 { fill: rgba(255,150,0,0.08); }
body.java .wave3 { fill: rgba(255,45,120,0.06); }
body.java header {
  background: #1a1640;
  border-bottom: 1px solid rgba(255,45,120,0.35);
}
body.java header h1 {
  background: linear-gradient(90deg, #ffdd00, #ff6b00, #ff2d78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.java .stat-card,
body.java .appt-card,
body.java .month-chart-container,
body.java .calendar-col,
body.java .notes-section,
body.java .card,
body.java .modal-content {
  background: #1c1a3a;
  border: 1px solid rgba(255,45,120,0.2);
  box-shadow: 0 0 20px rgba(255,45,120,0.06);
  color: #f0e6ff;
}
body.java .stat-value {
  background: linear-gradient(135deg, #ffdd00, #ff2d78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.java .stat-label { color: #9ca3af; }
body.java .appt-name, body.java .date-group h3,
body.java .modal-content h2 { color: #f0e6ff; }
body.java label, body.java .appt-time,
body.java .chart-title, body.java .note-content-text,
body.java .subtitle, body.java .empty-state { color: #a78bca; }
body.java .appt-card { border-left: 3px solid #ff2d78; }
body.java .calendar-grid .cal-day { background: #12102a; color: #f0e6ff; border-color: rgba(255,45,120,0.12); }
body.java .calendar-grid .cal-day.empty { background: none; }
body.java .calendar-grid .cal-day.today {
  background: rgba(255,45,120,0.25);
  color: #ff2d78;
  border: 1px solid rgba(255,45,120,0.6);
}
body.java .calendar-grid .cal-day.selected {
  background: rgba(255,180,0,0.2);
  color: #ffb400;
  border: 1px solid rgba(255,180,0,0.5);
}
body.java .cal-day.has-appt::after { background: #ff2d78; box-shadow: 0 0 6px #ff2d78; }
body.java .note-item { background: #12102a; color: #f0e6ff; border: 1px solid rgba(255,45,120,0.15); }
body.java .note-item:hover { background: #1c1a3a; border-color: rgba(255,45,120,0.4); }
body.java input, body.java select, body.java textarea {
  background: #12102a;
  border-color: rgba(255,45,120,0.3);
  color: #f0e6ff;
}
body.java input:focus, body.java select:focus, body.java textarea:focus {
  border-color: #ff2d78;
  box-shadow: 0 0 0 3px rgba(255,45,120,0.15);
  outline: none;
}
body.java button { background: linear-gradient(135deg, #ff6b00, #ff2d78, #8b00ff); color: #fff; border: none; }
body.java button:hover { opacity: 0.88; }
body.java button.secondary {
  background: transparent;
  border: 1px solid rgba(255,45,120,0.45);
  color: #ff2d78;
}
body.java button.secondary:hover { background: rgba(255,45,120,0.1); }
body.java .appointments-toolbar #patient-search {
  background: #12102a;
  border-color: rgba(255,45,120,0.3);
  color: #f0e6ff;
}
body.java .chart-bar { background: linear-gradient(to bottom, #ffdd00, #ff6b00, #ff2d78); }
body.java .badge, body.java .status-badge { background: rgba(255,45,120,0.15); color: #ff2d78; }
body.java .theme-menu { background: #1c1a3a; border-color: rgba(255,45,120,0.3); }
body.java .theme-option { color: #f0e6ff; }
body.java .theme-option:hover { background: rgba(255,45,120,0.1); }
body.java .theme-option.active { background: rgba(255,45,120,0.2); color: #ff2d78; font-weight: 600; }

.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions button { width: auto; margin-top: 0; }

/* Toast */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #1f2937; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.18); opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s; pointer-events: none; max-width: 320px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { border-left: 4px solid #22c55e; }
.toast.toast-error { border-left: 4px solid #ef4444; }
body.dark #toast-container .toast { background: #1e293b; }
body.indigo #toast-container .toast { background: #1e1b4b; }
body.phantom #toast-container .toast { background: #1a1030; }
body.java #toast-container .toast { background: #12102a; }

.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.chart-header .chart-title { margin: 0; }

.chart-expand-content { width: 90vw; max-width: 900px; max-height: 90vh; }
.chart-expand-body { display: flex; gap: 24px; align-items: flex-start; margin-top: 16px; }
.chart-expand-bar { flex: 1; min-width: 0; }
.chart-expand-donut { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.chart-subtitle { font-size: 13px; color: #6b7280; margin: 0 0 12px; font-weight: 600; }
.month-chart-big { height: 280px !important; }
.donut-legend { width: 100%; margin-top: 16px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.donut-legend-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* Dark/theme variants for expand modal */
body.dark .chart-subtitle { color: #94a3b8; }
body.indigo .chart-subtitle { color: #a5b4fc; }
body.phantom .chart-subtitle { color: #94a3b8; }
body.java .chart-subtitle { color: #a78bca; }

@media (max-width: 800px) {
  .main-layout { flex-direction: column; }
  .sidebar-col { width: 100%; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .actions-stack { grid-column: 1; }
  .month-chart-container { grid-column: 1; }
}
