/* ============================================================
   MediMind — Global Stylesheet
   All design tokens live in :root. Change colors/spacing there
   and the whole site updates.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* --- Surfaces --- */
  --bg:            #0a0e16;   /* main app background */
  --bg-sidebar:    #0c111b;   /* left sidebar */
  --card:          #121a27;   /* cards / panels */
  --card-2:        #18212f;   /* nested / hover surfaces */
  --card-3:        #1d2736;   /* inputs, chips */
  --border:        #1e2836;   /* subtle borders */
  --border-soft:   #182230;

  /* --- Brand / accent --- */
  --accent:        #18d6a6;   /* primary teal-emerald */
  --accent-dark:   #10b890;
  --accent-soft:   rgba(24,214,166,0.12);
  --purple:        #8b5cf6;
  --blue:          #4f8ef7;
  --cyan:          #22d3ee;
  --grad-brand:    linear-gradient(135deg, #16c9a0 0%, #38b6d6 45%, #8b5cf6 100%);
  --grad-auth:     linear-gradient(150deg, #14c79a 0%, #2f8fd0 50%, #7c5cf0 100%);
  --grad-report:   linear-gradient(120deg, #18c9a3 0%, #4f9ad6 55%, #8b5cf6 100%);

  /* --- Status --- */
  --yellow:        #f5c84b;
  --red:           #f0556d;
  --red-soft:      rgba(240,85,109,0.12);
  --green:         #18d6a6;

  /* --- Text --- */
  --text:          #e9eef5;
  --text-2:        #aeb9c7;
  --muted:         #7e8a9a;
  --muted-2:       #5d6878;

  /* --- Misc --- */
  --radius:        16px;
  --radius-sm:     10px;
  --radius-lg:     22px;
  --shadow:        0 18px 50px rgba(0,0,0,0.45);
  --sidebar-w:     250px;
  --font:          'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ===========================================================
   App shell (sidebar + main) — used on all logged-in pages
   =========================================================== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;            /* inner .nav-scroll handles overflow */
}

/* scrollable nav region: keeps brand on top + footer pinned bottom */
.nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.nav-scroll::-webkit-scrollbar { width: 6px; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  color: #fff; font-size: 20px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(24,201,160,0.35);
}
.brand .name { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }

.nav-group { margin-top: 8px; }
.nav-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--muted-2); text-transform: uppercase;
  padding: 16px 12px 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: 14.5px; font-weight: 500;
  position: relative;
  transition: background .18s, color .18s;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--card-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: #06231b; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 20px; display: grid; place-items: center;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: 14px;
  display: flex; align-items: center; gap: 11px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}
.sidebar-footer .avatar {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad-brand);
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.sidebar-footer .who { line-height: 1.2; }
.sidebar-footer .who b { font-size: 13.5px; }
.sidebar-footer .who span { font-size: 12px; color: var(--muted); }
.sidebar-footer .gear { margin-left: auto; color: var(--muted); }

/* ---------- Main column ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 26px 32px 48px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 26px;
}
.topbar .titles h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; }
.topbar .titles p { color: var(--muted); font-size: 14px; }
.topbar .spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 16px; width: 320px;
  color: var(--muted);
}
.search svg { width: 17px; height: 17px; }
.search input {
  background: none; border: none; outline: none; color: var(--text);
  font-size: 14px; width: 100%;
}
.search input::placeholder { color: var(--muted); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-2);
  position: relative; transition: background .18s;
}
.icon-btn:hover { background: var(--card-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  border: 2px solid var(--card);
}

/* ===========================================================
   Reusable bits
   =========================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.card-title .ico {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.card-title .ico svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600;
  transition: transform .12s, filter .18s, background .18s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #06231b; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-grad { background: var(--grad-brand); color: #fff; }
.btn-grad:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--card-3); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--card-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 30px;
  font-size: 12.5px; font-weight: 600;
}
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-muted  { background: var(--card-3); color: var(--text-2); }

.tag-confirmed { background: var(--accent-soft); color: var(--accent); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }

.grid { display: grid; gap: 20px; }

/* page header row (title + action buttons) — stacks on mobile */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .ph-title h2 { font-size: 20px; }
.page-head .ph-title p { color: var(--muted); font-size: 13.5px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; }

/* progress bar */
.prog { height: 8px; border-radius: 8px; background: var(--card-3); overflow: hidden; }
.prog > span { display: block; height: 100%; border-radius: 8px; background: var(--accent); }

/* ===========================================================
   Page-specific styles are kept here too so there's one CSS file
   =========================================================== */

/* --- Dashboard --- */
.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.sos-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(90deg, rgba(240,85,109,0.10), rgba(240,85,109,0.04));
  border: 1px solid rgba(240,85,109,0.25);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px;
}
.sos-banner .sos-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; }
.sos-banner .sos-ico svg { width: 22px; height: 22px; }
.sos-banner h3 { font-size: 16px; }
.sos-banner p { color: var(--muted); font-size: 13.5px; }
.sos-banner .btn { margin-left: auto; }

.quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 26px; }
.quick {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; transition: transform .15s, border-color .15s;
}
.quick:hover { transform: translateY(-3px); border-color: var(--accent); }
.quick .qi { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px; }
.quick .qi svg { width: 22px; height: 22px; color: #fff; }
.qi.teal   { background: linear-gradient(135deg,#13b890,#0d8f72); }
.qi.purple { background: linear-gradient(135deg,#7c5cf0,#5b3fd0); }
.qi.pink   { background: linear-gradient(135deg,#f06a8a,#d44a6c); }
.qi.blue   { background: linear-gradient(135deg,#4f8ef7,#3567d6); }
.quick h4 { font-size: 15px; }
.quick p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h3 { font-size: 17px; }
.section-head a { color: var(--accent); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

.appt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.appt {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.appt .av { width: 42px; height: 42px; border-radius: 11px; background: var(--card-3); display: grid; place-items: center; color: var(--accent); }
.appt .av svg { width: 20px; height: 20px; }
.appt .info b { font-size: 14.5px; }
.appt .info .spec { color: var(--muted); font-size: 12.5px; }
.appt .info .when { color: var(--text-2); font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.appt .tag-confirmed { margin-left: auto; align-self: flex-start; }

.score-ring { display: grid; place-items: center; text-align: center; }
.ring { position: relative; width: 150px; height: 150px; margin: 6px 0 12px; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-bg { fill: none; stroke: var(--card-3); stroke-width: 11; }
.ring .ring-fg { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; }
.ring .ring-num { position: absolute; inset: 0; display: grid; place-items: center; flex-direction: column; }
.ring .ring-num b { font-size: 34px; font-weight: 800; }
.ring .ring-num span { font-size: 12px; color: var(--muted); }

.metric { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
.metric:last-child { border-bottom: none; }
.metric .mi { width: 38px; height: 38px; border-radius: 10px; background: var(--card-3); display: grid; place-items: center; }
.metric .mi svg { width: 18px; height: 18px; }
.metric .ml span { color: var(--muted); font-size: 12.5px; }
.metric .ml b { display: block; font-size: 15px; }
.metric .delta { margin-left: auto; font-size: 13px; font-weight: 700; }
.delta.up { color: var(--accent); } .delta.down { color: var(--red); } .delta.neutral { color: var(--blue); }

.insight { background: linear-gradient(160deg, rgba(139,92,246,0.14), rgba(139,92,246,0.04)); border: 1px solid rgba(139,92,246,0.25); }
.insight .pill { background: rgba(139,92,246,0.18); color: #b69bff; margin-bottom: 12px; }
.insight h3 { font-size: 16px; margin-bottom: 6px; }
.insight p { color: var(--text-2); font-size: 13.5px; }

/* --- Chat --- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 130px); }
.chat-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 6px 4px 20px; }
.msg { display: flex; gap: 12px; max-width: 70%; }
.msg .ava { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; }
.msg.ai .ava { background: var(--grad-brand); color: #fff; }
.msg.ai .bubble { background: var(--card); border: 1px solid var(--border); }
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.msg.user .ava { background: var(--card-3); color: var(--accent); font-weight: 700; }
.msg.user .bubble { background: var(--accent); color: #06231b; }
.bubble { padding: 14px 17px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { padding: 7px 14px; border-radius: 30px; background: var(--card-3); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); cursor: pointer; transition: .15s; }
.chip:hover, .chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.report-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-top: 6px; max-width: 70%; }
.report-card .ri { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.report-card b { font-size: 14.5px; } .report-card .sub { color: var(--muted); font-size: 12px; }
.report-card .btn { margin-left: auto; }
.chat-input { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 8px 8px 8px 18px; margin-top: 8px; }
.chat-input input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14.5px; }
.chat-input input::placeholder { color: var(--muted); }
.chat-input .send { width: 44px; height: 44px; border-radius: 11px; background: var(--accent); color: #06231b; display: grid; place-items: center; }
.chat-input .mic { width: 44px; height: 44px; border-radius: 11px; background: var(--card-3); color: var(--text-2); display: grid; place-items: center; }

/* --- Symptom analysis --- */
.analysis-grid { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.sym-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 24px; }
.sym-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 30px; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; font-weight: 600; }
.sym-chip .x { cursor: pointer; opacity: .7; } .sym-chip .x:hover { opacity: 1; }
.add-sym { background: var(--card-3); color: var(--text-2); border: 1px dashed var(--border); }
.slider-wrap { margin-bottom: 24px; }
.slider { position: relative; height: 6px; border-radius: 6px; background: var(--card-3); margin: 14px 0 8px; }
.slider .fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 6px; background: var(--yellow); }
.slider .knob { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); transform: translate(-50%,-50%); box-shadow: 0 0 0 4px rgba(245,200,75,0.2); cursor: pointer; }
.slider-labels { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.slider-labels .cur { color: var(--yellow); font-weight: 700; }
.dur-row { display: flex; gap: 9px; margin-bottom: 22px; flex-wrap: wrap; }
.dur { padding: 9px 16px; border-radius: 10px; background: var(--card-3); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); cursor: pointer; }
.dur.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.notes { width: 100%; min-height: 92px; background: var(--card-3); border: 1px solid var(--border); border-radius: 12px; padding: 14px; color: var(--text); font-size: 14px; resize: vertical; outline: none; }
.body-map { text-align: center; }
.body-map svg { margin: 10px auto; }
.body-map .cap { color: var(--muted); font-size: 12.5px; }
.preview { background: linear-gradient(160deg, rgba(139,92,246,0.12), rgba(139,92,246,0.03)); border: 1px solid rgba(139,92,246,0.22); margin-top: 20px; }
.preview .pill { background: rgba(139,92,246,0.18); color: #b69bff; margin-bottom: 12px; }
.preview h4 { margin-bottom: 6px; } .preview p { color: var(--text-2); font-size: 13.5px; }

/* --- Voice assistant --- */
.voice-wrap { display: grid; place-items: center; padding-top: 30px; text-align: center; }
.orb-ring { width: 220px; height: 220px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(24,214,166,0.3); position: relative; }
.orb-ring::after { content:''; position:absolute; inset:-14px; border-radius:50%; border:1px solid rgba(24,214,166,0.12); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:.6} 50%{transform:scale(1.06);opacity:.2} }
.orb { width: 170px; height: 170px; border-radius: 50%; background: var(--grad-brand); display: grid; place-items: center; box-shadow: 0 16px 50px rgba(24,201,160,0.4); }
.orb svg { width: 56px; height: 56px; color: #fff; }
.listening { color: var(--accent); font-size: 13.5px; font-weight: 600; margin-top: 20px; display:flex; align-items:center; gap:6px; justify-content:center; }
.voice-title { font-size: 24px; font-weight: 700; margin-top: 6px; }
.wave { display: flex; align-items: center; gap: 5px; justify-content: center; height: 26px; margin-top: 10px; }
.wave span { width: 4px; border-radius: 4px; background: var(--accent); animation: wave 1s ease-in-out infinite; }
.wave span:nth-child(odd){ animation-delay:.2s } .wave span:nth-child(3n){ animation-delay:.4s }
@keyframes wave { 0%,100%{height:6px} 50%{height:24px} }
.voice-transcript { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; max-width: 540px; margin: 30px auto 0; text-align: left; display:flex; flex-direction:column; gap:14px; }
.voice-controls { display: flex; gap: 14px; justify-content: center; margin-top: 26px; }
.vc { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; }
.vc.mic { background: var(--card-3); color: var(--text); } .vc.end { background: var(--red); color: #fff; }
.lang-row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.lang { padding: 7px 16px; border-radius: 30px; background: var(--card-3); color: var(--text-2); font-size: 13px; cursor: pointer; }
.lang.on { background: var(--accent-soft); color: var(--accent); }

/* --- Report --- */
.report-grid { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.report-hero { background: var(--grad-report); border-radius: var(--radius); padding: 24px; display: flex; align-items: center; gap: 18px; color: #fff; }
.report-hero .rh-ico { width: 52px; height: 52px; border-radius: 13px; background: rgba(255,255,255,0.2); display: grid; place-items: center; }
.report-hero h2 { font-size: 22px; } .report-hero p { opacity: .9; font-size: 14px; }
.sev-row { display: flex; align-items: center; gap: 16px; }
.sev-badge { width: 48px; height: 48px; border-radius: 12px; background: rgba(245,200,75,0.15); color: var(--yellow); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.sev-bars { display: flex; gap: 6px; margin-left: auto; }
.sev-bars i { width: 26px; height: 8px; border-radius: 4px; background: var(--card-3); }
.sev-bars i.on { background: var(--yellow); }
.cond { margin-bottom: 16px; }
.cond:last-child { margin-bottom: 0; }
.cond .cond-top { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 14px; }
.cond .cond-pct { font-weight: 700; }
.cond .bar { height: 9px; border-radius: 9px; background: var(--card-3); overflow: hidden; }
.cond .bar > span { display: block; height: 100%; border-radius: 9px; }
.action { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.action:last-child { border-bottom: none; }
.action .ai { width: 34px; height: 34px; border-radius: 9px; background: var(--card-3); display: grid; place-items: center; flex-shrink: 0; }
.action b { font-size: 14px; } .action span { color: var(--muted); font-size: 12.5px; }
.specialist { background: linear-gradient(160deg, rgba(24,214,166,0.1), rgba(24,214,166,0.02)); border-color: rgba(24,214,166,0.25); }
.er { background: linear-gradient(160deg, rgba(240,85,109,0.1), rgba(240,85,109,0.02)); border-color: rgba(240,85,109,0.25); }

/* --- Medicine --- */
.med-tabs { display: flex; gap: 10px; margin-bottom: 22px; }
.med-tab { padding: 9px 18px; border-radius: 10px; background: var(--card-3); color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.med-tab.on { background: var(--accent-soft); color: var(--accent); }
.med-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 26px; }
.med-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.med-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.med-head .mp { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color:#fff; }
.mp.violet{background:linear-gradient(135deg,#7c5cf0,#5b3fd0)} .mp.amber{background:linear-gradient(135deg,#f5b54b,#e0902a)} .mp.teal{background:linear-gradient(135deg,#13b890,#0d8f72)}
.med-head b { font-size: 15px; } .med-head span { color: var(--muted); font-size: 12.5px; }
.med-head .tag-confirmed { margin-left: auto; }
.med-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; margin-bottom: 16px; }
.med-meta .lbl { color: var(--muted); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; }
.med-meta b { font-size: 14px; }
.med-prog-lbl { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.med-warn { background: rgba(245,200,75,0.12); border: 1px solid rgba(245,200,75,0.25); color: var(--yellow); padding: 9px 12px; border-radius: 10px; font-size: 12.5px; margin: 14px 0; display:flex; gap:8px; align-items:center; }
.med-actions { display: flex; gap: 10px; margin-top: 16px; }
.med-actions .btn { flex: 1; padding: 11px; }
.schedule .sch-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.schedule .sch-row:last-child { border-bottom: none; }
.sch-time { font-weight: 700; font-size: 14px; width: 52px; }
.sch-dot { width: 9px; height: 9px; border-radius: 50%; }
.sch-dot.taken{background:var(--accent)} .sch-dot.due{background:var(--yellow)} .sch-dot.up{background:var(--muted-2)}
.sch-info b { font-size: 14px; } .sch-info span { color: var(--muted); font-size: 12.5px; }
.sch-status { margin-left: auto; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.st-taken{background:var(--accent-soft);color:var(--accent)} .st-due{background:rgba(245,200,75,0.15);color:var(--yellow)} .st-up{background:var(--card-3);color:var(--muted)}

/* --- Appointments --- */
.appt-grid { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.spec-filter { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; }
.doc-item { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; cursor: pointer; transition: border-color .15s; }
.doc-item:hover { border-color: var(--accent); }
.doc-item.sel { border-color: var(--accent); background: rgba(24,214,166,0.05); }
.doc-item .da { width: 42px; height: 42px; border-radius: 11px; background: var(--card-3); display:grid; place-items:center; font-weight:700; color:var(--accent); }
.doc-item b { font-size: 14.5px; } .doc-item .spec { color: var(--muted); font-size: 12.5px; }
.doc-item .stars { font-size: 12px; color: var(--yellow); margin-top: 3px; }
.doc-item .price { margin-left: auto; text-align: right; }
.doc-item .price b { display: block; }
.date-row { display: flex; gap: 9px; margin: 12px 0 18px; flex-wrap: wrap; }
.date-cell { text-align: center; padding: 10px 14px; border-radius: 12px; background: var(--card-3); border: 1px solid var(--border); cursor: pointer; min-width: 56px; }
.date-cell.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.date-cell span { display: block; font-size: 11px; color: var(--muted); }
.date-cell.on span { color: var(--accent); }
.date-cell b { font-size: 16px; }
.slots { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin: 12px 0 20px; }
.slot { text-align: center; padding: 11px; border-radius: 10px; background: var(--card-3); border: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.slot.on { background: var(--accent); color: #06231b; font-weight: 600; }
.slot.off { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.visit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 20px; }
.visit-row.single { grid-template-columns: 1fr; }
.visit-row.single .visit { cursor: default; }
.visit { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: 12px; background: var(--card-3); border: 1px solid var(--border); cursor: pointer; }
.visit.on { border-color: var(--accent); background: rgba(24,214,166,0.06); }
.visit .vi { width: 38px; height: 38px; border-radius: 10px; background: var(--card-2); display:grid; place-items:center; color:var(--accent); }
.visit b { font-size: 14px; } .visit span { color: var(--muted); font-size: 12px; }
.visit .price { margin-left: auto; font-weight: 700; font-size: 13px; }

/* --- Doctors --- */
.doctors-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.doctor-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: transform .15s, border-color .15s; }
.doctor-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.doctor-card .dav { width: 70px; height: 70px; border-radius: 18px; margin: 0 auto 14px; display:grid; place-items:center; font-size:24px; font-weight:700; color:#fff; }
.doctor-card h4 { font-size: 16px; } .doctor-card .spec { color: var(--muted); font-size: 13px; }
.doctor-card .meta { display: flex; justify-content: center; gap: 16px; margin: 14px 0; font-size: 13px; color: var(--text-2); }
.doctor-card .meta .yellow { color: var(--yellow); }

/* --- Emergency --- */
.emergency-hero { background: linear-gradient(150deg, rgba(240,85,109,0.18), rgba(240,85,109,0.04)); border: 1px solid rgba(240,85,109,0.3); border-radius: var(--radius-lg); padding: 40px; text-align: center; margin-bottom: 24px; }
.sos-big { width: 150px; height: 150px; border-radius: 50%; background: var(--red); color: #fff; font-size: 22px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 22px; cursor: pointer; box-shadow: 0 0 0 0 rgba(240,85,109,0.6); animation: sos 2s infinite; border: 6px solid rgba(255,255,255,0.1); }
@keyframes sos { 0%{box-shadow:0 0 0 0 rgba(240,85,109,0.55)} 70%{box-shadow:0 0 0 26px rgba(240,85,109,0)} 100%{box-shadow:0 0 0 0 rgba(240,85,109,0)} }
.contacts-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.contact { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.contact .ci { width: 44px; height: 44px; border-radius: 11px; background: var(--red-soft); color: var(--red); display:grid; place-items:center; }
.contact b { font-size: 14.5px; } .contact span { color: var(--muted); font-size: 12.5px; }
.contact .call { margin-left: auto; }

/* --- Profile --- */
.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.profile-card { text-align: center; }
.profile-cover { height: 70px; border-radius: 14px 14px 0 0; background: linear-gradient(120deg, rgba(24,201,160,0.25), rgba(139,92,246,0.25)); margin: -22px -22px 0; }
.profile-av { width: 84px; height: 84px; border-radius: 20px; background: var(--grad-brand); display:grid; place-items:center; font-size:34px; font-weight:700; color:#fff; margin: -42px auto 14px; border: 4px solid var(--card); }
.profile-card h3 { font-size: 19px; } .profile-card .email { color: var(--muted); font-size: 13.5px; }
.profile-stats { display: flex; justify-content: space-around; padding: 18px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); margin: 18px 0; }
.profile-stats .ps b { display:block; font-size: 20px; color: var(--accent); } .profile-stats .ps span { color: var(--muted); font-size: 12px; }
.field { margin-bottom: 16px; }
.field .lbl { color: var(--muted); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 6px; }
.field input { width: 100%; background: var(--card-3); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px; outline: none; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.pref { display: flex; align-items: center; gap: 14px; background: var(--card-2); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.pref .pi { width: 38px; height: 38px; border-radius: 10px; display:grid; place-items:center; }
.pref b { font-size: 14px; } .pref span { color: var(--muted); font-size: 12.5px; }
.toggle { margin-left: auto; width: 44px; height: 24px; border-radius: 20px; background: var(--card-3); position: relative; cursor: pointer; transition: background .2s; }
.toggle::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:.2s; }
.toggle.on { background: var(--accent); } .toggle.on::after { left: 23px; }

/* ===========================================================
   Landing page
   =========================================================== */
.landing { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.lnav { display: flex; align-items: center; gap: 30px; padding: 22px 0; }
.lnav .nav-toggle { display: none; width: 42px; height: 42px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--border); color: var(--text); place-items: center; }
.lnav .nav-toggle svg { width: 22px; height: 22px; }
.lnav .links { margin-left: auto; display: flex; align-items: center; gap: 28px; color: var(--text-2); font-size: 14.5px; }
.lnav .links a:hover { color: var(--text); }
.lnav .links .signin { padding: 9px 18px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--border); }
.hero { text-align: center; padding: 70px 0 50px; }
.hero h1 { font-size: 60px; font-weight: 800; letter-spacing: -2px; line-height: 1.05; }
.hero h1 .grad { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); font-size: 17px; max-width: 620px; margin: 24px auto 0; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin: 34px 0 50px; }
.hero-stats { display: flex; justify-content: center; gap: 60px; }
.hero-stats .hs b { font-size: 30px; font-weight: 800; display: block; }
.hero-stats .hs span { color: var(--muted); font-size: 13.5px; }
.feat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; padding: 30px 0 80px; }
.feat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: transform .15s, border-color .15s; }
.feat:hover { transform: translateY(-4px); border-color: var(--accent); }
.feat .fi { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display:grid; place-items:center; margin-bottom: 16px; }
.feat .fi i { font-size: 20px; }
.feat h4 { font-size: 17px; } .feat p { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ===========================================================
   Auth (sign in / sign up)
   =========================================================== */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-art { background: var(--grad-auth); padding: 44px; display: flex; flex-direction: column; color: #fff; position: relative; overflow: hidden; }
.auth-art .brand .name { color:#fff; }
.auth-art .art-copy { margin: auto 0; max-width: 440px; }
.auth-art .art-copy h2 { font-size: 38px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.auth-art .art-copy p { margin-top: 16px; opacity: .9; font-size: 15px; }
.auth-art .blob { position: absolute; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.18); bottom: 90px; left: 44px; }
.auth-form-wrap { display: grid; place-items: center; padding: 44px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 30px; font-weight: 800; }
.auth-form .sub { color: var(--muted); font-size: 14px; margin: 6px 0 28px; }
.auth-field { margin-bottom: 18px; }
.auth-field label { font-size: 13px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 8px; }
.auth-input { display: flex; align-items: center; gap: 12px; background: var(--card-3); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; }
.auth-input svg { width: 17px; height: 17px; color: var(--muted); }
.auth-input input { background: none; border: none; outline: none; color: var(--text); font-size: 14.5px; width: 100%; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 13.5px; }
.auth-row label { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.auth-row .forgot { color: var(--accent); font-weight: 600; }
.checkbox { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--border); background: var(--card-3); display:grid; place-items:center; cursor: pointer; }
.checkbox.on { background: var(--accent); border-color: var(--accent); color: #06231b; }
.auth-or { text-align: center; color: var(--muted); font-size: 12.5px; margin: 18px 0; }
.sso-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sso { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--card-3); border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; }
.sso:hover { background: var(--card-2); }
.auth-foot { text-align: center; margin-top: 24px; color: var(--muted); font-size: 13.5px; }
.auth-foot a { color: var(--accent); font-weight: 600; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1100px) {
  .dash-grid, .analysis-grid, .report-grid, .appt-grid, .profile-grid { grid-template-columns: 1fr; }
  .quick-grid, .med-grid, .doctors-grid, .feat-grid { grid-template-columns: repeat(2,1fr); }
  .hero h1 { font-size: 44px; }
}

/* Tablet / large phone */
@media (max-width: 860px) {
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 38px; letter-spacing: -1px; }
  .hero p { font-size: 15px; }
  .hero-stats { gap: 34px; flex-wrap: wrap; }
  .hero-stats .hs b { font-size: 26px; }

  /* collapsible landing nav */
  .lnav { position: relative; gap: 14px; flex-wrap: wrap; }
  .lnav .nav-toggle { display: grid; margin-left: auto; }
  .lnav .links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
  }
  .lnav .links.open { display: flex; }
  .lnav .links a { padding: 11px 14px; border-radius: 10px; }
  .lnav .links a:hover { background: var(--card-2); }
  .lnav .links .signin { background: var(--card-2); text-align: center; }
  .lnav .links .btn { justify-content: center; }
}

/* Phone */
@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { padding: 18px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar .titles h1 { font-size: 20px; }
  .search { display: none; }

  .quick-grid, .med-grid, .doctors-grid, .feat-grid,
  .appt-row, .contacts-grid, .field-grid, .visit-row, .slots { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(2,1fr); }

  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .auth-form-wrap { padding: 32px 22px; }

  .hero h1 { font-size: 30px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .feat-grid { padding: 20px 0 50px; }

  /* tables/rows that overflow */
  .date-row, .spec-filter, .med-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .sch-row { flex-wrap: wrap; }

  /* page header: stack title above full-width action buttons */
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .ph-actions { margin-left: 0; width: 100%; }
  .page-head .ph-actions .btn { flex: 1; }
  .page-head > .btn { margin-left: 0 !important; width: 100%; }

  /* report hero text no longer cramped */
  .report-hero { flex-direction: column; text-align: center; }
  .report-hero h2 { font-size: 19px; }

  /* medicine action buttons stack cleanly */
  .med-actions { flex-wrap: wrap; }
}

/* Small phones (≤380px) */
@media (max-width: 380px) {
  .main { padding: 14px; }
  .topbar .titles h1 { font-size: 18px; }
  .card { padding: 16px; }
  .slots { grid-template-columns: 1fr; }
  .sev-bars { display: none; }
  .ring { width: 120px; height: 120px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 22px; }
  .landing { padding: 0 16px; }
}

/* scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--card-3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===========================================================
   v2 additions — integrations (voice orb, SOS, chat, mobile)
   =========================================================== */

/* ---------- Mobile drawer ---------- */
.menu-btn { display: none; }
.nav-scrim { position: fixed; inset: 0; background: rgba(3,6,12,.6); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.nav-scrim.show { opacity: 1; pointer-events: auto; }
@media (max-width: 760px) {
  .menu-btn { display: grid; order: -1; }
  .sidebar { display: flex; position: fixed; left: 0; top: 0; height: 100dvh; z-index: 100; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar .titles { flex: 1; min-width: 0; }
}

/* ---------- Toasts ---------- */
.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 1000; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--card-2); border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: none; }
.toast-success { border-color: rgba(24,214,166,.45); }
.toast-warn { border-color: rgba(245,200,75,.5); }

/* ---------- Floating SOS shortcut ---------- */
.sos-fab { position: fixed; left: calc(var(--sidebar-w) + 20px); bottom: 22px; width: 56px; height: 56px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px; display: grid; place-items: center; z-index: 80; box-shadow: 0 10px 30px rgba(240,85,109,.45); animation: sos 2s infinite; }
.sos-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (max-width: 760px) { .sos-fab { left: 16px; bottom: 16px; } }

/* ---------- Jarvis voice orb ---------- */
.voice-wrap { padding-top: 6px; }
.jarvis-stage { position: relative; width: min(380px, 84vw); aspect-ratio: 1; margin: 0 auto; }
.jarvis-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.jarvis-btn { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; transform: translate(-50%,-50%); border-radius: 50%; display: grid; place-items: center; color: #fff; background: transparent; transition: transform .2s ease; -webkit-tap-highlight-color: transparent; }
.jarvis-btn:hover { transform: translate(-50%,-50%) scale(1.04); }
.jarvis-btn:active { transform: translate(-50%,-50%) scale(.97); }
.jarvis-btn:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.jarvis-btn svg { width: 30%; height: 30%; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); transition: opacity .2s, transform .2s; grid-area: 1 / 1; }
.jarvis-btn .i-end { opacity: 0; transform: scale(.6) rotate(-30deg); }
.jarvis-btn.in-call .i-mic { opacity: 0; transform: scale(.6); }
.jarvis-btn.in-call:hover .i-end { opacity: 1; transform: none; }
.jarvis-btn.in-call:hover .i-mic { opacity: 0; }
body[data-voice="speaking"] .jarvis-btn.in-call:not(:hover) .i-mic,
body[data-voice="listening"] .jarvis-btn.in-call:not(:hover) .i-mic { opacity: .9; transform: none; }
.call-timer { font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: 2px; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 30px; margin-top: 4px; }
.voice-title { margin-top: 10px; }
body[data-voice="error"] .voice-title { color: var(--red); }
.voice-hint { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 460px; min-height: 22px; }
.voice-controls[hidden], .call-timer[hidden], .voice-transcript[hidden] { display: none !important; }
.vc { transition: transform .15s, background .15s; }
.vc:hover { transform: translateY(-2px); }
.vc.mic .i-off { display: none; }
.vc.mic.muted { background: var(--yellow); color: #231a00; }
.vc.mic.muted .i-on { display: none; } .vc.mic.muted .i-off { display: block; }
button.lang { border: 1px solid transparent; font-family: inherit; }
.lang-row.locked .lang { opacity: .5; cursor: not-allowed; }
.voice-transcript { width: min(560px, 100%); }
.vt-head { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(240,85,109,.6); animation: sos 1.6s infinite; }
.vt-feed { display: flex; flex-direction: column; gap: 12px; max-height: 280px; overflow-y: auto; }
.voice-disclaimer { color: var(--muted-2); font-size: 12.5px; margin-top: 22px; max-width: 460px; }
.voice-disclaimer a { color: var(--accent); }

/* ---------- SOS ---------- */
button.sos-big { font-family: inherit; }
.sos-big:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.sos-profile-warn { margin-top: 14px; color: var(--yellow); font-size: 13.5px; }
.sos-form-note { color: var(--muted); font-size: 12.5px; margin: -8px 0 16px; }
.sos-form .field span { display: block; color: var(--muted); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 6px; }
.sos-form .field select, .sos-form .field textarea { width: 100%; background: var(--card-3); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px; outline: none; font-family: inherit; resize: vertical; }
.sos-form .field input:focus, .sos-form .field select:focus, .sos-form .field textarea:focus { border-color: var(--accent); }
.map-frame { margin-top: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); height: 200px; }
.map-frame iframe { width: 100%; height: 100%; border: 0; filter: invert(.9) hue-rotate(180deg) saturate(.7); }
a.btn.call { display: inline-flex; align-items: center; }

.sos-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(8,4,8,.78); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.sos-overlay[hidden] { display: none; }
.sos-panel { width: min(440px, 100%); background: var(--card); border: 1px solid rgba(240,85,109,.4); border-radius: var(--radius-lg); padding: 30px 26px; text-align: center; box-shadow: 0 30px 80px rgba(240,85,109,.18); }
.sos-panel h3 { font-size: 21px; margin-top: 6px; }
.sos-panel p { color: var(--text-2); font-size: 14px; margin-top: 8px; overflow-wrap: anywhere; }
.sos-count { position: relative; width: 130px; height: 130px; margin: 0 auto 10px; }
.sos-count[hidden] { display: none; }
.sos-count svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sos-count circle { fill: none; stroke-width: 8; }
.sos-count .track { stroke: rgba(240,85,109,.18); }
.sos-count .prog { stroke: var(--red); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.sos-count b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; font-weight: 800; color: var(--red); }
.sos-steps { text-align: left; margin: 20px auto 0; display: grid; gap: 10px; max-width: 300px; }
.sos-steps[hidden] { display: none; }
.sos-steps .step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.sos-steps .step i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.sos-steps .step.active { color: var(--text); } .sos-steps .step.active i { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.sos-steps .step.done { color: var(--text); } .sos-steps .step.done i { background: var(--accent); border-color: var(--accent); }
.sos-steps .step.warn i { background: var(--yellow); border-color: var(--yellow); }
.sos-steps .step.fail i { background: var(--red); border-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.sos-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.sos-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

/* ---------- Symptom chat → live GHL chat ---------- */
.live-chat-banner { display: flex; align-items: center; gap: 14px; background: linear-gradient(120deg, rgba(24,214,166,.14), rgba(139,92,246,.1)); border: 1px solid rgba(24,214,166,.3); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.live-chat-banner .lcb-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-brand); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.live-chat-banner p { color: var(--muted); font-size: 13px; }
.live-chat-banner .btn { margin-left: auto; white-space: nowrap; }
.example-label { align-self: center; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted-2); background: var(--card); border: 1px solid var(--border); padding: 4px 12px; border-radius: 30px; }
@media (max-width: 760px) {
  .live-chat-banner { flex-wrap: wrap; } .live-chat-banner .btn { width: 100%; margin-left: 0; justify-content: center; }
  .emergency-hero { padding: 28px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sos-fab, .sos-big, .live-dot { animation: none; }
}
.sos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.sos-grid .contacts-grid { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .sos-grid { grid-template-columns: 1fr; } .sos-grid .contacts-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .sos-grid .contacts-grid { grid-template-columns: 1fr; } }
.sos-form .field-grid { margin-bottom: 16px; } .sos-form .field-grid .field { margin-bottom: 0; }
@media (max-width: 760px) {
  .topbar .titles { order: 10; flex-basis: 100%; }
  .topbar .spacer { display: block; }
  .main { padding-bottom: 96px; }
}
.sos-fab.raised { bottom: 100px; }

/* GHL chat rendered inline inside the Figma chat card */
.ghl-inline { flex: 1; min-height: 480px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ghl-inline[hidden] { display: none; }
.ghl-inline iframe { width: 100% !important; height: 100% !important; border: 0; }
body.has-inline-chat .chat-feed,
body.has-inline-chat .chat-input,
body.has-inline-chat .live-chat-banner .btn { display: none; }

/* ---------- Booking (GHL calendar) ---------- */
button.dur, button.date-cell, button.slot { font-family: inherit; color: inherit; }
.date-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.date-cell { flex: 0 0 auto; }
.date-cell.empty:not(.on) { opacity: .45; }
.slots-msg { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; padding: 12px 0; }
.link-btn { color: var(--accent); font-weight: 600; text-decoration: underline; font-size: 13.5px; }
.tz-note { text-transform: none; letter-spacing: 0; color: var(--muted-2); font-weight: 500; }
.book-fields { margin: 12px 0 18px; }
.book-fields .field { margin-bottom: 0; }
.book-summary { color: var(--muted); font-size: 13px; margin: 16px 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.doc-item .sel-btn { padding: 6px 14px; font-size: 13px; }
.ghl-booking { margin-top: 16px; border-radius: 12px; overflow: hidden; background: #fff; }
.ghl-booking[hidden], .book-done[hidden], #bookForm[hidden] { display: none; }
.ghl-booking iframe { width: 100%; min-height: 720px; border: 0; display: block; }
.book-done { text-align: center; padding: 34px 10px 10px; }
.book-done .done-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 30px; font-weight: 800; margin: 0 auto 14px; }
.book-done h3 { font-size: 20px; }
.book-done p { color: var(--text-2); font-size: 14px; margin: 8px auto 20px; max-width: 420px; }
.appt-grid > * { min-width: 0; }
.dash-doc { margin-bottom: 10px; } .dash-doc:last-child { margin-bottom: 0; } .dash-doc .sel-btn { margin-left: auto; }

/* ---------- Centered chat (GHL widget in a MediMind window) ---------- */
.mm-chat-launcher { position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; z-index: 85; box-shadow: 0 12px 32px rgba(24,201,160,.4); transition: transform .15s; }
.mm-chat-launcher:hover { transform: translateY(-2px) scale(1.04); }
.mm-chat-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mm-chat-launcher svg { width: 26px; height: 26px; }
body.mm-chat-open .mm-chat-launcher { opacity: 0; pointer-events: none; }
.mm-chat-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(3,6,12,.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.mm-chat-overlay[hidden] { display: none; }
.mm-chat-panel { width: min(460px, 100%); height: min(700px, calc(100dvh - 32px)); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: mmPop .18s ease-out; }
@keyframes mmPop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.mm-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(120deg, rgba(24,214,166,.12), rgba(139,92,246,.08)); }
.mm-chat-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.mm-chat-head b { display: block; font-size: 15px; }
.mm-chat-head span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.mm-chat-head span i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.mm-chat-close { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); }
.mm-chat-close:hover { background: var(--card-2); }
.mm-chat-close svg { width: 18px; height: 18px; }
.mm-chat-body { flex: 1; min-height: 0; overflow: auto; position: relative; background: var(--bg); }
.mm-chat-body iframe, .ghl-inline iframe { width: 100% !important; height: 100% !important; border: 0; }
.mm-chat-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13.5px; z-index: 0; }
.mm-chat-body > :not(.mm-chat-loading) { position: relative; z-index: 1; }
.mm-chat-foot { padding: 8px 14px; font-size: 11.5px; color: var(--muted-2); text-align: center; border-top: 1px solid var(--border); }
/* Symptom Chat page: chat centred in the page */
body.has-inline-chat .ghl-inline { width: min(820px, 100%); margin: 0 auto; min-height: 560px; }
@media (max-width: 760px) {
  .mm-chat-launcher { right: 16px; bottom: 16px; }
  .mm-chat-overlay { padding: 0; }
  .mm-chat-panel { width: 100%; height: 100dvh; border-radius: 0; }
}

/* ---------- Auth ---------- */
html.auth-pending body { visibility: hidden; }
.logout-btn { color: var(--muted); }
.logout-btn[hidden] { display: none; }
.auth-msg { border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; border: 1px solid var(--border); background: var(--card-2); color: var(--text-2); }
.auth-msg[hidden] { display: none; }
.auth-msg.error { border-color: rgba(240,85,109,.45); background: var(--red-soft); color: #ffb3c0; }
.auth-msg.success { border-color: rgba(24,214,166,.45); background: var(--accent-soft); color: #9ff0da; }
.auth-form button.btn-block { width: 100%; }
.auth-form .btn[disabled] { opacity: .6; cursor: wait; }
.auth-input:focus-within { border-color: var(--accent); }
.auth-input .toggle-pw { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.auth-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.auth-row .checkbox { cursor: pointer; }
.sidebar-footer .logout-btn { margin-left: 8px; }
.sidebar-footer .gear { flex-shrink: 0; display: grid; place-items: center; } .sidebar-footer .gear svg { width: 18px; height: 18px; }
.sso-row.single { grid-template-columns: 1fr; } .sso svg { flex-shrink: 0; }
.appt-empty { grid-column: 1 / -1; color: var(--muted); font-size: 14px; background: var(--card); border: 1px dashed var(--border); border-radius: 14px; padding: 22px; text-align: center; }
.appt-empty a { color: var(--accent); font-weight: 600; }
.tag-pending { margin-left: auto; align-self: flex-start; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 30px; background: rgba(245,200,75,.12); color: var(--yellow); }
.appt .av { flex-shrink: 0; }

/* ---------- Appointment actions (reschedule / cancel) ---------- */
.appt.has-actions { flex-direction: column; align-items: stretch; }
.appt-top { display: flex; gap: 14px; align-items: flex-start; }
.appt-top .tag-confirmed, .appt-top .tag-pending { margin-left: auto; }
.appt-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.appt-btn { flex: 1; padding: 8px 12px; font-size: 13px; }
.appt-btn.danger { color: var(--red); }
.appt-btn.danger:hover { background: var(--red-soft); }
.mm-modal-overlay { position: fixed; inset: 0; z-index: 450; background: rgba(3,6,12,.72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.mm-modal-overlay[hidden] { display: none; }
.mm-modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: mmPop .18s ease-out; }
.mm-modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.mm-modal-head b { font-size: 16px; }
.mm-modal-x { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; color: var(--muted); }
.mm-modal-x:hover { background: var(--card-2); }
.mm-modal-body { padding: 18px 20px; }
.mm-modal-body .date-row { margin: 10px 0 16px; }
.mm-modal-body .slots { margin: 10px 0 0; }
.mm-modal-text { color: var(--text-2); font-size: 14px; }
.mm-lbl { margin-top: 14px; letter-spacing: .8px; text-transform: uppercase; font-size: 11px; }
.mm-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
@media (max-width: 760px) { .mm-modal-body .slots { grid-template-columns: repeat(3, 1fr); } }
.ghl-inline { position: relative; } .ghl-inline > :not(.mm-chat-loading) { position: relative; z-index: 1; }

/* ---------- Inline chat (fits the screen at any zoom) ---------- */
.chat-size-bar { display: flex; justify-content: flex-end; margin: 0 auto 10px; width: min(1100px, 100%); }
.chat-size-bar[hidden] { display: none; }
.chat-size-bar .dur { padding: 7px 14px; font-family: inherit; font-size: 13px; }
body.has-inline-chat .chat-wrap { height: auto; }
body.has-inline-chat .ghl-inline {
  width: 100%; height: auto; min-height: 420px; max-height: none;
  margin: 0 auto; resize: none; overflow: visible;
  background: transparent; border: 0;
  display: flex; justify-content: center; align-items: flex-start;
}
body.has-inline-chat .ghl-inline.ghl-ready { min-height: 0; }
body.has-inline-chat .ghl-inline > :not(script):not(.mm-chat-loading) {
  flex: 0 0 auto; max-width: 100% !important; max-height: none !important;
}
body.has-inline-chat .ghl-inline .mm-chat-loading { position: static; padding: 60px 0; }
body.has-inline-chat .ghl-inline.ghl-ready .mm-chat-loading { display: none; }
/* full screen */
body.chat-fullscreen .ghl-inline {
  position: fixed; inset: 0; z-index: 300; padding: 12px;
  background: rgba(3,6,12,.85); backdrop-filter: blur(4px); align-items: center;
}
body.chat-fullscreen .chat-size-bar { position: fixed; top: 16px; right: 20px; z-index: 301; width: auto; }
body.chat-fullscreen .sos-fab, body.chat-fullscreen .mm-chat-launcher { display: none; }

/* ---------- Symptom Analysis (interactive) ---------- */
button.sym-chip { font-family: inherit; border: 0; cursor: pointer; }
.sym-chip.add-sym { background: var(--card-3); color: var(--text-2); }
.sym-chip .x { background: none; border: 0; color: inherit; font: inherit; padding: 0; }
.sym-picker { background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin: -10px 0 20px; }
.sym-picker[hidden] { display: none; }
.sym-search { width: 100%; background: var(--card-3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; color: var(--text); font-size: 14px; outline: none; margin-bottom: 12px; font-family: inherit; }
.sym-search:focus { border-color: var(--accent); }
.sym-groups { max-height: 280px; overflow-y: auto; display: grid; gap: 12px; }
.sym-group-title { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.sym-options, .quick-syms { display: flex; flex-wrap: wrap; gap: 7px; }
.quick-syms { margin-bottom: 24px; }
.sym-opt, .quick-sym { padding: 7px 12px; border-radius: 30px; background: var(--card-3); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; font-family: inherit; cursor: pointer; }
.sym-opt:hover, .quick-sym:hover { border-color: var(--accent); }
.sym-opt.on, .quick-sym.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.field-label .opt { color: var(--muted-2); font-weight: 500; }
.sev-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; margin: 16px 0 10px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--sev, var(--yellow)) var(--pct, 50%), var(--card-3) var(--pct, 50%)); }
.sev-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--sev, var(--yellow)); box-shadow: 0 0 0 5px rgba(255,255,255,.08); border: 0; }
.sev-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--sev, var(--yellow)); border: 0; }
.sev-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(24,214,166,.35); }
button.dur { font-family: inherit; }
.analysis-disclaimer { margin-top: 12px; font-size: 12px; color: var(--muted-2); text-align: center; }
.analysis-disclaimer a { color: var(--accent); }
#bodyMap .bm { fill: #1d2736; transition: fill .2s, stroke .2s; }
#bodyMap .bm.on { fill: rgba(245,200,75,.25); stroke: var(--yellow); stroke-width: 2.5; }
#bodyMap .bm-outline rect { stroke: transparent; stroke-width: 2; stroke-dasharray: 5 5; transition: stroke .2s; }
#bodyMap .bm-outline.on rect { stroke: rgba(245,200,75,.6); }
.preview.danger { background: linear-gradient(160deg, rgba(240,85,109,.18), rgba(240,85,109,.04)); border-color: rgba(240,85,109,.4); }
.preview.danger .pill { background: var(--red-soft); color: var(--red); }

/* ---------- Reports (live) ---------- */
.rp-empty { text-align: center; padding: 48px 24px; }
.rp-empty[hidden], #rpBody[hidden], .rp-emergency[hidden] { display: none; }
.rp-empty-ico { font-size: 40px; margin-bottom: 10px; }
.rp-empty h3 { font-size: 20px; } .rp-empty p { color: var(--muted); margin: 8px 0 20px; }
.rp-emergency { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(150deg, rgba(240,85,109,.22), rgba(240,85,109,.06)); border: 1px solid rgba(240,85,109,.45); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.rp-em-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.rp-em-text { flex: 1; min-width: 220px; } .rp-em-text b { font-size: 16px; }
.rp-em-text ul { margin: 6px 0 0 18px; color: #ffc2cc; font-size: 13.5px; }
.rp-em-actions { display: flex; gap: 10px; }
.report-hero.danger { background: linear-gradient(120deg, #c93550, #f0556d); }
.rp-urgency { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 30px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.2); color: #fff; }
.rp-urgency.warn { background: rgba(245,200,75,.9); color: #3a2c00; }
.rp-urgency.high { background: #fff; color: #c93550; }
.rp-urgency.danger { background: #fff; color: var(--red); }
.cond-why { font-size: 12px; color: var(--muted); margin-top: 6px; }
.rp-note { font-size: 12px; color: var(--muted-2); margin-top: 14px; }
.rp-notes { color: var(--text-2); font-size: 13.5px; font-style: italic; }
.rp-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; }
.rp-item:hover { background: var(--card-2); }
.rp-item.on { background: var(--accent-soft); }
.rp-item b { display: block; font-size: 13.5px; } .rp-item span { font-size: 12px; color: var(--muted); }
.rp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.rp-dot.warn { background: var(--yellow); } .rp-dot.high { background: #ff8a3d; } .rp-dot.danger { background: var(--red); }
.rp-delete { margin-top: 12px; color: var(--red); }
/* Download → print / Save as PDF */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .sidebar, .topbar, .ph-actions, .sos-fab, .mm-chat-launcher, .rp-history, .specialist .btn, .toast-host, .rp-em-actions { display: none !important; }
  .main { padding: 0 !important; }
  .card, .report-hero { break-inside: avoid; box-shadow: none !important; border-color: #ddd !important; }
  .card { background: #fff !important; color: #111 !important; }
  .page-head h2::before { content: 'MediMind — '; }
  .report-grid { grid-template-columns: 1fr 1fr !important; }
}
.doc-hours { font-size: 12px; color: var(--text-2); margin: -6px 0 14px; } .doc-item .doc-hours { margin: 4px 0 0; }

/* ============================================================
   Staff portals (Doctor Portal / Admin Panel) + Prescriptions
   ============================================================ */
.nav-staff .nav-label { color: var(--accent); }
.role-tag { display: inline-block; margin-top: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--accent); }
.sidebar-footer .who { display: flex; flex-direction: column; min-width: 0; }

/* inputs used across staff pages */
.inp { width: 100%; background: var(--card-3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; color: var(--text); font-size: 14px; outline: none; font-family: inherit; }
.inp:focus { border-color: var(--accent); }
textarea.inp { resize: vertical; min-height: 74px; line-height: 1.5; }
select.inp { cursor: pointer; }
.inp-sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; width: auto; }
input[type="date"].inp { color-scheme: dark; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f-field { margin-bottom: 14px; }
.f-field > label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.f-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.f-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.f-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* toolbar + tabs */
.st-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.st-toolbar .grow { flex: 1; }
.st-who { display: flex; align-items: center; gap: 12px; }
.st-who .da { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; }
.st-who b { display: block; font-size: 16px; }
.st-who span { color: var(--muted); font-size: 13px; }
.st-daynav { display: inline-flex; align-items: center; gap: 6px; }
.st-daynav .btn { padding: 8px 12px; font-size: 13px; }
.st-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.st-tab { padding: 11px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.st-tab:hover { color: var(--text); }
.st-tab.on { color: var(--accent); border-bottom-color: var(--accent); }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi b { display: block; font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; }
.kpi small { color: var(--muted-2); font-size: 12px; }
.kpi.accent b { color: var(--accent); } .kpi.red b { color: var(--red); } .kpi.yellow b { color: var(--yellow); } .kpi.blue b { color: var(--blue); }

/* status pills */
.st-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 30px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-confirmed, .st-new { background: rgba(79,142,247,.13); color: var(--blue); }
.st-showed { background: var(--accent-soft); color: var(--accent); }
.st-noshow { background: rgba(245,200,75,.13); color: var(--yellow); }
.st-cancelled, .st-invalid { background: var(--red-soft); color: var(--red); }

/* appointment rows (doctor portal) */
.st-list { display: flex; flex-direction: column; gap: 10px; }
.st-day { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin: 14px 0 2px; }
.st-day:first-child { margin-top: 0; }
.st-row { display: grid; grid-template-columns: 86px 1fr auto auto; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.st-row.is-cancelled { opacity: .55; }
.st-row.is-next { border-color: rgba(24,214,166,.5); box-shadow: 0 0 0 1px rgba(24,214,166,.18) inset; }
.st-time b { display: block; font-size: 15px; }
.st-time span { color: var(--muted); font-size: 12px; }
.st-pat { min-width: 0; }
.st-pat b { display: block; font-size: 14.5px; }
.st-pat .sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-pat .why { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.st-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-actions .btn { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn.is-on.warn { background: rgba(245,200,75,.13); color: var(--yellow); border-color: var(--yellow); }
.st-empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--card); border: 1px dashed var(--border); border-radius: 14px; font-size: 14px; }
.st-warn { background: rgba(245,200,75,.08); border: 1px solid rgba(245,200,75,.35); color: var(--yellow); border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.st-rx-done { color: var(--accent); font-size: 12px; font-weight: 700; }

/* tables (admin) */
.st-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.st-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.st-table th { text-align: left; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--card-2); }
.st-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.st-table tr:last-child td { border-bottom: none; }
.st-table td .sub { color: var(--muted); font-size: 12px; }
.st-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-2); }
.st-table .da { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 12px; }
.st-cell-doc { display: flex; align-items: center; gap: 10px; }

/* per-doctor bars */
.st-bars { display: flex; flex-direction: column; gap: 14px; }
.st-bar-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; font-size: 13px; }
.st-bar-row .track { grid-column: 1 / -1; height: 9px; background: var(--card-3); border-radius: 10px; overflow: hidden; }
.st-bar-row .fill { height: 100%; background: var(--grad-brand); border-radius: 10px; }
.st-bar-row .n { text-align: right; color: var(--text-2); font-weight: 600; }
.st-two { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }

/* wide modal + medicine rows */
.mm-modal.wide { width: min(860px, 100%); }
.med-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.med-row { display: grid; grid-template-columns: 1.6fr .9fr 1.2fr .9fr 1.3fr 34px; gap: 8px; }
.med-row .x { width: 34px; height: 38px; border-radius: 9px; color: var(--muted); background: var(--card-3); border: 1px solid var(--border); }
.med-row .x:hover { color: var(--red); }
.med-head { display: grid; grid-template-columns: 1.6fr .9fr 1.2fr .9fr 1.3fr 34px; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.consult-pt { display: flex; gap: 14px; align-items: center; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.consult-pt b { display: block; }
.consult-pt span { color: var(--muted); font-size: 12.5px; }

/* patient prescription cards */
.rx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.rx-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.rx-card .rx-top { display: flex; align-items: center; gap: 12px; }
.rx-card .rx-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.rx-card .rx-top b { display: block; }
.rx-card .rx-top span { color: var(--muted); font-size: 12.5px; }
.rx-card .rx-no { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.rx-card .rx-dx { color: var(--text-2); font-size: 13.5px; }
.rx-card .rx-meds { color: var(--muted); font-size: 12.5px; }
.rx-card .rx-btns { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.rx-card .rx-btns .btn { flex: 1; padding: 9px 12px; font-size: 13px; }
.rx-compact { display: flex; flex-direction: column; gap: 10px; }
.rx-compact .rx-card { flex-direction: row; align-items: center; padding: 14px 16px; }
.rx-compact .rx-card .rx-dx, .rx-compact .rx-card .rx-meds { display: none; }
.rx-compact .rx-card .rx-btns { margin: 0 0 0 auto; padding: 0; }
.rx-compact .rx-card .rx-no { display: none; }

/* the prescription "paper" */
.rx-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.rx-sheet { background: #fff; color: #1a2230; border-radius: 14px; max-width: 820px; padding: 34px 38px; box-shadow: var(--shadow); font-size: 14px; }
.rx-sheet .rx-h { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 3px solid #18c9a3; }
.rx-sheet .rx-brand b { font-size: 22px; color: #0c3b33; letter-spacing: -.3px; }
.rx-sheet .rx-brand span { display: block; color: #5d6878; font-size: 12.5px; }
.rx-sheet .rx-meta { text-align: right; font-size: 12.5px; color: #5d6878; }
.rx-sheet .rx-meta b { display: block; color: #0c3b33; font-size: 13px; letter-spacing: 1px; }
.rx-sheet .rx-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid #e3e8ef; }
.rx-sheet .rx-parties .lbl, .rx-sheet .rx-sec .lbl { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #8a95a5; margin-bottom: 4px; }
.rx-sheet .rx-parties b { display: block; font-size: 15px; }
.rx-sheet .rx-parties span { display: block; color: #5d6878; font-size: 13px; }
.rx-sheet .rx-sec { padding: 14px 0; border-bottom: 1px solid #eef1f5; }
.rx-sheet .rx-sec p { white-space: pre-wrap; }
.rx-sheet .rx-symbol { font-size: 30px; font-weight: 800; color: #18c9a3; font-family: Georgia, serif; margin: 14px 0 6px; }
.rx-sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rx-sheet th { text-align: left; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: #5d6878; background: #f3f6f9; padding: 9px 10px; }
.rx-sheet td { padding: 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.rx-sheet td b { color: #0c3b33; }
.rx-sheet .rx-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 26px; }
.rx-sheet .rx-sign .line { border-top: 1px solid #1a2230; padding-top: 6px; min-width: 220px; text-align: center; font-size: 13px; }
.rx-sheet .rx-foot { margin-top: 20px; font-size: 11.5px; color: #8a95a5; }

@media (max-width: 1000px) { .st-two { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .st-row { grid-template-columns: 70px 1fr; }
  .st-row .st-pill { grid-column: 2; justify-self: start; }
  .st-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .f-row { grid-template-columns: 1fr; }
  .med-head { display: none; }
  .med-row { grid-template-columns: 1fr 1fr; padding: 10px; background: var(--card-2); border-radius: 10px; }
  .med-row .inp:first-child { grid-column: 1 / -1; }
  .rx-sheet { padding: 22px 18px; }
  .rx-sheet .rx-parties { grid-template-columns: 1fr; }
  .rx-sheet .rx-h { flex-direction: column; }
  .rx-sheet .rx-meta { text-align: left; }
}
@media print {
  body.rx-print { background: #fff !important; }
  body.rx-print .rx-actions { display: none !important; }
  body.rx-print .rx-sheet { box-shadow: none; padding: 0; max-width: none; }
}
.rx-table-wrap { overflow-x: auto; }
.rx-table-wrap table { min-width: 560px; }

/* ---------- Payments ---------- */
.pay-done { flex: 1; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.done-pay { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 14px; }
.done-pay span { color: var(--muted); font-size: 12.5px; }
.st-pay { font-size: 11.5px; font-weight: 700; }
.st-pay.paid { color: var(--accent); } .st-pay.unpaid { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* SOS contact groups */
.contact[hidden] { display: none !important; }
.contact-group { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); margin: 10px 2px 0; }
.contact-group:first-child { margin-top: 0; }
.contact-group:has(+ .contact[hidden]:last-child) { display: none; }
