/* =====================================================================
   ClinicDesk — clinic appointment & patient dashboard (front-end demo)
   Palette: mint-paper surfaces, deep teal ink, saffron accent
   Type: Manrope (interface) + Fraunces (headings & figures)
   ===================================================================== */
:root {
  --bg: #F1F6F4;
  --surface: #FFFFFF;
  --surface-2: #F7FAF9;
  --line: #DFE8E5;
  --line-2: #EBF1EF;
  --ink: #0F2A30;
  --ink-2: #435A60;
  --mute: #5B7076;
  --teal: #0B7A75;
  --teal-d: #075E5A;
  --teal-50: #E1F2EF;
  --teal-100: #C7E7E2;
  --saffron: #F0A64B;
  --amber: #8A5A0B;   --amber-50: #FFF1D9;
  --green: #17723F;   --green-50: #E2F4E8;
  --blue: #2A55A3;    --blue-50: #E7EEFA;
  --violet: #6A3FA8;  --violet-50: #F0E9FA;
  --red: #B23434;     --red-50: #FBE6E5;
  --grey: #56656A;    --grey-50: #EDF1F1;
  --f-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-disp: 'Fraunces', Georgia, serif;
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 48, .05), 0 12px 32px -20px rgba(15, 42, 48, .22);
  --side: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
