/* Mline web app — single stylesheet (no external dependencies, offline-safe). */

:root {
  --teal: #0b7285;
  --teal-600: #0a5f70;
  --teal-700: #084c59;
  --accent: #15a2ad;
  --ink: #0f2b33;
  --ink-2: #40616b;
  --muted: #6b8894;
  --bg: #f4f7f8;
  --card: #ffffff;
  --line: #e2eaed;
  --line-2: #d4e0e4;
  --amber: #b7791f;
  --amber-bg: #fdf3e2;
  --green: #1f7a4d;
  --green-bg: #e6f5ec;
  --red: #b23a3a;
  --red-bg: #fdecec;
  --blue: #1d5fa8;
  --blue-bg: #e9f1fb;
  --slate: #5a6b73;
  --slate-bg: #eef2f4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 43, 51, .06), 0 8px 24px -12px rgba(15, 43, 51, .18);
  --shadow-sm: 0 1px 2px rgba(15, 43, 51, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 .8rem; }
img { max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid transparent; border-radius: 999px;
  padding: .58rem 1.15rem; font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; background: var(--teal); color: #fff;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--teal-600); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--teal); }
.btn--secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn--secondary:hover { background: #fff; border-color: var(--teal); color: var(--teal); }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn--ghost:hover { background: #fff; color: var(--teal); }
.btn--danger { background: var(--red); }
.btn--danger:hover { background: #992f2f; }
.btn--link { background: none; color: var(--teal); padding: .2rem .4rem; font-weight: 600; }
.btn--link:hover { background: none; text-decoration: underline; }
.btn--sm { padding: .35rem .8rem; font-size: .84rem; }
.btn--block { width: 100%; }
.btn--lg { padding: .8rem 1.6rem; font-size: 1rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ------------------------------------------------------------------ brand */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
}
.brand__name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--ink); }
.brand__text { display: flex; flex-direction: column; font-weight: 800; line-height: 1.15; color: #fff; }
.brand__text small { font-weight: 500; font-size: .72rem; opacity: .75; text-transform: capitalize; }
.brand--footer .brand__mark { width: 30px; height: 30px; }

/* ------------------------------------------------------------------ topnav */
.topnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav__links { display: flex; gap: 1.25rem; margin-left: auto; }
.topnav__links a { color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.topnav__links a:hover { color: var(--teal); text-decoration: none; }
.topnav__actions { display: flex; gap: .5rem; align-items: center; }
.topnav__actions form { margin: 0; }

.container { max-width: 1140px; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 4vw, 2rem); }
.container--narrow { max-width: 780px; }
.container--wide { max-width: 1320px; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1100px 420px at 12% -10%, rgba(21, 162, 173, .28), transparent 60%),
              radial-gradient(900px 380px at 95% 0%, rgba(11, 114, 133, .35), transparent 55%),
              linear-gradient(160deg, #072f38, #0b4a57 60%, #0b7285);
  color: #eafafb; padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem); text-align: center;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px;
  padding: .35rem .9rem; font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; background: rgba(255, 255, 255, .08); margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 800; letter-spacing: -.03em;
  max-width: 18ch; margin: 0 auto .9rem; color: #fff;
}
.hero p { font-size: clamp(1rem, 2vw, 1.2rem); max-width: 62ch; margin: 0 auto 1.8rem; color: rgba(234, 250, 250, .85); }
.hero__cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.hero__cta .btn--primary { background: #fff; color: var(--teal-700); }
.hero__cta .btn--primary:hover { background: #eefbfc; }
.hero__cta .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.hero__cta .btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.hero__trust { margin-top: 2.2rem; display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; font-size: .88rem; color: rgba(234, 250, 250, .78); }
.hero__trust strong { color: #fff; }

/* ------------------------------------------------------------------ stats */
.stats-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem; margin-top: -2.5rem; padding: 0 clamp(1rem, 4vw, 2rem);
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.stat__value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: var(--teal); line-height: 1.1; }
.stat__label { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat--plain { box-shadow: none; background: #fbfdfd; }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(2.25rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem); max-width: 1140px; margin: 0 auto; }
.section--tint { background: #eef4f6; max-width: none; }
.section--tint > .section__inner { max-width: 1140px; margin: 0 auto; }
.section__head { max-width: 720px; margin: 0 auto 2.25rem; text-align: center; }
.section__head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.02em; }
.section__head p { color: var(--ink-2); font-size: 1.02rem; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }

.steps, .features, .roles, .grid { display: grid; gap: 1rem; }
.steps { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.3rem; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal); color: #fff; font-weight: 700; margin-bottom: .8rem;
}
.step h3 { margin-bottom: .35rem; }
.step p { color: var(--ink-2); margin: 0; font-size: .93rem; }

.features { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; }
.feature__icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: #e6f4f6; color: var(--teal); margin-bottom: .85rem;
}
.feature__icon svg { width: 21px; height: 21px; }
.feature h3 { font-size: 1rem; margin-bottom: .3rem; }
.feature p { color: var(--ink-2); font-size: .92rem; margin: 0; }

.roles { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.role-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.4rem; display: flex; flex-direction: column; gap: .5rem;
}
.role-card h3 { margin: 0; }
.role-card ul { margin: .35rem 0 1rem; padding-left: 1.1rem; color: var(--ink-2); font-size: .93rem; }
.role-card li { margin-bottom: .25rem; }
.role-card .btn { align-self: flex-start; margin-top: auto; }

.specialty-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff; border: 1px solid var(--line-2); border-radius: 999px;
  padding: .38rem .85rem; font-size: .87rem; font-weight: 600; color: var(--ink-2);
}
a.chip:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.chip--solid { background: var(--teal); border-color: var(--teal); color: #fff; }

.cta-band {
  background: linear-gradient(135deg, var(--teal), #0e8a9e); color: #fff;
  border-radius: calc(var(--radius) + 6px); padding: clamp(1.75rem, 4vw, 2.75rem);
  text-align: center; max-width: 1140px; margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  box-shadow: var(--shadow);
}
.cta-band h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.cta-band p { color: rgba(255, 255, 255, .88); max-width: 60ch; margin: 0 auto 1.3rem; }
.cta-band .btn--primary { background: #fff; color: var(--teal-700); }
.cta-band .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .55); }

/* ----------------------------------------------------------------- footer */
.footer { background: #08262d; color: #a9c6cd; padding: 2.5rem clamp(1rem, 4vw, 2rem) 1.5rem; margin-top: auto; }
.footer__grid { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.75rem; }
.footer h4 { color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .7rem; }
.footer a { display: block; color: #a9c6cd; padding: .18rem 0; font-size: .92rem; }
.footer a:hover { color: #fff; }
.footer .brand__name { color: #fff; }
.footer__legal { max-width: 1140px; margin: 2rem auto 0; padding-top: 1.1rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .84rem; color: #7fa0a9; }

/* --------------------------------------------------------------- messages */
.messages { display: grid; gap: .5rem; margin-bottom: 1rem; }
.messages--bar { max-width: 1140px; margin: 1rem auto 0; padding: 0 clamp(1rem, 4vw, 2rem); }
.msg { padding: .7rem 1rem; border-radius: var(--radius-sm); font-size: .93rem; border: 1px solid transparent; }
.msg--success { background: var(--green-bg); color: var(--green); border-color: #c6e8d5; }
.msg--error { background: var(--red-bg); color: var(--red); border-color: #f3cdcd; }
.msg--info { background: var(--blue-bg); color: var(--blue); border-color: #cddff5; }
.msg--warning { background: var(--amber-bg); color: var(--amber); border-color: #f1dfbc; }

/* ------------------------------------------------------------------ cards */
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0 0 .2rem; }
.page-head p { margin: 0; color: var(--muted); }
.page-head .btn-row { margin-left: auto; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card + .card { margin-top: 1rem; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1.15rem; border-bottom: 1px solid var(--line); background: #fbfdfd;
}
.card__head h2, .card__head h3 { margin: 0; font-size: 1rem; }
.card__body { padding: 1.15rem; }
.card__foot { padding: .85rem 1.15rem; border-top: 1px solid var(--line); background: #fbfdfd; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card--flush .card__body { padding: 0; }

.grid--2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.grid--3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.grid--4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stack { display: grid; gap: 1rem; }
.stack--sm { display: grid; gap: .55rem; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #fbfdfd; font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fbfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a { font-weight: 600; }

.empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: .35rem; }
.empty .btn { margin-top: .9rem; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.badge--green { background: var(--green-bg); color: var(--green); }
.badge--amber { background: var(--amber-bg); color: var(--amber); }
.badge--red { background: var(--red-bg); color: var(--red); }
.badge--blue { background: var(--blue-bg); color: var(--blue); }
.badge--teal { background: #e2f4f6; color: var(--teal); }
.badge--slate { background: var(--slate-bg); color: var(--slate); }

/* ------------------------------------------------------------------ forms */
.form { display: grid; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .85rem 1rem; }
.form-grid .field--full { grid-column: 1 / -1; }
.field { display: grid; gap: .32rem; }
.field > label { font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.field .req { color: var(--red); }
.field input[type="text"], .field input[type="password"], .field input[type="email"],
.field input[type="tel"], .field input[type="number"], .field input[type="date"],
.field input[type="time"], .field input[type="url"], .field select, .field textarea {
  width: 100%; padding: .58rem .72rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 78px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 162, 173, .16);
}
.field .help { color: var(--muted); font-size: .8rem; }
.field .error, .errorlist { color: var(--red); font-size: .83rem; margin: 0; padding: 0; list-style: none; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--red); }
.field--check { display: flex; align-items: center; gap: .5rem; }
.field--check input { width: 17px; height: 17px; accent-color: var(--teal); }
.field--check label { font-size: .92rem; font-weight: 600; color: var(--ink); margin: 0; }
.non_field_errors { color: var(--red); background: var(--red-bg); border: 1px solid #f3cdcd; padding: .6rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .4rem .75rem; padding: 0; margin: 0; list-style: none; }
.checkbox-grid li { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.checkbox-grid input { accent-color: var(--teal); width: 16px; height: 16px; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding-top: .25rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem 1.1rem; margin: 0; }
legend { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 .35rem; }

/* phone group (cc select + number, grey box) */
.phone-group { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.phone-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 162, 173, .16); }
.phone-group .phone-cc {
  width: auto; min-width: 118px; border: 0; border-right: 1px solid var(--line-2); border-radius: 0;
  background: #eef2f4; color: var(--ink); font-weight: 600; font-size: .92rem;
  padding: .55rem .6rem; appearance: none; cursor: pointer;
}
.phone-group .phone-input { border: 0; border-radius: 0; background: transparent; font-size: 1rem; letter-spacing: .01em; }
.phone-group .phone-input:focus { box-shadow: none; }
.code-input { font-family: var(--mono); letter-spacing: .35em; font-size: 1.05rem !important; }

/* auth card */
.auth-wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; min-height: calc(100vh - 66px); padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem); max-width: 1080px; margin: 0 auto; }
.auth-aside h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.auth-aside ul { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .7rem; }
.auth-aside li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-2); font-size: .95rem; }
.auth-aside li svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem); }
.auth-card h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.auth-card > p.muted { margin-bottom: 1.1rem; }
.tabs { display: flex; gap: .35rem; background: var(--slate-bg); border-radius: 999px; padding: .28rem; margin-bottom: 1.15rem; }
.tab { flex: 1; text-align: center; padding: .5rem .7rem; border-radius: 999px; font-size: .89rem; font-weight: 700; color: var(--ink-2); }
.tab:hover { text-decoration: none; }
.tab.is-active { background: #fff; color: var(--teal); box-shadow: var(--shadow-sm); }
.dev-otp { background: var(--amber-bg); border: 1px dashed var(--amber); color: var(--amber); border-radius: var(--radius-sm); padding: .6rem .8rem; font-size: .88rem; margin-bottom: 1rem; }
.dev-otp code { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .2em; font-weight: 700; }

/* ------------------------------------------------------------- pagination */
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: space-between; padding: .9rem 1.15rem; border-top: 1px solid var(--line); }
.pagination__info { color: var(--muted); font-size: .86rem; }
.page-link { min-width: 32px; text-align: center; padding: .3rem .55rem; border: 1px solid var(--line-2); border-radius: 7px; font-size: .86rem; font-weight: 600; color: var(--ink-2); background: #fff; }
.page-link:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.page-link.is-current { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1.1rem; }
.filters .field { min-width: 170px; }
.filters .field--grow { flex: 1; min-width: 230px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-pills a { padding: .32rem .8rem; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.filter-pills a:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.filter-pills a.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ------------------------------------------------------------ doctor card */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; }
.doc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: .55rem; box-shadow: var(--shadow-sm); }
.doc-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.doc-card__top { display: flex; gap: .8rem; align-items: flex-start; }
.avatar { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #d8f0f3, #b8e4ea); color: var(--teal-700); font-weight: 800; font-size: 1.1rem; flex: none; }
.avatar--lg { width: 76px; height: 76px; font-size: 1.6rem; border-radius: 18px; }
.doc-card h3 { margin: 0; font-size: 1.05rem; }
.doc-card__meta { color: var(--muted); font-size: .87rem; }
.doc-card__tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.doc-card__tags .chip { font-size: .76rem; padding: .2rem .6rem; }
.doc-card__foot { margin-top: auto; padding-top: .75rem; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.doc-card__foot .next { font-size: .84rem; color: var(--teal); font-weight: 700; }
.rating { color: var(--amber); font-weight: 700; font-size: .87rem; }

/* --------------------------------------------------------- detail / kv */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem 1.25rem; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: .18rem; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ----------------------------------------------------------------- tokens */
.token-no {
  display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 .4rem;
  background: var(--teal); color: #fff; border-radius: 12px;
  font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums;
}
.token-no--muted { background: var(--slate-bg); color: var(--slate); }
.token-no--live { background: linear-gradient(135deg, var(--accent), var(--teal)); box-shadow: 0 4px 12px -4px rgba(11, 114, 133, .6); }
.queue-row { display: flex; align-items: center; gap: .9rem; padding: .75rem .95rem; border-bottom: 1px solid var(--line); }
.queue-row:last-child { border-bottom: 0; }
.queue-row__who { flex: 1; min-width: 0; }
.queue-row__who strong { display: block; font-size: .96rem; }
.queue-row__who small { color: var(--muted); }
.queue-row__actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.queue-board { display: grid; gap: 1rem; }

/* ------------------------------------------------------------- bill builder */
.bill-lines { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.bill-line { display: grid; grid-template-columns: 1.7fr 78px 105px 90px auto; gap: .55rem; align-items: center; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.bill-line:last-child { border-bottom: 0; }
.bill-line--head { background: #fbfdfd; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.bill-line input { width: 100%; padding: .4rem .5rem; border: 1px solid var(--line-2); border-radius: 7px; font: inherit; font-size: .88rem; }
.bill-line .line-name strong { display: block; font-size: .93rem; }
.bill-line .line-name small { color: var(--muted); }
.bill-total { display: flex; justify-content: space-between; align-items: center; padding: .9rem .2rem; font-size: 1.05rem; font-weight: 800; }
.med-search { position: relative; }
.med-results { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.med-results button { display: flex; width: 100%; justify-content: space-between; gap: .75rem; padding: .55rem .75rem; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.med-results button:last-child { border-bottom: 0; }
.med-results button:hover { background: #f2f9fa; }
.med-results .stock { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.med-results .stock.is-low { color: var(--red); font-weight: 700; }

/* --------------------------------------------------------------- rx sheet */
.rx-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rx-sheet__head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem; border-bottom: 2px dashed var(--line-2); background: linear-gradient(180deg, #fbfefe, #fff); }
.rx-sheet__body { padding: 1.25rem; display: grid; gap: 1.15rem; }
.rx-meds { width: 100%; border-collapse: collapse; font-size: .93rem; }
.rx-meds th, .rx-meds td { padding: .6rem .55rem; border-bottom: 1px solid var(--line); text-align: left; }
.rx-meds th { font-size: .74rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }

/* ------------------------------------------------------------ misc blocks */
.banner { border: 1px solid var(--line); background: #fbfdfd; border-radius: var(--radius-sm); padding: .85rem 1rem; font-size: .93rem; color: var(--ink-2); display: flex; gap: .6rem; align-items: flex-start; }
.banner--warn { background: var(--amber-bg); border-color: #f1dfbc; color: var(--amber); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.mini-list li { display: flex; gap: .7rem; align-items: center; justify-content: space-between; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfdfd; font-size: .92rem; }
.mini-list li .when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.tabs-row { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tabs-row a { padding: .6rem .1rem; font-weight: 700; font-size: .93rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-row a:hover { color: var(--ink); text-decoration: none; }
.tabs-row a.is-active { color: var(--teal); border-bottom-color: var(--teal); }
.date-strip { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1rem; }
.date-pill { flex: none; text-align: center; padding: .5rem .7rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; min-width: 76px; }
.date-pill small { display: block; font-size: .72rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.date-pill strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.date-pill:hover { text-decoration: none; border-color: var(--teal); }
.date-pill.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.date-pill.is-active small { color: rgba(255, 255, 255, .8); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .55rem; }
.slot-grid label { position: relative; }
.slot-grid input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slot {
  display: block; text-align: center; padding: .6rem .5rem; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: #fff; font-weight: 700; font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
.slot-grid input:checked + .slot { background: var(--teal); border-color: var(--teal); color: #fff; }
.slot-grid input:focus-visible + .slot { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot.is-disabled { opacity: .5; background: var(--slate-bg); }
.slot-grid input:disabled + .slot { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.notice { padding: 1rem; text-align: center; color: var(--muted); background: #fbfdfd; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); }

/* ------------------------------------------------------------ portal shell */
.portal-body { background: var(--bg); }
.app { display: grid; grid-template-columns: 246px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #08262d, #0b3742 65%, #0a4451);
  color: #cfe6ea; padding: 1.1rem .8rem; display: flex; flex-direction: column; gap: 1.1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 0 .45rem; }
.sidebar .brand__mark { background: linear-gradient(135deg, var(--accent), #58d0dc); }
.nav { display: grid; gap: .18rem; }
.nav__item {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem;
  border-radius: 9px; color: #bcd8de; font-size: .93rem; font-weight: 600; position: relative;
}
.nav__item:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav__item.is-active { background: rgba(255, 255, 255, .14); color: #fff; }
.nav__item.is-active::before { content: ""; position: absolute; left: -.8rem; top: 20%; bottom: 20%; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav__icon { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav__badge { margin-left: auto; background: var(--accent); color: #062830; border-radius: 999px; padding: .05rem .45rem; font-size: .74rem; font-weight: 800; }
.sidebar__footer { margin-top: auto; display: grid; gap: .6rem; }
.userchip { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; background: rgba(255, 255, 255, .07); border-radius: 10px; }
.userchip__avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #062830; font-weight: 800; font-size: .85rem; flex: none; }
.userchip__meta { min-width: 0; display: grid; line-height: 1.25; }
.userchip__meta strong { color: #fff; font-size: .87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__meta small { color: #9cc2cb; font-size: .76rem; text-transform: capitalize; }
.sidebar .btn--ghost { color: #cfe6ea; border-color: rgba(255, 255, 255, .25); }
.sidebar .btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem clamp(1rem, 3vw, 1.75rem); background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.topbar__title small { display: block; font-size: .82rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.topbar__actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.content { padding: clamp(1rem, 3vw, 1.75rem); flex: 1; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 940px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; }
  .nav { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); display: grid; }
  .nav__item.is-active::before { display: none; }
  .sidebar__footer { margin-top: 0; grid-auto-flow: column; align-items: center; }
  .footer__grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .bill-line { grid-template-columns: 1fr 1fr; }
  .bill-line--head { display: none; }
}
@media (max-width: 640px) {
  .topnav__links { display: none; }
  .stats-band { margin-top: -1.75rem; }
  .page-head { align-items: flex-start; }
  .queue-row { flex-wrap: wrap; }
  .queue-row__actions { justify-content: flex-start; width: 100%; }
}
@media print {
  .sidebar, .topbar, .footer, .topnav, .btn { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
}
