/* ==========================================================================
   VEHA OPD — Design System
   Connected Care for Women & Children
   ========================================================================== */

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

:root {
  /* Surfaces */
  --bg: #F3F7F9;
  --bg-deep: #E9F0F4;
  --surface: #FFFFFF;
  --surface-2: #FAFCFD;
  --surface-3: #F5F9FB;

  /* Lines */
  --line: #E3EAEF;
  --line-2: #EDF2F5;
  --line-strong: #D3DEE5;

  /* Ink */
  --ink: #0E1B26;
  --ink-2: #3D5567;
  --ink-3: #78909F;
  --ink-4: #A3B5C1;

  /* Brand — deep clinical teal */
  --teal: #0E7C86;
  --teal-d: #0A5A62;
  --teal-dd: #06373C;
  --teal-m: #48A5AD;
  --teal-l: #E4F2F3;
  --teal-ll: #F1F9F9;

  /* Blue — system / information */
  --blue: #2563EB;
  --blue-d: #1D4ED8;
  --blue-l: #E9F0FE;

  /* Rose — maternity / women */
  --rose: #CE4F84;
  --rose-d: #A83B69;
  --rose-l: #FDECF3;

  /* Amber — pediatrics / children */
  --amber: #D9822B;
  --amber-d: #B36A1E;
  --amber-l: #FDF2E3;

  /* Semantic */
  --green: #12855A;
  --green-l: #E4F5EC;
  --red: #CC4141;
  --red-l: #FDEBEB;
  --violet: #6A48C4;
  --violet-l: #F0EBFC;
  --slate: #64798A;
  --slate-l: #EDF1F4;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 8px;
  --r: 12px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Shadow */
  --sh-xs: 0 1px 2px rgba(14, 27, 38, .05);
  --sh-sm: 0 1px 3px rgba(14, 27, 38, .06), 0 1px 2px rgba(14, 27, 38, .04);
  --sh: 0 4px 14px rgba(14, 27, 38, .06), 0 1px 3px rgba(14, 27, 38, .04);
  --sh-md: 0 10px 28px rgba(14, 27, 38, .08), 0 2px 6px rgba(14, 27, 38, .04);
  --sh-lg: 0 22px 50px rgba(14, 27, 38, .12), 0 4px 12px rgba(14, 27, 38, .05);

  --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-w: 252px;
  --topbar-h: 66px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--teal-l); color: var(--teal-dd); }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #CBD8E0; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #A9BCC8; background-clip: content-box; }

/* ================= Icon ================= */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 28px; height: 28px; stroke-width: 1.6; }

