
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── CSS Variables (Light Mode) ─────────────────────────────── */
:root {
  /* Brand */
  --clr-primary:      #0ea5e9;
  --clr-primary-dark: #0284c7;
  --clr-primary-pale: #e0f2fe;
  --clr-accent:       #06d6a0;
  --clr-danger:       #f43f5e;
  --clr-warning:      #f59e0b;
  --clr-success:      #10b981;
  --clr-info:         #6366f1;

  /* Surface */
  --bg-base:     #f0f7ff;
  --bg-card:     #ffffff;
  --bg-sidebar:  #0f172a;
  --bg-input:    #f8fafc;

  /* Text */
  --txt-primary:   #0f172a;
  --txt-secondary: #64748b;
  --txt-muted:     #94a3b8;
  --txt-inverse:   #f8fafc;

  /* Border */
  --border:       #e2e8f0;
  --border-focus: #0ea5e9;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
  --shadow-md:  0 4px 16px rgba(15,23,42,.10);
  --shadow-lg:  0 10px 40px rgba(15,23,42,.14);
  --shadow-xl:  0 20px 60px rgba(14,165,233,.18);

  /* Glassmorphism */
  --glass-bg:     rgba(255,255,255,.70);
  --glass-border: rgba(255,255,255,.30);
  --glass-blur:   blur(20px);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Spacing */
  --sidebar-w: 260px;

  /* Transitions */
  --trans-fast:   .15s cubic-bezier(.4,0,.2,1);
  --trans-normal: .25s cubic-bezier(.4,0,.2,1);
  --trans-slow:   .4s  cubic-bezier(.4,0,.2,1);

  /* Font */
  --font-display: 'Sora', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

/* ── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-base:     #0a0f1e;
  --bg-card:     #111827;
  --bg-sidebar:  #060b14;
  --bg-input:    #1f2937;

  --txt-primary:   #f1f5f9;
  --txt-secondary: #94a3b8;
  --txt-muted:     #64748b;

  --border:       #1e293b;
  --border-focus: #0ea5e9;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.5);
  --shadow-xl:  0 20px 60px rgba(14,165,233,.25);

  --glass-bg:     rgba(17,24,39,.75);
  --glass-border: rgba(255,255,255,.07);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--txt-primary);
  line-height: 1.65;
  transition: background var(--trans-normal), color var(--trans-normal);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--clr-primary); text-decoration: none; transition: color var(--trans-fast); }
a:hover { color: var(--clr-primary-dark); }

img { max-width: 100%; display: block; }

/* ── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--txt-primary);
}

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

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--trans-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 99px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--clr-primary), #38bdf8);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(14,165,233,.4);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
}

.logo-text span { color: var(--clr-primary); }

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-section-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #475569;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--trans-fast);
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
}

.nav-item.active {
  background: rgba(14,165,233,.15);
  color: var(--clr-primary);
  font-weight: 600;
}

.nav-item.active .nav-icon { color: var(--clr-primary); }

.nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  stroke-width: 1.75;
}

.nav-badge {
  margin-left: auto;
  background: var(--clr-danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--trans-normal);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--txt-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--trans-fast);
  position: relative;
}

.topbar-btn:hover {
  background: var(--clr-primary-pale);
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--clr-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.user-chip:hover { border-color: var(--clr-primary); }

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--clr-primary), #38bdf8);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
}

.user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--txt-primary);
}

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--txt-secondary);
  font-size: .875rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--trans-normal);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, currentColor 100%);
  opacity: .03;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.orange { background: #ffedd5; color: #c2410c; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }
.stat-icon.teal   { background: #ccfbf1; color: #0f766e; }
.stat-icon.red    { background: #ffe4e6; color: #be123c; }

[data-theme="dark"] .stat-icon.blue   { background: rgba(29,78,216,.2); }
[data-theme="dark"] .stat-icon.green  { background: rgba(22,163,74,.2); }
[data-theme="dark"] .stat-icon.orange { background: rgba(194,65,12,.2); }
[data-theme="dark"] .stat-icon.purple { background: rgba(147,51,234,.2); }
[data-theme="dark"] .stat-icon.teal   { background: rgba(15,118,110,.2); }
[data-theme="dark"] .stat-icon.red    { background: rgba(190,18,60,.2); }

.stat-info { flex: 1; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: .8rem;
  color: var(--txt-secondary);
  font-weight: 500;
}

.stat-change {
  font-size: .75rem;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change.up   { color: var(--clr-success); }
.stat-change.down { color: var(--clr-danger); }

/* ── Grid helpers ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .825rem;
  font-weight: 600;
  color: var(--txt-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--txt-primary);
  font-family: var(--font-body);
  font-size: .875rem;
  transition: all var(--trans-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}

.form-control::placeholder { color: var(--txt-muted); }

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control { cursor: pointer; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
}
.btn-primary:hover {
  background: var(--clr-primary-dark);
  border-color: var(--clr-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14,165,233,.4);
}

.btn-outline {
  background: transparent;
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}
.btn-outline:hover {
  background: var(--clr-primary-pale);
}

.btn-danger  { background: var(--clr-danger);  color: #fff; border-color: var(--clr-danger); }
.btn-success { background: var(--clr-success); color: #fff; border-color: var(--clr-success); }
.btn-warning { background: var(--clr-warning); color: #fff; border-color: var(--clr-warning); }

.btn-ghost {
  background: transparent;
  color: var(--txt-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-input); }

.btn-sm  { padding: 6px 14px; font-size: .8rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-icon { width: 38px; height: 38px; padding: 0; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
}

.badge-primary   { background: #dbeafe; color: #1e40af; }
.badge-success   { background: #dcfce7; color: #166534; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #ffe4e6; color: #9f1239; }
.badge-info      { background: #ede9fe; color: #4c1d95; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-dark      { background: #1e293b; color: #94a3b8; }

[data-theme="dark"] .badge-primary   { background: rgba(30,64,175,.25); color: #93c5fd; }
[data-theme="dark"] .badge-success   { background: rgba(22,101,52,.25); color: #86efac; }
[data-theme="dark"] .badge-warning   { background: rgba(146,64,14,.25); color: #fde68a; }
[data-theme="dark"] .badge-danger    { background: rgba(159,18,57,.25); color: #fda4af; }
[data-theme="dark"] .badge-info      { background: rgba(76,29,149,.25); color: #c4b5fd; }
[data-theme="dark"] .badge-secondary { background: rgba(71,85,105,.25); color: #94a3b8; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--txt-muted);
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--trans-fast);
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover { background: rgba(14,165,233,.04); }

.data-table td {
  padding: 13px 16px;
  color: var(--txt-primary);
  vertical-align: middle;
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9,9,29,.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-normal);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(.97);
  transition: transform var(--trans-normal);
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg-input);
  color: var(--txt-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans-fast);
}
.modal-close:hover { background: #ffe4e6; color: var(--clr-danger); }

.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .35s;
  opacity: 0;
}

.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }

.toast-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.toast.success .toast-icon { background: #dcfce7; color: #16a34a; }
.toast.error   .toast-icon { background: #ffe4e6; color: #be123c; }
.toast.info    .toast-icon { background: #dbeafe; color: #1d4ed8; }
.toast.warning .toast-icon { background: #fef3c7; color: #92400e; }

.toast-content { flex: 1; }
.toast-title   { font-weight: 700; font-size: .875rem; margin-bottom: 2px; }
.toast-message { font-size: .8rem; color: var(--txt-secondary); }

.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  animation: toastProgress 4s linear forwards;
}

.toast.success .toast-progress { background: var(--clr-success); }
.toast.error   .toast-progress { background: var(--clr-danger); }
.toast.info    .toast-progress { background: var(--clr-info); }
.toast.warning .toast-progress { background: var(--clr-warning); }

@keyframes toastProgress { from { width: 100%; } to { width: 0; } }

/* ── Loading Skeleton ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-input) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Progress Timeline ──────────────────────────────────────── */
.timeline {
  display: flex;
  align-items: center;
  position: relative;
  padding: 12px 0;
  gap: 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.timeline-step.done:not(:last-child)::after { background: var(--clr-primary); }

.step-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  z-index: 1;
  transition: all var(--trans-normal);
}

.timeline-step.done   .step-circle { border-color: var(--clr-primary); background: var(--clr-primary); color: #fff; }
.timeline-step.active .step-circle { border-color: var(--clr-primary); background: var(--clr-primary-pale); color: var(--clr-primary); box-shadow: 0 0 0 4px rgba(14,165,233,.2); }

.step-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--txt-muted);
  margin-top: 8px;
  text-align: center;
}

