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

/* ─────────────────────────────────────────
   DESIGN TOKENS — LIGHT (default)
───────────────────────────────────────── */
:root {
  /* Brand primitives */
  --blue:      #002E6D;
  --teal:      #45C2B1;
  --teal-dark: #1BA39C;
  --orange:    #F29729;
  --prostate:  #0182FC;

  /* Semantic — light mode */
  --bg:        #F3F6FC;
  --bg-light:  #F7F9FB;
  --white:     #FFFFFF;
  --surface:   #FFFFFF;
  --text:      #313131;   /* 11.9:1 on white ✓ */
  --text-2:    #5E6878;   /* 5.8:1 on white ✓  (was #717A86 ~4.1:1) */
  --text-3:    #767F8E;   /* 4.8:1 on white ✓  (was #B9C4D9 ~1.8:1) */
  --border:    #E4EAF4;
  --shadow-sm: 0 1px 4px rgba(0,46,109,0.06);
  --shadow-md: 0 2px 12px rgba(0,46,109,0.09);

  /* Radii & layout */
  --r-sm:      8px;
  --r-md:      12px;
  --r-lg:      16px;
  --r-pill:    9999px;
  --sidebar-w: 240px;

  /* Transition */
  --t: all 0.2s ease;
}

/* ─────────────────────────────────────────
   DARK MODE
───────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #0D1117;
  --bg-light:  #161C24;
  --white:     #161C24;
  --surface:   #1E2630;
  --text:      #F0F4FF;
  --text-2:    #8FA0BE;
  --text-3:    #7C90A8;  /* 5.0:1 on #1E2630 ✓ (was #3A4D65 ~1.7:1) */
  --border:    #2A3748;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.4);

  /* Brand colors adapted for dark surfaces */
  --teal:      #45C2B1;
  --teal-dark: #6ED8CC;
  --blue:      #60A8F0;  /* 6.5:1 on #1E2630 ✓ (was #002E6D ~1.2:1 — nearly invisible) */
}