/* ================= Brand mark ================= */
.brandmark {
  display: flex; align-items: center; gap: 11px;
}
.brandmark .glyph {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-d) 60%, #0b4a52 100%);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 12px rgba(10, 90, 98, .28), inset 0 1px 0 rgba(255,255,255,.22);
  position: relative; overflow: hidden;
}
.brandmark .glyph svg { width: 21px; height: 21px; }
.brandmark .glyph::after {
  content: ''; position: absolute; right: -8px; bottom: -10px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(206, 79, 132, .55);
}
.brandmark .wm { line-height: 1.15; }
.brandmark .wm b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.brandmark .wm span { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.brandmark.on-dark .wm b { color: #fff; }
.brandmark.on-dark .wm span { color: rgba(255,255,255,.6); }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .16s ease; white-space: nowrap;
  box-shadow: var(--sh-xs);
}
.btn:hover { background: var(--surface-3); border-color: #BFCFD9; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 2px 8px rgba(14,124,134,.25); }
.btn-primary:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn-rose { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-rose:hover { background: var(--rose-d); border-color: var(--rose-d); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(.92); }
.btn-danger { background: #fff; border-color: #F0C3C3; color: var(--red); }
.btn-danger:hover { background: var(--red-l); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; gap: 4px; font-weight: 700; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ================= Inputs ================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .03em; text-transform: uppercase; }
.inp, .sel, .ta {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 0 12px; height: 40px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.ta { height: auto; padding: 10px 12px; resize: vertical; min-height: 74px; line-height: 1.55; }
.inp:focus, .sel:focus, .ta:focus { border-color: var(--teal-m); box-shadow: 0 0 0 3px rgba(72,165,173,.16); }
.inp::placeholder, .ta::placeholder { color: var(--ink-4); }
.sel { appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378909F' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.inp-search { position: relative; }
.inp-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-4); }
.inp-search input { padding-left: 36px; }

/* ================= Chips / badges ================= */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: var(--slate-l); color: var(--slate); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip-teal { background: var(--teal-l); color: var(--teal-d); }
.chip-blue { background: var(--blue-l); color: var(--blue-d); }
.chip-rose { background: var(--rose-l); color: var(--rose-d); }
.chip-amber { background: var(--amber-l); color: var(--amber-d); }
.chip-green { background: var(--green-l); color: var(--green); }
.chip-red { background: var(--red-l); color: var(--red); }
.chip-violet { background: var(--violet-l); color: var(--violet); }
.chip-solid-teal { background: var(--teal); color: #fff; }
.chip-solid-green { background: var(--green); color: #fff; }
.chip-solid-amber { background: var(--amber); color: #fff; }
.chip-solid-violet { background: var(--violet); color: #fff; }
.chip-lg { height: 27px; padding: 0 11px; font-size: 12px; }
.chip-out { background: #fff; border: 1px solid var(--line-strong); color: var(--ink-2); }

/* ================= Card ================= */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.card-pad { padding: 18px; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.card-hd h3 { font-size: 14.5px; letter-spacing: -.015em; }
.card-hd .sub { font-size: 11.5px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.card-bd { padding: 18px; }
.card-ft { padding: 13px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-hover { transition: box-shadow .18s, transform .18s, border-color .18s; cursor: pointer; }
.card-hover:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: #D6E3EA; }

/* ================= Layout primitives ================= */
.row { display: flex; align-items: center; gap: 10px; }
.row-b { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap20 { gap: 20px; } .gap24 { gap: 24px; }
.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}.mt24{margin-top:24px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}.mb20{margin-bottom:20px}.mb24{margin-bottom:24px}

/* Typography helpers */
.t-xs { font-size: 11px; } .t-sm { font-size: 12px; } .t-md { font-size: 13px; } .t-lg { font-size: 15px; }
.muted { color: var(--ink-3); }
.muted2 { color: var(--ink-4); }
.strong { font-weight: 700; }
.semi { font-weight: 600; }
.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); }
.num { font-variant-numeric: tabular-nums; }

.sect-title { font-size: 19px; letter-spacing: -.025em; }
.sect-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

/* ================= Avatar ================= */
.av {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 13.5px;
  background: var(--teal-l); color: var(--teal-d); letter-spacing: -.02em;
}
.av-rose { background: var(--rose-l); color: var(--rose-d); }
.av-amber { background: var(--amber-l); color: var(--amber-d); }
.av-blue { background: var(--blue-l); color: var(--blue-d); }
.av-violet { background: var(--violet-l); color: var(--violet); }
.av-slate { background: var(--slate-l); color: var(--slate); }
.av-xs { width: 28px; height: 28px; border-radius: 9px; font-size: 10.5px; }
.av-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.av-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; }
.av-xl { width: 66px; height: 66px; border-radius: 19px; font-size: 21px; }
.av-round { border-radius: 50%; }

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

.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #08343A 0%, #072A2F 100%);
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar-hd { padding: 18px 18px 14px; }
.sb-context {
  margin: 0 14px 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
}
.sb-context .lbl { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; color: rgba(255,255,255,.45); text-transform: uppercase; }
.sb-context .val { font-size: 12.5px; font-weight: 700; color: #fff; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 10px 18px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); background-clip: content-box; }
.nav-grp { font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.34); padding: 14px 12px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: rgba(255,255,255,.72); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s; margin-bottom: 2px; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.on { background: rgba(255,255,255,.13); color: #fff; }
.nav-item.on::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--teal-m);
}
.nav-item .cnt {
  margin-left: auto; font-size: 10.5px; font-weight: 800; min-width: 20px; height: 19px;
  padding: 0 6px; border-radius: 20px; background: rgba(255,255,255,.15); color: #fff;
  display: grid; place-items: center;
}
.nav-item .cnt.hot { background: var(--rose); }
.sidebar-ft { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.sb-user .nm { font-size: 12.5px; font-weight: 700; color: #fff; }
.sb-user .rl { font-size: 10.5px; color: rgba(255,255,255,.5); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none; position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 14px; padding: 0 22px;
}
.tb-title { font-size: 16.5px; font-weight: 800; letter-spacing: -.025em; }
.tb-crumb { font-size: 11px; color: var(--ink-4); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.roleswitch {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 11px;
}
.roleswitch button {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border: none; background: transparent; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--ink-3); transition: all .15s;
}
.roleswitch button:hover { color: var(--ink); }
.roleswitch button.on { background: #fff; color: var(--teal-d); box-shadow: var(--sh-sm); }
.roleswitch a { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.roleswitch a:hover { color: var(--rose); background: #fff; }

.view { padding: 22px; flex: 1; }
.view-wide { max-width: 1560px; }

.page-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* ================= Stat tiles ================= */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 16px; box-shadow: var(--sh-xs); position: relative; overflow: hidden; }
.stat .lbl { font-size: 11.5px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 27px; font-weight: 800; letter-spacing: -.035em; margin-top: 7px; line-height: 1; }
.stat .sub { font-size: 11.5px; color: var(--ink-4); font-weight: 600; margin-top: 6px; }
.stat .ico { position: absolute; right: 13px; top: 13px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.stat.t-teal .ico { background: var(--teal-l); color: var(--teal); }
.stat.t-green .ico { background: var(--green-l); color: var(--green); }
.stat.t-rose .ico { background: var(--rose-l); color: var(--rose); }
.stat.t-amber .ico { background: var(--amber-l); color: var(--amber); }
.stat.t-blue .ico { background: var(--blue-l); color: var(--blue); }
.stat.t-red .ico { background: var(--red-l); color: var(--red); }
.stat.t-violet .ico { background: var(--violet-l); color: var(--violet); }
.stat.t-slate .ico { background: var(--slate-l); color: var(--slate); }
.trend { font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 3px; }
.trend.up { color: var(--green); } .trend.dn { color: var(--red); }

/* ================= Table ================= */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl thead th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-4); padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable { cursor: pointer; transition: background .12s; }
.tbl tbody tr.clickable:hover { background: var(--teal-ll); }
.tbl .ta-r { text-align: right; }
.tbl-wrap { overflow: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ================= Status system ================= */
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 800; letter-spacing: .015em; white-space: nowrap; }
.st .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-available   { background: #F1F5F8; color: #6B8496; }
.st-booked      { background: var(--blue-l); color: var(--blue-d); }
.st-checked-in  { background: var(--amber-l); color: var(--amber-d); }
.st-in-consultation { background: var(--violet-l); color: var(--violet); }
.st-completed   { background: var(--green-l); color: var(--green); }
.st-cancelled   { background: var(--red-l); color: var(--red); }
.st-no-show     { background: #E7EBEE; color: #5B6E7C; }
.st-pulse .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.4); } }

/* ================= Slot grid ================= */
.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
.slot {
  border: 1px solid var(--line); background: #fff; border-radius: var(--r); padding: 9px 11px;
  cursor: pointer; transition: all .15s; position: relative; overflow: hidden; text-align: left;
  font-family: inherit; display: block; width: 100%;
}
.slot::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.slot .tm { font-size: 13px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.slot .nm { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .mt { font-size: 10.5px; color: var(--ink-4); font-weight: 600; margin-top: 1px; }
.slot:hover { box-shadow: var(--sh); transform: translateY(-1px); }
.slot.s-available { border-style: dashed; background: var(--surface-2); }
.slot.s-available .tm { color: var(--ink-2); }
.slot.s-available:hover { border-color: var(--teal-m); border-style: solid; background: var(--teal-ll); }
.slot.s-available::before { background: transparent; }
.slot.s-booked::before { background: var(--blue); }
.slot.s-booked { background: var(--blue-l); border-color: #CFDEFB; }
.slot.s-checked-in::before { background: var(--amber); }
.slot.s-checked-in { background: var(--amber-l); border-color: #F3DFC0; }
.slot.s-in-consultation::before { background: var(--violet); }
.slot.s-in-consultation { background: var(--violet-l); border-color: #DCD2F6; }
.slot.s-completed::before { background: var(--green); }
.slot.s-completed { background: var(--green-l); border-color: #C9E8D8; }
.slot.s-cancelled::before { background: var(--red); }
.slot.s-cancelled { background: var(--red-l); border-color: #F3D2D2; }
.slot.s-cancelled .tm, .slot.s-cancelled .nm { text-decoration: line-through; opacity: .75; }
.slot.s-no-show::before { background: #8397A4; }
.slot.s-no-show { background: #EEF1F3; border-color: #DCE3E8; }
.slot.s-break { background: repeating-linear-gradient(45deg, #F5F8FA, #F5F8FA 6px, #EDF2F5 6px, #EDF2F5 12px); cursor: default; }
.slot .badge-t { position: absolute; right: 8px; top: 8px; font-size: 9.5px; font-weight: 800; color: var(--ink-4); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.legend i { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); font-style: normal; }
.legend i b { width: 9px; height: 9px; border-radius: 3px; display: block; }

/* ================= Timeline (life-cycle journey) ================= */
.journey { position: relative; }
.jcycle { position: relative; margin-bottom: 8px; }
.jcycle-hd {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: var(--r-md);
  cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); transition: all .15s;
}
.jcycle-hd:hover { border-color: var(--line-strong); background: #fff; box-shadow: var(--sh-xs); }
.jcycle.open .jcycle-hd { background: #fff; box-shadow: var(--sh-sm); }
.jcycle-hd .jic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.jcycle-hd .tt { font-size: 13.5px; font-weight: 800; letter-spacing: -.015em; }
.jcycle-hd .ss { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.jcycle-hd .chev { margin-left: auto; color: var(--ink-4); transition: transform .2s; }
.jcycle.open .jcycle-hd .chev { transform: rotate(90deg); }
.jcycle-bd { display: none; padding: 6px 0 14px 17px; }
.jcycle.open .jcycle-bd { display: block; }

.jtype-pregnancy .jic { background: var(--rose-l); color: var(--rose-d); }
.jtype-child .jic { background: var(--amber-l); color: var(--amber-d); }
.jtype-gyn .jic { background: var(--violet-l); color: var(--violet); }
.jtype-wellness .jic { background: var(--teal-l); color: var(--teal-d); }

.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 10px; width: 2px; background: linear-gradient(180deg, var(--line-strong), var(--line-2)); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 16px 0; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item .node {
  position: absolute; left: -26px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--line-strong); z-index: 1;
}
.tl-item.done .node { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.tl-item.current .node { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(14,124,134,.16); animation: pulse-ring 2s infinite; }
.tl-item.upcoming .node { border-color: var(--line-strong); background: #fff; border-style: dashed; }
.tl-item.milestone .node { border-color: var(--rose); background: var(--rose); box-shadow: 0 0 0 3px var(--rose-l); width: 16px; height: 16px; left: -27px; }
@keyframes pulse-ring { 0%,100% { box-shadow: 0 0 0 4px rgba(14,124,134,.16); } 50% { box-shadow: 0 0 0 8px rgba(14,124,134,.05); } }
.tl-item .tl-tt { font-size: 13px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-item .tl-mt { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.tl-item .tl-nt { font-size: 12px; color: var(--ink-2); margin-top: 5px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; line-height: 1.5; }
.tl-item.upcoming .tl-tt { color: var(--ink-3); }
.tl-item.current .tl-tt { color: var(--teal-d); }

/* Horizontal journey rail */
.rail { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 2px 12px; }
.rail-step { flex: none; min-width: 128px; position: relative; padding: 0 8px; }
.rail-step .bar { height: 4px; border-radius: 3px; background: var(--line-2); margin-bottom: 11px; }
.rail-step.done .bar { background: var(--green); }
.rail-step.current .bar { background: linear-gradient(90deg, var(--teal), var(--teal-m)); }
.rail-step .st-t { font-size: 12px; font-weight: 700; }
.rail-step .st-d { font-size: 10.5px; color: var(--ink-4); font-weight: 600; margin-top: 2px; }
.rail-step.upcoming .st-t { color: var(--ink-4); }
.rail-step .flag { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); margin-bottom: 3px; }

/* ================= Queue ================= */
.qitem {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: #fff; transition: all .15s;
}
.qitem:hover { box-shadow: var(--sh); border-color: #D6E3EA; }
.qitem.next { border-color: var(--teal-m); background: linear-gradient(90deg, var(--teal-ll), #fff 60%); box-shadow: 0 0 0 3px rgba(72,165,173,.1); }
.qitem .tok { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ink-2); flex: none; }
.qitem.next .tok { background: var(--teal); border-color: var(--teal); color: #fff; }
.qitem .nm { font-size: 13.5px; font-weight: 700; }
.qitem .mt { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }

/* ================= Progress / bars ================= */
.bar-track { height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--teal); transition: width .5s ease; }
.bar-fill.rose { background: var(--rose); } .bar-fill.amber { background: var(--amber); }
.bar-fill.green { background: var(--green); } .bar-fill.blue { background: var(--blue); }
.bar-fill.violet { background: var(--violet); } .bar-fill.red { background: var(--red); }

.hbar { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 11px; margin-bottom: 11px; }
.hbar .lb { font-size: 12px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .vl { font-size: 12.5px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }

/* Column chart */
.colchart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; }
.colchart .cc { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.colchart .cc .stack { width: 100%; max-width: 42px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.colchart .cc .seg { width: 100%; border-radius: 4px; transition: height .5s ease; min-height: 2px; }
.colchart .cc .xl { font-size: 10.5px; font-weight: 700; color: var(--ink-3); }
.colchart .cc .tv { font-size: 11px; font-weight: 800; color: var(--ink); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { position: relative; width: 132px; height: 132px; flex: none; }
.donut .ctr { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .ctr b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; display: block; line-height: 1; }
.donut .ctr span { font-size: 10px; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: .08em; }
.dleg { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dleg .r { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.dleg .r b { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dleg .r .v { margin-left: auto; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ================= Modal ================= */
.ovl {
  position: fixed; inset: 0; background: rgba(9, 26, 33, .42); backdrop-filter: blur(3px);
  z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px; background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); animation: pop .22s cubic-bezier(.2,.9,.3,1.1); overflow: hidden;
  margin: auto;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1120px; }
.modal-hd { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line-2); }
.modal-hd h3 { font-size: 17px; letter-spacing: -.025em; }
.modal-hd .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; font-weight: 500; }
.modal-hd .x { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: none; background: var(--surface-3); color: var(--ink-3); cursor: pointer; display: grid; place-items: center; flex: none; }
.modal-hd .x:hover { background: var(--line-2); color: var(--ink); }
.modal-bd { padding: 20px 22px; max-height: calc(100vh - 240px); overflow-y: auto; }
.modal-ft { padding: 15px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); display: flex; gap: 10px; justify-content: flex-end; align-items: center; }

/* Toast */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 11px; background: #0C2E34; color: #fff;
  padding: 12px 16px; border-radius: var(--r); box-shadow: var(--sh-lg); font-size: 13px; font-weight: 600;
  animation: slidein .24s cubic-bezier(.2,.9,.3,1.1); max-width: 380px;
}
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
.toast .ti { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.14); }
.toast.ok .ti { background: var(--green); }
.toast.warn .ti { background: var(--amber); }
.toast.err .ti { background: var(--red); }

/* ================= Steps ================= */
.steps { display: flex; align-items: center; gap: 0; }
.steps .sp { display: flex; align-items: center; gap: 8px; }
.steps .sp .n { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--surface-3); color: var(--ink-4); border: 1px solid var(--line); }
.steps .sp .t { font-size: 12px; font-weight: 700; color: var(--ink-4); white-space: nowrap; }
.steps .sp.on .n { background: var(--teal); color: #fff; border-color: var(--teal); }
.steps .sp.on .t { color: var(--ink); }
.steps .sp.ok .n { background: var(--green); color: #fff; border-color: var(--green); }
.steps .sp.ok .t { color: var(--ink-2); }
.steps .ln { width: 26px; height: 2px; background: var(--line); margin: 0 9px; border-radius: 2px; }
.steps .ln.ok { background: var(--green); }

/* ================= Tabs ================= */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: none; background: transparent; padding: 10px 14px; font-size: 13px; font-weight: 700;
  color: var(--ink-3); cursor: pointer; position: relative; white-space: nowrap; transition: color .15s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--teal-d); }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; background: var(--teal); border-radius: 3px 3px 0 0; }
.pills { display: flex; gap: 7px; flex-wrap: wrap; }
.pills button {
  border: 1px solid var(--line-strong); background: #fff; padding: 0 13px; height: 32px; border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: all .15s; font-family: inherit;
}
.pills button:hover { border-color: var(--teal-m); color: var(--teal-d); }
.pills button.on { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ================= Patient header ================= */
.pt-hero {
  background: linear-gradient(120deg, #fff 0%, var(--surface-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-sm);
  position: relative; overflow: hidden;
}
.pt-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(206,79,132,.09), transparent 70%); }
.pt-hero.ped::after { background: radial-gradient(circle, rgba(217,130,43,.1), transparent 70%); }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-4); }
.kv .v { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.kvbox { background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; }
.kvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }

.alertbar { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border-radius: var(--r); font-size: 12.5px; font-weight: 700; }
.alertbar.red { background: var(--red-l); color: var(--red); border: 1px solid #F3D2D2; }
.alertbar.amber { background: var(--amber-l); color: var(--amber-d); border: 1px solid #F3DFC0; }
.alertbar.teal { background: var(--teal-l); color: var(--teal-d); border: 1px solid #C9E4E6; }
.alertbar.blue { background: var(--blue-l); color: var(--blue-d); border: 1px solid #CFDEFB; }

/* Vitals mini */
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px,1fr)); gap: 9px; }
.vital { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; }
.vital .k { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.vital .v { font-size: 16px; font-weight: 800; letter-spacing: -.03em; margin-top: 3px; }
.vital .v small { font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 0; }

/* Rx rows */
.rx-row { display: grid; grid-template-columns: 1.7fr .8fr .8fr 1fr .8fr 32px; gap: 8px; align-items: center; }
.rx-row.hd { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-4); padding: 0 2px; }
.del-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-4); cursor: pointer; display: grid; place-items: center; }
.del-btn:hover { background: var(--red-l); color: var(--red); border-color: #F0C3C3; }

/* Prescription print */
.rxsheet { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px; font-size: 12.5px; }
.rxsheet .rx-hd { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--teal); padding-bottom: 14px; }
.rxsheet .rx-sec { margin-top: 16px; }
.rxsheet .rx-sec h5 { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.rxsheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rxsheet table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-4); padding: 5px 8px; border-bottom: 1px solid var(--line); }
.rxsheet table td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; }
.empty .ei { width: 52px; height: 52px; border-radius: 16px; background: var(--surface-3); color: var(--ink-4); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h4 { font-size: 14.5px; } .empty p { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

/* Doctor card */
.doccard { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; transition: all .16s; }
.doccard:hover { box-shadow: var(--sh); border-color: #D6E3EA; }
.doccard .nm { font-size: 13.5px; font-weight: 800; letter-spacing: -.015em; }
.doccard .sp { font-size: 11.5px; font-weight: 700; color: var(--teal-d); }
.doccard .ql { font-size: 11px; color: var(--ink-3); font-weight: 500; margin-top: 2px; }

.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); display: inline-block; flex: none; }

/* ================= Landing (index.html) ================= */
.landing { min-height: 100vh; background:
  radial-gradient(1100px 620px at 12% -8%, #E6F4F5 0%, transparent 58%),
  radial-gradient(900px 520px at 92% 6%, #FDECF3 0%, transparent 55%),
  linear-gradient(180deg, #FBFDFE, #F2F7F9);
  display: flex; flex-direction: column;
}
.lnav { display: flex; align-items: center; justify-content: space-between; padding: 22px 42px; }
.lhero { max-width: 1180px; margin: 0 auto; padding: 34px 32px 12px; text-align: center; }
.lhero .badge {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: var(--r-full);
  background: rgba(255,255,255,.8); border: 1px solid var(--line); font-size: 11.5px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; color: var(--teal-d); box-shadow: var(--sh-xs);
}
.lhero h1 { font-size: clamp(34px, 5vw, 55px); line-height: 1.05; letter-spacing: -.04em; margin: 20px 0 0; }
.lhero h1 em { font-style: normal; color: var(--teal); position: relative; }
.lhero .tag { font-size: clamp(15px, 2vw, 18px); color: var(--ink-2); margin-top: 16px; font-weight: 500; max-width: 620px; margin-inline: auto; line-height: 1.6; }
.lchips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

.lcards { max-width: 1180px; margin: 0 auto; padding: 34px 32px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 16px; }
.lcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px;
  box-shadow: var(--sh-sm); transition: all .22s cubic-bezier(.2,.8,.3,1); position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.lcard:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); border-color: #D6E3EA; }
.lcard .lic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 15px; }
.lcard h3 { font-size: 17px; letter-spacing: -.03em; }
.lcard .rl { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 4px; }
.lcard p { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.6; flex: 1; }
.lcard .go { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--teal); margin-top: 16px; }
.lcard:hover .go { gap: 10px; }
.lcard .strip { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.lfeat { max-width: 1180px; margin: 0 auto; padding: 20px 32px 50px; }
.lfoot { text-align: center; padding: 22px; font-size: 11.5px; color: var(--ink-4); font-weight: 600; border-top: 1px solid var(--line); }

.fcard { background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 17px; }
.fcard .fi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.fcard h4 { font-size: 13.5px; letter-spacing: -.02em; }
.fcard p { font-size: 12px; color: var(--ink-2); margin-top: 5px; line-height: 1.55; }

.bg-teal { background: var(--teal-l); color: var(--teal-d); }
.bg-rose { background: var(--rose-l); color: var(--rose-d); }
.bg-amber { background: var(--amber-l); color: var(--amber-d); }
.bg-blue { background: var(--blue-l); color: var(--blue-d); }
.bg-violet { background: var(--violet-l); color: var(--violet); }
.bg-green { background: var(--green-l); color: var(--green); }
.fill-teal { background: var(--teal); } .fill-rose { background: var(--rose); }
.fill-amber { background: var(--amber); } .fill-blue { background: var(--blue); }
.fill-violet { background: var(--violet); } .fill-green { background: var(--green); }

/* ================= Responsive ================= */
@media (max-width: 1400px) { .g6 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 1200px) {
  .g5, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  :root { --sidebar-w: 214px; }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--sh-lg); }
  .sidebar.open { transform: translateX(0); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .menu-btn { display: grid !important; }
  .hide-sm { display: none !important; }
}
@media (max-width: 640px) {
  .g5, .g4 { grid-template-columns: 1fr 1fr; }
  .tb-title { font-size: 14px; }
  .lcards, .lhero, .lfeat { padding-inline: 18px; }
  .lnav { padding: 16px 18px; }
}
.menu-btn { display: none; }

@media print {
  .sidebar, .topbar, .modal-ft, .modal-hd .x, .toasts { display: none !important; }
  body, .ovl { background: #fff !important; }
  .ovl { position: static; padding: 0; backdrop-filter: none; }
  .modal { box-shadow: none; max-width: 100%; }
  .modal-bd { max-height: none; overflow: visible; }
}