.timeline-step.done   .step-label,
.timeline-step.active .step-label { color: var(--clr-primary); }

/* ── Urgency badges ─────────────────────────────────────────── */
.urgency-normal    { color: var(--clr-primary);  background: var(--clr-primary-pale); }
.urgency-important { color: var(--clr-warning);  background: #fef3c7; }
.urgency-emergency { color: var(--clr-danger);   background: #ffe4e6; animation: pulse-ring 1.5s infinite; }

@keyframes pulse-ring {
  0%,100% { box-shadow: 0 0 0 0 rgba(244,63,94,.4); }
  50%     { box-shadow: 0 0 0 6px rgba(244,63,94,0); }
}

/* ── Drag & Drop Upload ──────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  transition: all var(--trans-normal);
  cursor: pointer;
  background: var(--bg-input);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--clr-primary);
  background: var(--clr-primary-pale);
}

.drop-zone-icon { font-size: 2.5rem; margin-bottom: 12px; }
.drop-zone-text { color: var(--txt-secondary); font-size: .875rem; }
.drop-zone-text strong { color: var(--clr-primary); }

/* ── Calendar ───────────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--trans-fast);
  position: relative;
}

.cal-cell:hover  { background: var(--clr-primary-pale); color: var(--clr-primary); }
.cal-cell.today  { background: var(--clr-primary); color: #fff; font-weight: 700; }
.cal-cell.has-appt::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px; height: 5px;
  background: var(--clr-accent);
  border-radius: 50%;
}
.cal-cell.other-month { color: var(--txt-muted); }

/* ── Queue Monitor ──────────────────────────────────────────── */
.queue-card {
  text-align: center;
  padding: 32px;
}

.queue-number {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.queue-label { color: var(--txt-secondary); font-size: .875rem; margin-top: 8px; }

/* ── Search input ───────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--txt-muted);
  pointer-events: none;
}
.search-wrap .form-control { padding-left: 38px; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}

.page-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--txt-secondary);
  font-size: .825rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans-fast);
}

.page-btn:hover  { border-color: var(--clr-primary); color: var(--clr-primary); }
.page-btn.active { background: var(--clr-primary); border-color: var(--clr-primary); color: #fff; }

/* ── Floating Action Button ─────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(14,165,233,.45);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  transition: all var(--trans-normal);
  z-index: 200;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 28px rgba(14,165,233,.55);
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}

.anim-fadein     { animation: fadeIn .4s ease both; }
.anim-fadeup     { animation: fadeInUp .45s ease both; }
.anim-scalein    { animation: scaleIn .35s ease both; }

.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }
.delay-5 { animation-delay: .25s; }
.delay-6 { animation-delay: .3s; }

/* ── Landing page ───────────────────────────────────────────── */
.landing-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0f1e 0%, #0c1a33 50%, #0d2045 100%);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .25;
  pointer-events: none;
}

.orb-1 { width: 600px; height: 600px; background: #0ea5e9; top: -200px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: #06d6a0; bottom: -100px; left: -50px; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(14,165,233,.15);
  border: 1px solid rgba(14,165,233,.3);
  border-radius: 99px;
  color: #38bdf8;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-title span {
  background: linear-gradient(90deg, #38bdf8, #06d6a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: #94a3b8;
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.service-card-land {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all var(--trans-normal);
  cursor: default;
}

.service-card-land:hover {
  background: rgba(14,165,233,.1);
  border-color: rgba(14,165,233,.3);
  transform: translateY(-4px);
}

.service-icon-land {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.service-name-land { color: #fff; font-weight: 700; margin-bottom: 6px; font-size: .9rem; }
.service-price-land { color: #38bdf8; font-weight: 700; font-size: .875rem; }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-xl);
  animation: scaleIn .4s ease both;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--clr-primary), #38bdf8);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(14,165,233,.4);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-sub { color: var(--txt-secondary); font-size: .875rem; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--txt-muted);
  font-size: .8rem;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Notification dropdown ──────────────────────────────────── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 300;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all var(--trans-normal);
}

.notif-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.notif-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--trans-fast);
  cursor: pointer;
}

.notif-item:hover { background: var(--bg-input); }
.notif-item.unread { background: rgba(14,165,233,.04); }

.notif-dot2 {
  width: 8px; height: 8px;
  background: var(--clr-primary);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.notif-text { flex: 1; }
.notif-title2 { font-size: .825rem; font-weight: 600; margin-bottom: 2px; }
.notif-time   { font-size: .75rem; color: var(--txt-muted); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .page-content { padding: 16px; }

  .stats-grid { grid-template-columns: repeat(2,1fr); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Schedule page: make grid cards fit better */
  .card { padding: 18px; }

  /* Dentist/My Schedule page uses inline grid; ensure it collapses nicely */
  .card > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .modal { max-width: 100%; margin: 0 auto; }

  .hero-content { padding: 0 20px; }

  .topbar { padding: 12px 16px; }

  .fab { bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }

  .page-content { padding: 12px; }

  /* Force schedule day cards to single column on small phones */
  .card > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Appointment Details: stack summary + status panel */
  .anim-fadeup[style*="grid-template-columns:1.2fr .8fr"] {
    grid-template-columns: 1fr !important;
  }

  /* On small phones, disable sticky so the whole page scrolls normally */
  .card[style*="position:sticky"] {
    position: static !important;
    top: auto !important;
  }
}




/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt-muted); }

/* ── Utility ────────────────────────────────────────────────── */
.text-primary   { color: var(--clr-primary)   !important; }
.text-success   { color: var(--clr-success)   !important; }
.text-danger    { color: var(--clr-danger)    !important; }
.text-warning   { color: var(--clr-warning)   !important; }
.text-muted     { color: var(--txt-muted)     !important; }
.text-secondary { color: var(--txt-secondary) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }

.fw-400 { font-weight: 400; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.d-flex     { display: flex; }
.d-grid     { display: grid; }
.d-none     { display: none; }
.d-block    { display: block; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.rounded   { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 50%; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }

.cursor-pointer { cursor: pointer; }

.overflow-hidden { overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── PWA install banner ──────────────────────────────────────── */
.pwa-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  z-index: 500;
  transform: translateY(100%);
  transition: transform var(--trans-slow);
}

.pwa-banner.show { transform: translateY(0); }