h1[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
main { padding: 8px 32px 40px; flex: 1; outline: none; }
/* views are #sections: a large scroll margin keeps a #hash load pinned to the top */
.view { scroll-margin-top: 600px; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 4px 8px; }
.brand__mark svg { display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font: 600 21px/1.1 var(--f-disp); letter-spacing: -.01em; }
.brand__text small { color: var(--mute); font-size: 12.5px; font-weight: 600; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--ink-2); font-weight: 700; text-decoration: none; transition: background .2s, color .2s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--teal-50); color: var(--teal-d); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
.nav__count { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: 99px; background: var(--teal); color: #fff; font-size: 12px; text-align: center; }

.side__card { margin-top: auto; padding: 16px; border-radius: 14px; background: linear-gradient(160deg, var(--teal-50), #F3FAF8); font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.side__card strong { color: var(--ink); }
.side__eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--teal-d); margin-bottom: 2px; }
.side__addr { margin-top: 6px; font-size: 12px; }
.side__foot { display: grid; gap: 10px; padding: 0 6px; }
.btn-reset { display: inline-flex; align-items: center; gap: 8px; justify-content: center; padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--teal-100); background: none; color: var(--teal-d); font-weight: 700; font-size: 13px; }
.btn-reset:hover { background: var(--teal-50); }
.btn-reset[data-armed] { border-style: solid; border-color: var(--red); color: var(--red); background: var(--red-50); }
.btn-reset .ic { width: 16px; height: 16px; }
.credit { font-size: 12px; color: var(--mute); text-align: center; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 32px;
  background: rgba(241, 246, 244, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: blur(10px);
}
.top__brand { display: none; align-items: center; gap: 8px; text-decoration: none; font: 600 18px var(--f-disp); }
.top__search { position: relative; flex: 1; max-width: 420px; }
.top__search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mute); width: 18px; height: 18px; }
.top__search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.top__search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.top__end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.badge-demo { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--amber-50); color: var(--amber); font-size: 12px; font-weight: 800; white-space: nowrap; border: 1px solid #F3D9A8; }
.badge-demo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); }
.top__date { color: var(--ink-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; flex: none; }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, transform .15s; }
.btn .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.btn--primary { background: var(--teal); color: #fff; box-shadow: 0 8px 18px -10px rgba(11, 122, 117, .8); }
.btn--primary:hover { background: var(--teal-d); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--teal-100); background: var(--teal-50); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn:active { transform: translateY(1px); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.link { color: var(--teal-d); font-weight: 800; font-size: 13px; text-decoration: none; }
.link:hover { text-decoration: underline; }

.field { display: grid; gap: 6px; }
.field > label, .field > span { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.field input, .field select, .field textarea, .prefix {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .prefix:focus-within { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.prefix { display: flex; align-items: center; gap: 8px; padding: 0 0 0 12px; }
.prefix span { color: var(--mute); font-weight: 700; }
.prefix input { border: 0; min-height: 42px; padding-left: 0; box-shadow: none !important; }
.field--inline { display: flex; align-items: center; gap: 8px; }
.field--inline select { min-height: 40px; padding: 6px 10px; width: auto; }
.field.has-err input, .field.has-err select, .field.has-err .prefix { border-color: var(--red); background: #FFFBFB; }
.err { color: var(--red); font-size: 12.5px; font-weight: 700; min-height: 0; }
.err:empty { display: none; }
.opt { font-weight: 600; color: var(--mute); }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 10px 0 22px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-d); margin-bottom: 6px; }
h1 { font: 600 clamp(28px, 3vw, 38px)/1.1 var(--f-disp); letter-spacing: -.02em; }
.lede { color: var(--ink-2); margin-top: 8px; max-width: 60ch; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head h2 { font: 600 19px/1.2 var(--f-disp); }
.card__sub { color: var(--mute); font-size: 13px; margin-top: 3px; }
.card__stat { font: 600 26px/1 var(--f-disp); color: var(--teal-d); }
.card__stat small { display: block; font: 700 11.5px var(--f-ui); color: var(--mute); text-align: right; margin-top: 4px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; box-shadow: var(--shadow); overflow: hidden; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: 13px; font-weight: 800; }
.kpi__ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-d); }
.kpi--amber .kpi__ic { background: var(--amber-50); color: var(--amber); }
.kpi--green .kpi__ic { background: var(--green-50); color: var(--green); }
.kpi--ink .kpi__ic { background: var(--ink); color: #fff; }
.kpi__num { font: 600 36px/1 var(--f-disp); margin-top: 14px; letter-spacing: -.02em; }
.kpi__note { color: var(--mute); font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.meter { height: 6px; border-radius: 99px; background: var(--line-2); margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--teal); transition: width .5s ease; }

/* dashboard grid */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-side { display: grid; gap: 20px; min-width: 0; }

/* segmented control & chips */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--grey-50); border: 1px solid var(--line-2); }
.seg__btn { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 800; font-size: 13px; color: var(--ink-2); }
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--teal-d); box-shadow: 0 1px 3px rgba(15, 42, 48, .12); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* today's queue */
.queue { display: grid; gap: 2px; }
.q {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 10px; border-radius: 12px; transition: background .2s;
}
.q:hover { background: var(--surface-2); }
.q + .q { border-top: 1px solid var(--line-2); }
.q__time { font: 600 17px/1 var(--f-disp); }
.q__time small { display: block; font: 700 11px var(--f-ui); color: var(--mute); margin-top: 5px; }
.q__who { min-width: 0; }
.q__name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q__name button { all: unset; cursor: pointer; }
.q__name button:hover { color: var(--teal-d); text-decoration: underline; }
.q__name button:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.q__meta { color: var(--mute); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q__act { display: flex; align-items: center; gap: 8px; }
.q.is-done .q__time, .q.is-done .q__name { color: var(--mute); }

/* status pill-select */
.status { position: relative; display: inline-flex; }
.status select {
  appearance: none; -webkit-appearance: none; border: 1px solid transparent; border-radius: 99px; padding: 6px 28px 6px 12px;
  font-size: 12.5px; font-weight: 800; background: var(--grey-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23435A60' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--grey); cursor: pointer;
}
.status select:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; }
.st-scheduled select { background-color: var(--blue-50); color: var(--blue); }
.st-checked-in select { background-color: var(--amber-50); color: var(--amber); }
.st-in-consultation select { background-color: var(--violet-50); color: var(--violet); }
.st-completed select { background-color: var(--green-50); color: var(--green); }
.st-no-show select { background-color: var(--red-50); color: var(--red); }
.st-cancelled select { background-color: var(--grey-50); color: var(--grey); text-decoration: line-through; }
.next-btn { min-width: 104px; }

/* chart */
.chart { position: relative; min-height: 220px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .base { stroke: var(--line); stroke-width: 1; }
.chart .tick, .chart .xl { fill: var(--mute); font: 600 11.5px var(--f-ui); }
.chart .xl.is-hi { fill: var(--ink); font-weight: 800; }
.chart .bar path { fill: var(--teal-100); transition: fill .2s; }
.chart .bar.is-hi path { fill: var(--teal); }
.chart .bar:hover path, .chart .bar:focus path { fill: var(--teal-d); }
.chart .bar:focus { outline: none; }
.chart .bar .hit { fill: transparent; }
.chart .val { fill: var(--ink); font: 600 14px var(--f-disp); }
.chart .avg { stroke: var(--saffron); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .avg-l { fill: var(--amber); font: 800 11px var(--f-ui); }
.tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--teal-d); font-weight: 800; }
.chart-table table { margin-top: 8px; }
.chart-table th, .chart-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line-2); }

