/* MediNexus portal: landing page and desktop dashboard. */
:root {
  --navy: #002859;
  --navy-2: #003a73;
  --ink: #002859;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --teal: #00806e;
  --teal-2: #00ac83;
  --teal-soft: #d6f3ec;
  /* The logo's blue. The name is kept: the chip/bar classes that use it are
     emitted from JS as "indigo". */
  --indigo: #006ada;
  --indigo-soft: #dbeafe;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --rose: #e11d48;
  --rose-soft: #ffe4e6;
  --green: #16a34a;
  --green-soft: #dcfce7;
  /* Sampled from the master logo: "Medi" navy, "Nexus" teal. */
  --brand-navy: #002859;
  --brand-teal: #00917c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px rgba(11, 27, 58, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ── Buttons, inputs, chips ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 18px;
  font: 600 14px/1 inherit; cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(0, 128, 110, .28); }
.btn-primary:hover:not(:disabled) { background: #006b5e; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: #fff; border-color: #cbd5e1; }
.btn-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.btn-light:hover { background: rgba(255, 255, 255, .2); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: #fff; color: var(--rose); border-color: #fecdd3; }
.btn-danger:hover { background: var(--rose-soft); }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px;
  font: 14px inherit; color: var(--ink); background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 128, 110, .15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; font-weight: 500; color: var(--ink); }
.check input { width: auto; margin: 0; accent-color: var(--teal); }
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--text); white-space: nowrap; }
.chip-teal { background: var(--teal-soft); color: #006b5e; }
.chip-indigo { background: var(--indigo-soft); color: #004a9e; }
.chip-amber { background: var(--amber-soft); color: #92400e; }
.chip-rose { background: var(--rose-soft); color: #9f1239; }
.chip-green { background: var(--green-soft); color: #166534; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: var(--rose-soft); color: #9f1239; }
.alert-info { background: var(--indigo-soft); color: #004a9e; }
.alert-warn { background: var(--amber-soft); color: #92400e; }

/* ── Landing page ───────────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid rgba(226, 232, 240, .7); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; gap: 32px; }
/* The lockup: the M monogram (static/img/logo-mark.png, page white keyed out)
   beside a two-tone wordmark — "Medi" in the logo's navy, "Nexus" its teal.
   On the dark sidebar the wordmark flips to light-on-navy; the monogram's own
   colours carry it there without a tile behind it. */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px;
  color: var(--brand-navy); letter-spacing: -.015em; }
.brand-mark { display: block; height: 30px; width: auto; flex: none; }
/* On light pages the header carries the official lockup, caption and all, so
   it is drawn large enough for the taglines to be readable; the dark sidebar
   keeps mark + two-tone text (the lockup's navy "Medi" would vanish on navy). */
.brand-logo { display: block; height: 50px; width: auto; flex: none; }
.choose .brand-logo { height: 64px; }
.brand-word b { color: var(--brand-teal); font-weight: 800; }
.nav-links { display: flex; gap: 26px; flex: 1; }
.nav-links a { color: var(--text); font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; gap: 10px; }

.hero { position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(79, 70, 229, .16), transparent 60%),
              radial-gradient(900px 500px at 0% 0%, rgba(0, 172, 131, .16), transparent 60%), #fff; }
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 80px 32px 96px; display: grid;
  grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--teal-soft); color: #006b5e; font-weight: 600; font-size: 13px; margin-bottom: 20px; }
.hero h1 { font-size: 52px; line-height: 1.06; font-weight: 800; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--teal), var(--indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 20px 0 30px; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; }
.hero-stats b { display: block; font-size: 26px; color: var(--ink); }
.hero-stats span { color: var(--muted); font-size: 13px; }

.preview { position: relative; }
.preview-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.preview-app { padding: 18px; }
.preview-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.preview-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.preview-kpi { background: var(--bg); border-radius: 12px; padding: 12px; }
.preview-kpi b { display: block; font-size: 22px; color: var(--ink); }
.preview-kpi span { font-size: 12px; color: var(--muted); }
.preview-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 6px 4px 0; }
.preview-bars i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--teal-2), var(--teal)); }
.preview-bars i:nth-child(even) { background: linear-gradient(180deg, #5aa2f7, var(--indigo)); }
.preview-chat { position: absolute; left: -46px; bottom: -34px; width: 270px; padding: 14px; }
.bubble { padding: 9px 12px; border-radius: 12px; font-size: 13px; margin-bottom: 8px; max-width: 90%; }
.bubble.in { background: #f1f5f9; color: var(--ink); }
.bubble.out { background: #dcf8c6; color: var(--ink); margin-left: auto; }
.chat-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); margin-bottom: 10px; font-size: 13px; }

.section { max-width: 1200px; margin: 0 auto; padding: 88px 32px; }
/* The sticky header is tall (it carries the lockup), so an in-page anchor
   must stop clear of it instead of hiding the heading underneath. */
section[id] { scroll-margin-top: 88px; }
/* The company band follows the product band in the same section: a gap, not a
   whole section's padding. */
.cta + .cta { margin-top: 28px; }
/* The closing bands follow the content directly: half a section's air, not a
   whole empty one. */
.section-cta { padding-top: 8px; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 17px; margin-top: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--teal-soft); color: var(--teal); }
.feature:nth-child(3n+2) .ic { background: var(--indigo-soft); color: var(--indigo); }
.feature:nth-child(3n) .ic { background: var(--amber-soft); color: var(--amber); }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); }