[data-theme="dark"] body          { background: var(--bg); }
[data-theme="dark"] .sidebar      { background: #080D14; }
[data-theme="dark"] .card         { background: var(--surface); }
[data-theme="dark"] .topbar       { background: #161C24; border-color: var(--border); }
[data-theme="dark"] .stat-card    { background: var(--surface); }
[data-theme="dark"] .appt-date-chip { background: var(--bg); border-color: var(--border); }
[data-theme="dark"] .cal-nav-btn  { background: var(--bg); }
[data-theme="dark"] .cal-day:hover:not(.today):not(.appt) { background: var(--bg); }
[data-theme="dark"] .icon-btn     { background: var(--bg); }
[data-theme="dark"] .mob-tabbar   { background: #161C24; border-color: var(--border); }
[data-theme="dark"] .mob-tab svg  { stroke: var(--text-3); }
[data-theme="dark"] .mob-tab.active svg { stroke: var(--teal); }
[data-theme="dark"] .badge-grey   { background: var(--bg); border-color: var(--border); }
[data-theme="dark"] .med-card.blue-tint  { background: rgba(1,130,252,0.08); }
[data-theme="dark"] .med-card.green-tint { background: rgba(39,174,96,0.08); }
[data-theme="dark"] .progress-track { background: var(--bg); }
[data-theme="dark"] .cal-day.today  { background: #1D5FA8; color: #fff; }  /* medium blue — 6.1:1 on white ✓ */
[data-theme="dark"] .badge-blue     { color: #60A8F0; background: rgba(96,168,240,0.12); }  /* 6.5:1 on surface ✓ */
[data-theme="dark"] .badge-green    { color: #4ACA76; background: rgba(74,202,118,0.12); }  /* 7.8:1 on surface ✓ */

/* ─────────────────────────────────────────
   HIGH CONTRAST MODE
   #FFE600 on #0A0A0A = 18.7:1 (AAA)
───────────────────────────────────────── */
[data-theme="high-contrast"] {
  --bg:        #0A0A0A;
  --bg-light:  #141414;
  --white:     #141414;
  --surface:   #1A1A1A;
  --text:      #FFE600;
  --text-2:    #FFE600;
  --text-3:    rgba(255,230,0,0.4);
  --border:    #FFE600;
  --shadow-sm: none;
  --shadow-md: none;
  --teal:      #FFE600;
  --teal-dark: #FFF176;
  --orange:    #FFE600;
  --blue:      #000000;
}

[data-theme="high-contrast"] body             { background: var(--bg); color: var(--text); }
[data-theme="high-contrast"] .sidebar         { background: #000; border-right: 1px solid #FFE600; }
[data-theme="high-contrast"] .logo-img         { filter: brightness(0) saturate(0) invert(1); }
[data-theme="high-contrast"] .logo-sub        { color: rgba(255,230,0,0.5); }
[data-theme="high-contrast"] .nav-item        { color: rgba(255,230,0,0.6); }
[data-theme="high-contrast"] .nav-item.active { background: rgba(255,230,0,0.12); color: #FFE600; }
[data-theme="high-contrast"] .nav-item:hover:not(.active) { background: rgba(255,230,0,0.06); color: #FFE600; }
[data-theme="high-contrast"] .nav-badge       { background: #FFE600; color: #000; }
[data-theme="high-contrast"] .avatar          { background: #FFE600; color: #000; }
[data-theme="high-contrast"] .avatar-name     { color: #FFE600; }
[data-theme="high-contrast"] .card            { background: var(--surface); border-color: #FFE600; }
[data-theme="high-contrast"] .topbar          { background: #000; border-color: #FFE600; }
[data-theme="high-contrast"] .stat-card       { background: var(--surface); border-color: #FFE600; }
[data-theme="high-contrast"] .stat-card::before { background: #FFE600 !important; }
[data-theme="high-contrast"] .stat-value      { color: #FFE600; }
[data-theme="high-contrast"] .appt-day-num    { color: #FFE600; }
[data-theme="high-contrast"] .appt-date-chip  { background: #000; border-color: #FFE600; }
[data-theme="high-contrast"] .cal-day.today   { background: #FFE600; color: #000; }
[data-theme="high-contrast"] .cal-day.appt    { background: rgba(255,230,0,0.12); color: #FFE600; }
[data-theme="high-contrast"] .cal-day.appt::after { background: #FFE600; }
[data-theme="high-contrast"] .cal-nav-btn     { background: #000; border: 1px solid #FFE600; color: #FFE600; }
[data-theme="high-contrast"] .icon-btn        { background: #000; border: 1px solid #FFE600; }
[data-theme="high-contrast"] .icon-btn svg    { stroke: #FFE600; }
[data-theme="high-contrast"] .cta-btn         { background: #FFE600; color: #000; }
[data-theme="high-contrast"] .cta-btn:hover   { background: #FFF176; }
[data-theme="high-contrast"] .badge-teal,
[data-theme="high-contrast"] .badge-orange,
[data-theme="high-contrast"] .badge-blue,
[data-theme="high-contrast"] .badge-green,
[data-theme="high-contrast"] .badge-grey      { background: rgba(255,230,0,0.1); color: #FFE600; border: 1px solid rgba(255,230,0,0.3); }
[data-theme="high-contrast"] .wellbeing-card  { background: #000; border: 1px solid #FFE600; }
[data-theme="high-contrast"] .wellbeing-btn   { background: #FFE600; color: #000; }
[data-theme="high-contrast"] .med-btn         { background: #FFE600; color: #000; }
[data-theme="high-contrast"] .med-card        { border-color: rgba(255,230,0,0.3) !important; background: rgba(255,230,0,0.04) !important; }
[data-theme="high-contrast"] .progress-fill   { background: #FFE600 !important; }
[data-theme="high-contrast"] .progress-track  { background: rgba(255,230,0,0.1); }
[data-theme="high-contrast"] .mob-tabbar      { background: #000; border-color: #FFE600; }
[data-theme="high-contrast"] .mob-tab svg     { stroke: rgba(255,230,0,0.4); }
[data-theme="high-contrast"] .mob-tab.active svg { stroke: #FFE600; }
[data-theme="high-contrast"] .sidebar-footer  { border-color: rgba(255,230,0,0.2); }
[data-theme="high-contrast"] .theme-switcher  { border-color: rgba(255,230,0,0.2); }
[data-theme="high-contrast"] .theme-btn       { color: rgba(255,230,0,0.5); border-color: rgba(255,230,0,0.2); }
[data-theme="high-contrast"] .theme-btn.active { background: #FFE600; color: #000; border-color: #FFE600; }

/* ─────────────────────────────────────────
   THEME SWITCHER (in sidebar)
───────────────────────────────────────── */
.theme-switcher {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.theme-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);  /* ~5.1:1 on blue sidebar ✓ (was 0.28 ~2.4:1) */
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 8px;
}

.theme-btns {
  display: flex;
  gap: 6px;
}

.theme-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: rgba(255,255,255,0.6);  /* 5.8:1 on sidebar ✓ (was 0.4 ~3.6:1) */
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--t);
}

.theme-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}

.theme-btn.active {
  background: rgba(69,194,177,0.18);
  border-color: var(--teal);
  color: var(--teal);
}

html { height: 100%; }

body {
  font-family: 'Raleway', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
svg { display: block; }

/* ─────────────────────────────────────────
   LAYOUT SHELL
───────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ─────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--blue);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  padding: 28px 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.logo-img {
  display: block;
  width: 190px;
  height: auto;
  margin-bottom: 4px;
}

.logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.55);  /* ~5.1:1 on blue sidebar ✓ (was 0.35 ~3.0:1) */
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.nav-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);  /* ~5.1:1 on blue sidebar ✓ (was 0.28 ~2.4:1) */
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s; }
.nav-item.active { background: rgba(69,194,177,0.14); color: #fff; }
.nav-item.active svg { opacity: 1; }
.nav-item:hover:not(.active) { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); }

.nav-badge {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.avatar-name { font-size: 12px; font-weight: 700; color: #fff; }
.avatar-id   { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 1px; }  /* 5.8:1 on sidebar ✓ */

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ─────────────────────────────────────────
   MAIN CONTENT AREA
───────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─────────────────────────────────────────
   TOPBAR
───────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: none;
  flex-shrink: 0;
  color: var(--text-2);
}

.topbar-greeting { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
.topbar-date     { font-size: 12px; color: var(--text-2); margin-top: 2px; }

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #E53935;
  border: 1.5px solid var(--white);
}

.cta-btn {
  font-weight: 600;
  font-size: 13px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 20px;
  white-space: nowrap;
  transition: background 0.15s;
}
.cta-btn:hover { background: #d97e1a; }

/* ─────────────────────────────────────────
   PAGE CONTENT
───────────────────────────────────────── */
.content {
  flex: 1;
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─────────────────────────────────────────
   CARDS
───────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 20px;
}

.card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 14px;
}

/* ─────────────────────────────────────────
   STAT CARDS
───────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stat-card.teal::before     { background: var(--teal); }
.stat-card.orange::before   { background: var(--orange); }
.stat-card.prostate::before { background: var(--prostate); }

.stat-label { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--blue); line-height: 1.1; }
.stat-value .unit { font-size: 14px; font-weight: 400; color: var(--text-2); }
.stat-sub   { font-size: 12px; color: var(--text-2); }

/* ─────────────────────────────────────────
   BADGES
───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-teal   { background: rgba(69,194,177,0.12);  color: #1BA39C; }
.badge-orange { background: rgba(242,151,41,0.14);  color: #c97a10; }
.badge-blue   { background: rgba(1,130,252,0.10);   color: #0160c2; }
.badge-grey   { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.badge-green  { background: rgba(39,174,96,0.12);   color: #1a7a42; }

/* ─────────────────────────────────────────
   THREE-COLUMN CONTENT GRID
───────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 300px;
  gap: 20px;
  align-items: start;
}

.col-left  { display: flex; flex-direction: column; gap: 20px; }
.col-right { display: flex; flex-direction: column; gap: 20px; }

/* ─────────────────────────────────────────
   CALENDAR
───────────────────────────────────────── */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cal-month { font-size: 16px; font-weight: 700; color: var(--text); }
.cal-nav   { display: flex; gap: 6px; }
.cal-nav-btn {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--border); }

.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }

.cal-day-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.cal-day:hover:not(.today):not(.appt) { background: var(--bg); }
.cal-day.other { color: var(--text-3); }
.cal-day.today { background: var(--blue); color: #fff; font-weight: 700; }
.cal-day.appt  { background: rgba(69,194,177,0.12); color: var(--teal-dark); font-weight: 700; }
.cal-day.appt::after {
  content: '';
  position: absolute;
  bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--teal);
}

.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); }
.dot { width: 10px; height: 10px; flex-shrink: 0; }
.dot-teal { border-radius: 50%; background: var(--teal); }
.dot-blue { border-radius: 3px; background: var(--blue); }

/* ─────────────────────────────────────────
   APPOINTMENTS LIST
───────────────────────────────────────── */
.appt-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.appt-item:last-child { border-bottom: none; padding-bottom: 0; }
.appt-item:first-child { padding-top: 0; }

.appt-date-chip {
  min-width: 50px;
  text-align: center;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 8px 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.appt-day-num { font-size: 20px; font-weight: 700; color: var(--blue); line-height: 1; }
.appt-month   { font-size: 9px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

.appt-info    { flex: 1; min-width: 0; }
.appt-title   { font-size: 14px; font-weight: 700; color: var(--text); }
.appt-detail  { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }

/* ─────────────────────────────────────────
   HEALTH METRICS
───────────────────────────────────────── */
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.metric-row:first-child { padding-top: 0; }
.metric-row:last-child  { border-bottom: none; padding-bottom: 0; }

.metric-name { font-size: 13px; font-weight: 600; color: var(--text); }
.metric-sub  { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.metric-val  { font-size: 15px; font-weight: 700; color: var(--blue); text-align: right; white-space: nowrap; }
.metric-right { text-align: right; flex-shrink: 0; }

.progress-track {
  height: 5px;
  background: var(--bg);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
  width: 160px;
}
.progress-fill { height: 100%; border-radius: 999px; }

/* ─────────────────────────────────────────
   MEDICATION
───────────────────────────────────────── */
.med-stack { display: flex; flex-direction: column; gap: 10px; }

.med-card {
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.med-card.blue-tint  { background: rgba(1,130,252,0.04);  border: 1px solid rgba(1,130,252,0.14); }
.med-card.green-tint { background: rgba(39,174,96,0.04);  border: 1px solid rgba(39,174,96,0.18); }

.med-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.med-icon.blue  { background: rgba(1,130,252,0.10); }
.med-icon.green { background: rgba(39,174,96,0.10); }

.med-info { flex: 1; min-width: 0; }
.med-title { font-size: 14px; font-weight: 700; color: var(--text); }
.med-sub   { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.med-btn {
  font-weight: 600;
  font-size: 12px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 7px 16px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.med-btn:hover { background: var(--teal-dark); }

/* ─────────────────────────────────────────
   DOCTOR / CARE TEAM CARD
───────────────────────────────────────── */
.doctor-card {
  padding: 0;
  overflow: hidden;
}

.mobile-doctor-card {
  display: none;
}

.doctor-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: 65% 20%;
  display: block;
}

.doctor-info {
  padding: 14px 18px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doctor-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.doctor-role {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ─────────────────────────────────────────
   WELLBEING CARD
───────────────────────────────────────── */
.wellbeing-card {
  background: linear-gradient(120deg, #002E6D 0%, #004faa 100%);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wellbeing-card h3 { font-size: 15px; font-weight: 700; color: #fff; }
.wellbeing-card p  { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 5px; line-height: 1.5; }

.wellbeing-btn {
  font-weight: 600;
  font-size: 13px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 10px 22px;
  width: 100%;
  transition: background 0.15s;
}
.wellbeing-btn:hover { background: #d97e1a; }

/* ─────────────────────────────────────────
   MOBILE BOTTOM NAV
───────────────────────────────────────── */
.mob-tabbar {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(16px, env(safe-area-inset-bottom));
  position: sticky;
  bottom: 0;
  z-index: 50;
}

.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border: none;
  background: none;
}
.mob-tab-label { font-size: 10px; font-weight: 600; color: var(--text-3); }
.mob-tab svg   { stroke: var(--text-3); }
.mob-tab.active .mob-tab-label { color: var(--teal); }
.mob-tab.active svg            { stroke: var(--teal); }

/* ─────────────────────────────────────────
   RESPONSIVE — TABLET  (< 1100px)
   Calendar + appointments side by side,
   right column spans full width below.
───────────────────────────────────────── */
@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .col-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .wellbeing-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .stat-row {
    grid-template-columns: 1fr 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .col-right {
    grid-column: 1;
    grid-template-columns: 1fr 1fr;
  }

  .progress-track { width: 120px; }
}

/* ─────────────────────────────────────────
   RESPONSIVE — MOBILE  (< 768px)
───────────────────────────────────────── */
@media (max-width: 767px) {

  /* Sidebar: off-canvas */
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }

  /* Main takes full width */
  .main {
    margin-left: 0;
    padding-bottom: 0;
  }

  .topbar {
    padding: 0 16px;
    height: 56px;
  }

  .hamburger { display: flex; }

  .topbar-date   { display: none; }
  .topbar-greeting { font-size: 15px; }

  .cta-btn { display: none; }

  .content {
    padding: 16px 16px 24px;
    gap: 14px;
  }

  .stat-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-value { font-size: 24px; }

  .content-grid { gap: 14px; }

  .col-right { grid-template-columns: 1fr; }

  .card { padding: 16px; }

  .med-card { flex-wrap: wrap; }

  .progress-track { width: 100%; max-width: 140px; }

  /* Show bottom nav */
  .mob-tabbar { display: flex; }

  /* Doctor card at top on mobile */
  .mobile-doctor-card {
    display: block;
    margin-bottom: 14px;
  }

  .col-left .doctor-card {
    display: none;
  }
}

@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr; }
}