/* duty list */
.duty { display: grid; gap: 10px; }
.duty li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.doc-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.duty__name { font-weight: 800; font-size: 14px; }
.duty__spec { color: var(--mute); font-size: 12.5px; font-weight: 600; }
.duty__load { text-align: right; font-size: 12px; color: var(--mute); font-weight: 700; }
.duty__load b { display: block; font: 600 18px/1 var(--f-disp); color: var(--ink); }
.duty li.is-off { opacity: .55; }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px; }
.toolbar__count { margin-left: auto; color: var(--mute); font-size: 13px; font-weight: 700; }
.search-lg { position: relative; flex: 1 1 300px; max-width: 460px; }
.search-lg .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--mute); width: 18px; height: 18px; }
.search-lg input { width: 100%; height: 44px; border-radius: 11px; border: 1px solid var(--line); padding: 0 14px 0 40px; background: var(--surface-2); }
.search-lg input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); background: var(--surface); }

/* tables */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 800; padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
.table tbody tr:hover td { background: #FAFCFB; }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-when b { display: block; font: 600 16px/1.1 var(--f-disp); }
.cell-when small, .cell-sub { color: var(--mute); font-size: 12.5px; font-weight: 600; }
.p-link { all: unset; cursor: pointer; font-weight: 800; display: inline-flex; align-items: center; gap: 10px; }
.p-link:hover .p-name { color: var(--teal-d); text-decoration: underline; }
.p-link:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.p-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-d); font-size: 12px; font-weight: 800; flex: none; }
.p-id { display: block; color: var(--mute); font-size: 12px; font-weight: 600; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--grey-50); color: var(--ink-2); font-size: 12px; font-weight: 700; margin: 2px 4px 2px 0; white-space: nowrap; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; }
.wa { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); text-decoration: none; font-size: 12.5px; font-weight: 800; color: var(--green); background: var(--surface); white-space: nowrap; }
.wa:hover { background: var(--green-50); }
.wa .ic { width: 16px; height: 16px; }
.empty { padding: 40px 20px; text-align: center; color: var(--mute); font-weight: 700; }