.band { background: var(--navy); color: #cbd5e1; }
.band .section-head h2 { color: #fff; }
.band .section-head p { color: #94a3b8; }
.level { background: var(--navy-2); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 28px; }
.level h3 { color: #fff; font-size: 19px; margin: 14px 0 8px; }
.level p { color: #94a3b8; margin: 0 0 16px; }
.level ul { margin: 0; padding-left: 18px; color: #cbd5e1; }
.level li { margin-bottom: 6px; }
.level-tag { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0, 172, 131, .15); color: var(--teal-2); }

.steps { counter-reset: step; }
.step { position: relative; padding-left: 64px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 44px; height: 44px;
  border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--teal-2), var(--indigo)); }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); }

.plan { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--teal); box-shadow: var(--shadow-lg); position: relative; }
.plan.featured::before { content: "Most popular"; position: absolute; top: -12px; left: 28px; background: var(--teal);
  color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan h3 { font-size: 18px; }
.plan .price { font-size: 26px; font-weight: 800; color: var(--ink); margin: 10px 0 4px; }
.plan .blurb { color: var(--muted); min-height: 44px; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { padding: 6px 0 6px 26px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: 10px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='%2300806e' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }

.security { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.security ul { list-style: none; margin: 0; padding: 0; }
.security li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.security li b { color: var(--ink); display: block; }
.shield { background: linear-gradient(135deg, var(--navy), #1e3a8a); border-radius: 22px; padding: 36px; color: #cbd5e1; }
.shield h3 { color: #fff; font-size: 22px; margin-bottom: 12px; }
.scope-demo { margin-top: 20px; display: grid; gap: 10px; }
.scope-demo div { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 12px 14px; }
.scope-demo div:nth-child(2) { margin-left: 24px; }
.scope-demo div:nth-child(3) { margin-left: 48px; border-color: var(--teal-2); }

.cta { background: linear-gradient(135deg, var(--teal), var(--indigo)); border-radius: 24px; padding: 56px; color: #e0f2fe;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.cta h2 { color: #fff; font-size: 32px; }
/* The second band hands over from the product to the company behind it, so it
   wears the brand navy rather than repeating the teal->blue gradient. */
.cta-partner { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #cbd5e1; }
footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 34px 32px 26px; display: flex;
  justify-content: space-between; align-items: flex-end; gap: 44px; color: var(--muted); }
/* The official lockup, taglines included: at 96px tall they are readable,
   which is the point of showing the artwork rather than a wordmark. */
.footer-logo { display: block; height: 96px; width: auto; }
.footer-meta { margin: 0; text-align: right; padding-bottom: 8px; }
.footer-base { border-top: 1px solid var(--line); background: #fbfcfe; }
.footer-base-inner { max-width: 1200px; margin: 0 auto; padding: 11px 32px; display: flex;
  align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12.5px; }
.footer-copy { margin: 0; }
.footer-powered { display: flex; align-items: center; gap: 10px; }
.footer-partner { display: block; }
.footer-partner img { display: block; height: 20px; width: auto; }
.footer-partner:hover { opacity: .72; }

/* ── Positioning sections ───────────────────────────────────────────────── */
.channel-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.channel-row span { font-size: 11px; font-weight: 600; color: #006b5e; background: var(--teal-soft); padding: 2px 8px; border-radius: 999px; }
.quote { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--radius);
  padding: 24px; font-size: 17px; font-weight: 600; color: var(--ink); }
.quote:nth-child(even) { border-left-color: var(--indigo); }
.problem-note { text-align: center; max-width: 720px; margin: 40px auto 0; font-size: 17px; color: var(--muted); }
.problem-note b { color: var(--ink); }
.flow { display: grid; grid-template-columns: 1fr auto 1.1fr auto 1fr; gap: 18px; align-items: stretch; }
.flow-col { background: var(--navy-2); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 24px; }
.flow-core { border: 1px solid var(--teal-2); box-shadow: 0 0 0 4px rgba(0, 172, 131, .12); }
.flow-arrow { align-self: center; font-size: 28px; color: var(--teal-2); font-weight: 700; }
.flow-list { list-style: none; margin: 16px 0 0; padding: 0; }
.flow-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, .06); }
.flow-list li span { color: var(--teal-2); display: inline-flex; }
.flow-steps { margin: 16px 0 0; padding-left: 22px; color: #e2e8f0; }
.flow-steps li { padding: 6px 0; }
.flow-steps li::marker { color: var(--teal-2); font-weight: 700; }
.flow-ops { margin-top: 14px; color: #fff; font-weight: 700; }
.tagline { text-align: center; margin: 40px 0 0; font-size: 20px; color: #cbd5e1; }
.tagline b { color: #fff; }
.feature-list { margin: 0; padding-left: 18px; color: var(--muted); }
.feature-list li { margin-bottom: 4px; }
.section-tight { padding-top: 24px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.panel h2 { font-size: 26px; margin: 14px 0 10px; }
.ic-lg { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.ic-lg.ic-teal { background: var(--teal-soft); color: var(--teal); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-inner { padding: 14px 16px; }
  /* Keep the lockup and the two buttons on one line on a phone. */
  .brand { font-size: 17px; }
  .brand-mark { height: 26px; }
  .nav-actions { margin-left: auto; }
  .brand-logo { height: 40px; }
  .choose .brand-logo { height: 46px; }
  .nav-actions .btn { padding: 9px 14px; }
  .hero-inner { grid-template-columns: 1fr; padding: 48px 16px 72px; }
  .hero h1 { font-size: 36px; }
  .hero-stats, .hero-cta { flex-wrap: wrap; gap: 16px; }
  .preview-chat { position: static; width: auto; margin-top: 16px; }
  .section { padding: 56px 16px; }
  .grid3, .grid4, .split, .security { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .cta { flex-direction: column; align-items: flex-start; padding: 32px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; padding: 28px 16px 22px; }
  .footer-logo { height: 72px; }
  .footer-meta { text-align: left; }
  .footer-base-inner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
}

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-back { position: fixed; inset: 0; background: rgba(11, 27, 58, .55); backdrop-filter: blur(3px); z-index: 50;
  display: grid; place-items: center; padding: 24px; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 48px); overflow: auto; }
.modal.wide { max-width: 760px; }
.modal-head { padding: 24px 28px 8px; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h2 { font-size: 22px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); }
.modal-body { padding: 16px 28px 28px; }
.close { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; }
.close:hover { background: #f1f5f9; }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.kind { border: 2px solid var(--line); border-radius: 14px; padding: 16px; cursor: pointer; transition: all .15s; background: #fff; text-align: left; font: inherit; }
.kind:hover { border-color: #99f6e4; }
.kind.on { border-color: var(--teal); background: #f0fdfa; }
.kind b { display: block; color: var(--ink); margin: 8px 0 4px; }
.kind span { color: var(--muted); font-size: 12.5px; }
.plans-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.plans-pick .kind b { margin-top: 0; }
.form-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.divider { font-weight: 700; color: var(--ink); margin: 6px 0 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: 22px 22px 18px; }
.side .brand-word b { color: var(--teal-2); }
.side nav { padding: 6px 12px; flex: 1; overflow: auto; }
.side .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 16px 12px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cbd5e1;
  font-weight: 500; cursor: pointer; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.on { background: rgba(0, 172, 131, .16); color: #fff; }
.nav-item.on svg { color: var(--teal-2); }
.nav-item .lock { margin-left: auto; opacity: .6; }
.side-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.plan-pill { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 12px 14px; }
.plan-pill b { color: #fff; display: block; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(244, 246, 251, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 14px 32px; display: flex; align-items: center; gap: 16px; }
.crumbs { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--muted); font-weight: 500; }
.crumbs b { color: var(--ink); }
.crumbs .sep { color: #cbd5e1; }
.topbar select { width: auto; min-width: 240px; }
.user { display: flex; align-items: center; gap: 10px; cursor: pointer; position: relative; padding: 4px 8px; border-radius: 10px; }
.user:hover { background: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--teal-2), var(--indigo));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.user b { color: var(--ink); font-size: 13px; line-height: 1.2; }
.menu { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); min-width: 220px; padding: 6px; }
.menu button, .menu .menu-link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px;
  border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.menu button:hover, .menu .menu-link:hover { background: var(--bg); }

.page { padding: 28px 32px 48px; max-width: 1480px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; gap: 16px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(226, 232, 240, .7); }
.card-head { padding: 18px 20px 0; display: flex; justify-content: space-between; align-items: center; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 18px 20px 20px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 30px; font-weight: 800; color: var(--ink); margin-top: 6px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.kpi .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.kpi:nth-child(2) .ic { background: var(--indigo-soft); color: var(--indigo); }
.kpi:nth-child(3) .ic { background: var(--amber-soft); color: var(--amber); }
.kpi:nth-child(4) .ic { background: var(--rose-soft); color: var(--rose); }
.kpi:nth-child(5) .ic { background: var(--green-soft); color: var(--green); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.gauge { margin-bottom: 18px; }
.gauge-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; color: var(--ink); }
.gauge-top span { color: var(--muted); font-weight: 500; }
.bar { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal-2), var(--teal)); width: 0; transition: width .6s ease; }
.bar.indigo i { background: linear-gradient(90deg, #5aa2f7, var(--indigo)); }
.bar.amber i { background: linear-gradient(90deg, #fbbf24, var(--amber)); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart svg { width: 100%; height: 220px; display: block; }

table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f8fafc; position: sticky; top: 0; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.tbl tr:hover td { background: #fafcff; }
.tbl td b { color: var(--ink); font-weight: 600; }
.tbl td small { display: block; color: var(--muted); }
.tbl-wrap { overflow: auto; max-height: calc(100vh - 260px); border-radius: 0 0 var(--radius) var(--radius); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty svg { color: #cbd5e1; margin-bottom: 10px; }

.filters { display: flex; gap: 10px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filters select, .filters input { width: auto; }
.filters input[type=search] { min-width: 260px; }
.seg { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font: 600 13px inherit; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }

.fac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.fac { padding: 22px; }
.fac-top { display: flex; justify-content: space-between; gap: 12px; }
.fac h3 { font-size: 17px; }
.fac .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.fac .stats div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.fac .stats b { display: block; font-size: 20px; color: var(--ink); }
.fac .stats span { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.doc { padding: 20px; }
.doc-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.doc .avatar { width: 46px; height: 46px; font-size: 15px; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; margin-bottom: 14px; }
.doc-meta span { color: var(--muted); display: block; font-size: 12px; }

.ent-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ent { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.ent .mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ent.on .mark { background: var(--green-soft); color: var(--green); }
.ent.off .mark { background: #f1f5f9; color: #94a3b8; }
.ent.off b { color: var(--muted); }
.plan-hero { padding: 26px; display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, var(--navy), #1e3a8a); color: #cbd5e1; border-radius: var(--radius); margin-bottom: 20px; }
.plan-hero h2 { color: #fff; font-size: 26px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--green); font-weight: 700; }
.no { color: #cbd5e1; }

.locked { text-align: center; padding: 72px 24px; }
.locked .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--amber-soft); color: var(--amber);
  display: inline-grid; place-items: center; margin-bottom: 16px; }
.locked h2 { margin-bottom: 8px; }
.banner { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--radius); margin-bottom: 20px;
  background: linear-gradient(90deg, #f0fdfa, #eef2ff); border: 1px solid #d6f3ec; }
.banner b { color: var(--ink); }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; font-weight: 500; }
.spinner { width: 22px; height: 22px; border: 3px solid #e2e8f0; border-top-color: var(--teal); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 14px 14px 12px; font: 600 14px inherit;
  color: var(--muted); cursor: pointer; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--teal); }
.cta .btn-ghost { background: #fff; color: var(--ink); border-color: #fff; }
.btn-block { width: 100%; }
.legend-teal { background: var(--teal-2); }
.legend-indigo { background: #6366f1; }
.kind { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
.preview { padding-bottom: 70px; }
.preview-chat { left: -56px; bottom: -8px; }
.hero-stats b { font-size: 22px; white-space: nowrap; }
.doc .chips { margin-bottom: 14px; }

/* ── Required fields and errors shown where they are ──────────────────────── */
.req::after { content: " *"; color: var(--rose); }
.invalid input, .invalid select, .invalid textarea, .invalid .multi-btn, .invalid > .kinds .kind, .invalid .check {
  border-color: var(--rose); }
.invalid input:focus, .invalid select:focus, .invalid textarea:focus { box-shadow: 0 0 0 3px rgba(225, 29, 72, .15); }
.field-error { color: var(--rose); font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.checks.invalid { margin-bottom: 4px; }
.checks.invalid + .field-error, [data-field] > .field-error { grid-column: 1 / -1; }

/* ── Dropdown of checkboxes (languages) ───────────────────────────────────── */
.multi { position: relative; }
.multi-btn { width: 100%; text-align: left; padding: 11px 36px 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; position: relative; }
.multi-btn::after { content: "▾"; position: absolute; right: 14px; color: var(--muted); }
.multi-menu { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; padding: 6px; }
.multi-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.multi-opt:hover { background: #f1f5f9; }
.multi-opt input { width: auto; margin: 0; accent-color: var(--teal); }

/* ── Signup wizard ────────────────────────────────────────────────────────── */
.steps-bar { display: flex; gap: 6px; margin-bottom: 18px; }
.steps-bar i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps-bar i.on { background: var(--teal); }
.steps-bar i.gone { display: none; }
.step-title { font-size: 17px; margin-bottom: 14px; }
.kinds-4 { grid-template-columns: repeat(2, 1fr); }

/* ── Trial, getting started, choosing a plan, uploads ─────────────────────── */
.banner-warn { background: var(--amber-soft); border-color: #fde68a; }
.banner a { margin-left: 8px; font-weight: 600; }
.checklist .card-body { display: grid; gap: 8px; }
.check-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-weight: 500; }
.check-step .mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f1f5f9; color: var(--muted); }
.check-step.done { color: var(--muted); text-decoration: line-through; }
.check-step.done .mark { background: var(--green-soft); color: var(--green); }
.plans-choose { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-option { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.plan-option.on { border-color: var(--teal); background: #f0fdfa; }
.plan-option .price { font-weight: 700; color: var(--ink); }
.plan-option ul { margin: 4px 0 8px; padding-left: 18px; color: var(--text); font-size: 13px; }
.plan-option .btn, .plan-option .chip { align-self: flex-start; margin-top: auto; }
.upload-rows { max-height: 300px; overflow: auto; margin-bottom: 12px; }
.upload-rows tr.bad td { color: #9f1239; background: #fff1f2; }

@media (max-width: 700px) {
  .kinds, .kinds-4, .plans-choose, .checks, .row2 { grid-template-columns: 1fr; }
}

/* Phones: the header lockup keeps its caption, so the ghost "Log in" gives way
   (the hero carries the same sign-in) rather than squeezing the primary button. */
@media (max-width: 470px) {
  .brand-logo { height: 36px; }
  .nav-actions .btn-ghost { display: none; }
}
.field .hint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }

/* Doctor app: access on the doctor card, and doctors' requests */
.doc-app { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; }
tr.click { cursor: pointer; }
.plan-list { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; }
.req-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.req-top p { margin: 4px 0 0; }
.modal-body h4 { margin: 18px 0 8px; font-size: 14px; }
.outcomes { display: grid; gap: 10px; }
.outcome { border-radius: 10px; padding: 10px 14px; border: 1px solid var(--line); }
.outcome ul { margin: 6px 0 0; padding-left: 18px; }
.outcome small { display: block; color: var(--muted); }
.outcome.ok { background: var(--green-soft); border-color: #bbf7d0; }
.outcome.wait { background: var(--indigo-soft); border-color: #bfdbfe; }
.outcome.warn { background: var(--amber-soft); border-color: #fde68a; }
.outcome.bad { background: var(--rose-soft); border-color: #fecdd3; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.timeline small { display: block; }

/* ── Choose where to work (/choose): the single entry point's workspaces ── */
.choose-body { min-height: 100vh; display: grid; place-items: start center; padding: 48px 16px; }
.choose { width: 100%; max-width: 560px; }
.choose .brand { margin-bottom: 28px; }
.choose h1 { font-size: 26px; margin-bottom: 6px; }
.choose > .muted { margin: 0 0 22px; }
.workspaces { display: grid; gap: 12px; margin-bottom: 22px; }
.workspace { display: flex; gap: 16px; align-items: flex-start; width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); font: inherit; color: var(--text); transition: border-color .15s, transform .15s; }
.workspace:hover:not(:disabled) { border-color: var(--teal-2); transform: translateY(-1px); }
.workspace:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.workspace:disabled { cursor: wait; opacity: .6; }
.workspace.busy { opacity: 1; border-color: var(--teal); }
.workspace-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal); }
.workspace-text { display: grid; gap: 3px; min-width: 0; }
.workspace-text b { color: var(--ink); font-size: 16px; }
.workspace-text small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.add-account { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.add-account summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.add-account[open] summary { margin-bottom: 10px; }
.choose-foot { margin-top: 22px; text-align: center; }
.choose-foot a { color: var(--muted); }

.menu .menu-link { color: inherit; text-decoration: none; box-sizing: border-box; }
.sched-line { display: block; white-space: nowrap; }
.sched { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