/* roster */
.legend { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; font-size: 13px; }
.legend__t { color: var(--mute); font-weight: 700; margin-right: 10px; }
.sh { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 800; }
.sh--full { background: var(--teal); color: #fff; }
.sh--am { background: var(--teal-50); color: var(--teal-d); box-shadow: inset 0 0 0 1px var(--teal-100); }
.sh--pm { background: #FDF0DC; color: var(--amber); box-shadow: inset 0 0 0 1px #F3D9A8; }
.sh--off { background: repeating-linear-gradient(135deg, var(--grey-50) 0 6px, #F7F9F9 6px 12px); color: var(--grey); }
.roster { min-width: 820px; }
.roster th, .roster td { padding: 10px; border-bottom: 1px solid var(--line-2); text-align: center; }
.roster thead th { font-size: 12px; font-weight: 800; color: var(--mute); background: var(--surface-2); text-transform: uppercase; letter-spacing: .08em; }
.roster thead th.is-today { color: var(--teal-d); background: var(--teal-50); }
.roster th[scope="row"] { text-align: left; padding-left: 18px; min-width: 210px; }
.roster td.is-today { background: #F6FBFA; }
.r-doc { display: flex; align-items: center; gap: 12px; }
.r-doc b { display: block; font-size: 14px; }
.r-doc small { color: var(--mute); font-weight: 600; font-size: 12px; }
.cell-btn { width: 100%; min-width: 78px; border: 0; padding: 10px 6px; border-radius: 10px; font-size: 12.5px; font-weight: 800; transition: transform .15s; }
.cell-btn small { display: block; font-weight: 700; font-size: 11px; opacity: .85; margin-top: 2px; }
.cell-btn:hover { transform: translateY(-1px); }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.doc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.doc-card__top { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.doc-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.doc-card dt { font-size: 11.5px; color: var(--mute); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.doc-card dd { margin: 2px 0 0; font: 600 18px var(--f-disp); }

/* ---------- dialogs ---------- */
.dlg { border: 0; padding: 0; border-radius: 20px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 40px 80px -30px rgba(15, 42, 48, .5); }
.dlg::backdrop { background: rgba(15, 42, 48, .45); backdrop-filter: blur(3px); }
.dlg[open] { animation: pop .22s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dlg__body { padding: 24px; display: grid; gap: 16px; }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg__head h2 { font: 600 24px/1.15 var(--f-disp); }
.dlg__note { color: var(--mute); font-size: 13px; margin-top: -8px; }
.dlg__foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fee-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--teal-50); color: var(--teal-d); font-weight: 800; font-size: 14px; }
.fee-line:empty { display: none; }
.dlg--side { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; border-radius: 22px 0 0 22px; width: min(460px, 100vw); }
.dlg--side[open] { animation: slide .26s ease; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.pd-head { display: flex; gap: 14px; align-items: center; }
.pd-av { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--teal); color: #fff; font: 600 22px var(--f-disp); }
.pd-head h2 { font: 600 24px/1.15 var(--f-disp); }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pd-grid div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.pd-grid dt { font-size: 11.5px; color: var(--mute); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.pd-grid dd { margin: 3px 0 0; font-weight: 800; }
.pd-list { display: grid; gap: 8px; }
.pd-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; font-size: 13.5px; }
.pd-sec { font: 600 17px var(--f-disp); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); max-width: calc(100vw - 32px); animation: pop .2s ease; }

/* mobile-only footer */
.m-foot { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1220px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top__date { display: none; }
}
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(15, 42, 48, .35);
  }
  .side > .brand, .side__card, .side__foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; gap: 2px; }
  .nav a { flex: 1; flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11px; border-radius: 10px; }
  .nav a[aria-current="page"]::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 4px 4px; }
  .nav__count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; font-size: 10.5px; }
  .top { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .top__brand { display: inline-flex; }
  .top__search { order: 3; flex-basis: 100%; max-width: none; }
  .top .btn--primary span { display: none; }
  .top .btn--primary { width: 42px; padding: 0; }
  .avatar { display: none; }
  main { padding: 4px 16px 24px; }
  .m-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 16px 96px; }
}
@media (max-width: 640px) {
  .kpis { gap: 12px; }
  .kpi { padding: 14px; }
  .kpi__num { font-size: 30px; }
  .card { padding: 16px; }
  .card--flush { padding: 0; }
  .q { grid-template-columns: 54px minmax(0, 1fr); }
  .q__act { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-head__actions .btn { width: 100%; }
  .page-head__actions { width: 100%; }
  .toolbar__count { margin-left: 0; width: 100%; }
  .dlg__body { padding: 18px; }
  .pd-grid { grid-template-columns: 1fr; }
  .dash-side { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .top__brand span { display: none; }
}
@media (max-width: 400px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi__top span:first-child { font-size: 12px; }
  .kpi__ic { width: 32px; height: 32px; }
  .badge-demo { font-size: 11px; padding: 4px 9px; }
  .seg__btn { padding: 6px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
