/* ApnaShehar admin — one stylesheet, no framework.
   Tokens: navy ink + green actions + orange reserved for "work waiting". */

@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans-400.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans-500.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans-600.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans-700.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans-800.ttf) format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Naskh"; src: url(fonts/NotoNaskhArabic-400.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Naskh"; src: url(fonts/NotoNaskhArabic-600.ttf) format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --navy: #102C3A;
  --navy-2: #173B4C;
  --navy-3: #22495C;
  --canvas: #F4F6F8;
  --paper: #FFFFFF;
  --ink: #102C3A;
  --ink-2: #4A5D68;
  --ink-3: #74858F;
  --line: #DCE3E8;
  --line-2: #E9EEF1;
  --green: #35B58B;
  --action: #1B7F5E;
  --action-hover: #156A4E;
  --action-tint: #E4F3EC;
  --orange: #F5A623;
  --orange-ink: #8A5600;
  --orange-tint: #FDF1DC;
  --red: #C8413B;
  --red-tint: #FBE7E5;
  --blue: #2A78D6;
  --blue-tint: #E5EFFB;
  --s1: #1B7F5E; --s2: #2A78D6; --s3: #D9822B;
  --seq-1: #E3F3EC; --seq-2: #B5E0CD; --seq-3: #6FC3A0; --seq-4: #2F9A74; --seq-5: #17684C;
  --r-panel: 12px; --r-ctl: 8px;
  --side: 248px;
  --font: "Jakarta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --urdu: "Naskh", "Noto Naskh Arabic", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--canvas); font-feature-settings: "tnum" 1; }
a { color: var(--action); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 2px; border-radius: 4px; }
.ur { font-family: var(--urdu); direction: rtl; unicode-bidi: isolate; line-height: 1.7; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #C9D6DD; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: var(--navy-3) transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: #8FA6B2; letter-spacing: 0; }
.nav { padding: 4px 10px 16px; flex: 1; }
.nav h6 { margin: 16px 10px 6px; font-size: 11.5px; font-weight: 600; color: #7E97A4; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #D5E0E6; font-weight: 500; }
.nav a:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.nav a[aria-current="page"] { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav .badge { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--orange); color: #3B2600; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.side-foot { padding: 14px 20px; border-top: 1px solid var(--navy-2); font-size: 12.5px; color: #8FA6B2; }
.side-foot strong { color: #fff; font-weight: 600; display: block; }
.side-foot .demo { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 6px; background: #3A3017; color: var(--orange); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.top .menu { display: none; }
.top form.search { flex: 1; max-width: 420px; margin-left: auto; }
.top .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.content { padding: 24px 28px 64px; max-width: 1360px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid transparent; font: 600 13.5px/1 var(--font); cursor: pointer; background: var(--action); color: #fff; white-space: nowrap; }
.btn:hover { background: var(--action-hover); text-decoration: none; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #C3CED5; background: #FBFCFD; }
.btn.danger { background: var(--paper); color: var(--red); border-color: #EBC5C2; }
.btn.danger:hover { background: var(--red-tint); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=tel], input[type=email], input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink); font: 400 14px var(--font);
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--action-tint); }
input[type=checkbox], input[type=radio] { accent-color: var(--action); width: 16px; height: 16px; }
input[type=file] { font: inherit; font-size: 13px; }
label.field { display: block; }
label.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label.field > em { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ------------------------------------------------------------ surfaces */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel > header { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.panel > header h2 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -0.005em; }
.panel > header p { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.panel > header .spacer + * { flex: none; }
.panel .body { padding: 16px 20px 20px; }
.panel .body.flush { padding: 8px 0 0; }
.layout { display: grid; gap: 20px; }
.layout.two { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.layout.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layout.side-form { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.section-title { margin: 28px 0 12px; font-size: 16px; font-weight: 700; }

/* The work rail: every queue that needs a person, as one ledger line. */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); overflow-x: auto; margin-bottom: 20px; scrollbar-width: thin; }
.rail a { display: block; padding: 16px 18px 15px; color: var(--ink); border-left: 1px solid var(--line-2); position: relative; }
.rail a:first-child { border-left: 0; }
.rail a:hover { background: #FAFBFC; text-decoration: none; }
.rail b { display: block; font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.rail span { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; }
.rail small { display: block; color: var(--ink-3); font-size: 12px; }
.rail a.waiting::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange); }
.rail a.clear b { color: #A9B6BD; }

/* Stat line (analytics/server): numbers in a row, separated by rules, no boxes. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.stats > div { padding: 14px 18px 14px 0; }
.stats > div + div { padding-left: 18px; border-left: 1px solid var(--line-2); }
.stats dt { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.stats dd { margin: 4px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.stats dd small { font-size: 12.5px; font-weight: 600; letter-spacing: 0; margin-left: 6px; }
.up { color: var(--action); } .down { color: var(--red); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFC; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #FAFCFB; }
.t td.r, .t th.r { text-align: right; }
.t .name { font-weight: 600; color: var(--ink); }
.t .name + .ur { display: block; font-size: 12.5px; color: var(--ink-3); text-align: left; direction: rtl; }
.t .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.t form { display: inline; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.good { background: var(--action-tint); color: var(--action); }
.pill.warn { background: var(--orange-tint); color: var(--orange-ink); }
.pill.bad { background: var(--red-tint); color: var(--red); }
.pill.info { background: var(--blue-tint); color: #1F5EA8; }
.pill.plain::before { display: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--action); }
.tabs a .count { margin-left: 6px; color: var(--ink-3); font-weight: 500; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { max-width: 280px; }
.filters select { width: auto; min-width: 150px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px 16px; color: var(--ink-3); font-size: 12.5px; }

.flash { margin-bottom: 18px; padding: 12px 16px; border-radius: 10px; background: var(--action-tint); color: #11553F; font-weight: 600; border: 1px solid #C4E5D6; }
.flash.error { background: var(--red-tint); color: #8E2B26; border-color: #F0C9C5; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--orange-tint); color: #6B4300; font-size: 13px; }
.note.info { background: var(--blue-tint); color: #1B4C86; }

.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 11px 20px; border-top: 1px solid var(--line-2); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .grow span { display: block; font-size: 12.5px; color: var(--ink-3); }
.age { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.age.late { color: var(--orange-ink); font-weight: 600; }

/* ------------------------------------------------------------ charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font: 500 11px var(--font); }
.chart .lbl { fill: var(--ink-2); font: 600 11.5px var(--font); }
.chart .lbl-strong { fill: var(--ink); font: 700 12px var(--font); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.chart.hovering .cross { opacity: 1; }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 140px; padding: 9px 11px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 12.5px; line-height: 1.45; box-shadow: 0 6px 20px rgba(16, 44, 58, .22); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tip.on { opacity: 1; transform: none; }
.tip b { display: block; font-weight: 700; margin-bottom: 3px; }
.tip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; font-style: normal; vertical-align: -1px; }
.tip .k1 { background: var(--s1); } .tip .k2 { background: var(--s2); } .tip .k3 { background: var(--s3); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .k1 { background: var(--s1); } .legend .k2 { background: var(--s2); } .legend .k3 { background: var(--s3); }
details.data { margin-top: 10px; font-size: 12.5px; }
details.data summary { cursor: pointer; color: var(--ink-3); font-weight: 600; }
details.data table { margin-top: 8px; }

/* Horizontal measure rows (top searches, categories): label · bar · value */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 54px; gap: 12px; align-items: center; padding: 5px 0; font-size: 13px; }
.bars li .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.bars li .v { text-align: right; font-weight: 700; }
.bars li svg { width: 100%; height: 10px; display: block; }
.bars li.miss .l { color: var(--orange-ink); }

/* ------------------------------------------------------------ push composer */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.phone { position: sticky; top: 84px; width: 300px; margin: 0 auto; padding: 14px; border-radius: 38px; background: #0E1A21; box-shadow: 0 30px 60px -30px rgba(16, 44, 58, .55); }
.phone .screen { border-radius: 28px; overflow: hidden; min-height: 520px; padding: 46px 12px 20px; background: linear-gradient(160deg, #2C5D70, #102C3A 70%); }
.phone .clock { text-align: center; color: #fff; font-size: 46px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.phone .date { text-align: center; color: #CFE0E8; font-size: 12.5px; margin: 6px 0 28px; }
.notif { background: rgba(255, 255, 255, .93); border-radius: 18px; padding: 11px 12px; color: #111; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.notif .app { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #5C6B73; }
.notif .app img { width: 18px; height: 18px; border-radius: 5px; background: var(--navy); padding: 1px; }
.notif .app span:last-child { margin-left: auto; }
.notif h4 { margin: 7px 0 2px; font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.notif p { margin: 0; font-size: 13px; color: #2B3A42; overflow-wrap: anywhere; }
.notif .ur { text-align: right; }
.notif .pic { margin-top: 9px; border-radius: 12px; overflow: hidden; aspect-ratio: 2 / 1; background: #DCE3E8; display: grid; place-items: center; color: #7E8E97; font-size: 12px; }
.notif .pic img { width: 100%; height: 100%; object-fit: cover; }
.phone .switch { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.phone .switch button { border: 0; border-radius: 999px; padding: 5px 12px; font: 600 12px var(--font); background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.phone .switch button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.counter { float: right; font-weight: 500; color: var(--ink-3); }
.counter.over { color: var(--red); font-weight: 700; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.choice label { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--paper); font-size: 13px; }
.choice label:has(input:checked) { border-color: var(--action); background: #F5FBF8; box-shadow: inset 0 0 0 1px var(--action); }
.choice label b { display: block; font-weight: 600; }
.choice label small { color: var(--ink-3); }

/* ------------------------------------------------------------ server tab */
.meter { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter svg { display: block; width: 100%; height: 8px; }
.health { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 12px; background: var(--action-tint); color: #11553F; font-weight: 600; margin-bottom: 20px; }
.health.warn { background: var(--orange-tint); color: #6B4300; }
.health svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
pre.log { margin: 0; padding: 14px 16px; background: #0F222C; color: #CFE0E8; border-radius: 10px; overflow: auto; max-height: 340px; font-size: 12px; line-height: 1.55; }

/* ------------------------------------------------------------ auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); }
.auth .art { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth .art h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -0.03em; margin: 0; max-width: 13ch; font-weight: 800; }
.auth .art .ur { font-size: 22px; color: #9FD9C2; margin-top: 14px; display: block; text-align: left; }
.auth .art p { color: #9DB2BD; max-width: 46ch; }
.auth .art svg.skyline { position: absolute; right: -40px; bottom: -10px; width: 70%; opacity: .16; }
.auth .form { display: flex; flex-direction: column; justify-content: center; padding: 48px; background: var(--paper); }
.auth .form h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.015em; }
.auth .form p { margin: 0 0 22px; color: var(--ink-2); }
.auth .form .btn { width: 100%; height: 44px; margin-top: 6px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .layout.two, .layout.side-form { grid-template-columns: minmax(0, 1fr); }
  .composer { grid-template-columns: minmax(0, 1fr); }
  .phone { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 0 100vmax rgba(9, 24, 32, 0); }
  body.drawer .side { transform: none; box-shadow: 0 0 0 100vmax rgba(9, 24, 32, .45); }
  .top { padding: 10px 16px; }
  .top .menu { display: inline-flex; }
  .top .who span { display: none; }
  .content { padding: 18px 16px 48px; }
  .layout.halves, .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 22px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth .art { padding: 28px; min-height: 220px; }
  .auth .form { padding: 28px; }
  .t .hide-sm { display: none; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .top form.search { display: none; }
  .rail { grid-auto-columns: minmax(128px, 1fr); }
  .rail b { font-size: 28px; }
  .stats dd { font-size: 24px; }
  .bars li { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) 44px; }
}
@media print {
  .side, .top, .actions, .filters, .btn { display: none !important; }
  .shell { display: block; }
  .panel { break-inside: avoid; }
}
.chart svg.fixed { width: auto; max-width: none; }

/* ------------------------------------------------------------ analytics & spacing */
.layout + .layout, .layout + .panel, .panel + .layout, .panel + .panel, .rail + .layout, .stats + .layout { margin-top: 20px; }
.layout.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #E8EDF0; border-radius: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg a:hover { color: var(--ink); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 44, 58, .12); }
.hero-chart > header { align-items: flex-start; }
.hero-chart .big { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-align: right; }
.hero-chart .big small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-top: 4px; }
h3.mini { font-size: 13px; font-weight: 700; margin: 18px 0 6px; color: var(--ink-2); }
.panel > header > div { min-width: 0; }
@media (max-width: 1180px) { .layout.thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .layout.thirds { grid-template-columns: minmax(0, 1fr); } .toolbar .spacer { display: none; } }

/* fixes after screenshot review */
.layout > .panel, .layout > section { margin-top: 0 !important; }
.panel > header { flex-wrap: wrap; row-gap: 4px; }
.panel > header p { min-width: 0; overflow-wrap: anywhere; }
.top .mark { display: none; width: 30px; height: 30px; }
@media (max-width: 900px) {
  .top .mark { display: block; }
  .top .who { margin-left: auto; }
}
@media (max-width: 640px) {
  .panel > header .spacer { display: none; }
  .panel > header p { flex-basis: 100%; }
  .chart:has(.hit) { overflow-x: auto; scrollbar-width: thin; }
  .chart:has(.hit) svg { min-width: 560px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div, .stats > div + div { padding: 12px 12px 12px 0; border-left: 0; border-top: 1px solid var(--line-2); }
  .stats > div:nth-child(-n+2) { border-top: 0; }
  .stats > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line-2); }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .hero-chart .big { text-align: left; }
}

/* ------------------------------------------------------------ businesses */
.approvals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.approvals .panel + .panel { margin-top: 0; }
.approval header h2 a { color: var(--ink); }
.approval header .ur { font-size: 14px; text-align: left; }
.approval .note { margin-top: 12px; }
.approval-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.approval-actions .reject { flex: 1 1 260px; flex-wrap: nowrap; }
.approval-actions .reject select { flex: 1; min-width: 0; }
.sticky-side { position: sticky; top: 76px; }
.sticky-side .panel + .panel { margin-top: 0; }
.lbl-f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.thumb { width: 100%; max-width: 260px; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; background: var(--line-2); }
.thumb.none { display: grid; place-items: center; color: var(--ink-3); font-size: 12.5px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 10px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 4px; }
table.hours td { padding: 6px 8px; }
table.hours input[type=time] { min-width: 104px; height: 34px; padding: 0 8px; }
@media (max-width: 1180px) { .sticky-side { position: static; } }

/* ------------------------------------------------------------ remaining pages */
.deal { display: inline-block; padding: 3px 9px; border-radius: 7px; background: var(--orange-tint); color: var(--orange-ink); font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.stars { color: var(--orange); letter-spacing: 1px; font-size: 14px; }
.reviews li { align-items: flex-start; }
.reviews p { margin: 6px 0 8px; max-width: 75ch; }
.complaint-form { margin: 12px 0 8px; flex-wrap: nowrap; }
.complaint-form select { width: auto; flex: none; }
.complaint-form input { flex: 1; min-width: 0; }
.cat-layout { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); align-items: start; }
.sortable li.current { background: #F3FAF6; box-shadow: inset 3px 0 0 var(--action); }
.sortable code { font-size: 11.5px; }
.order-save { padding: 12px 20px; }
.sub-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.sub-row input[type=text] { flex: 1 1 140px; width: auto; min-width: 0; }
.sub-row select { width: auto; flex: 0 1 140px; }
.sub-row .order { width: 72px; flex: none; }
.sub-row .price { width: 110px; flex: none; }
.sub-row label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.t.subs td { padding: 10px 16px; }
.danger-row { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.change { font-size: 13px; }
.push-table .msg { display: flex; gap: 12px; align-items: center; min-width: 240px; }
.push-table .msg img, .push-table .msg .noimg { width: 64px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; background: var(--line-2); display: grid; place-items: center; color: var(--ink-3); }
.push-table .msg .noimg svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.push-table .msg > div { min-width: 0; }
.push-table .msg .name { display: block; }
.choice input[type=radio] { margin-top: 2px; flex: none; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 6px 0; }
.checks li { align-items: flex-start; }
.checks .pill { margin-top: 1px; min-width: 56px; justify-content: center; }
.meter-cell { width: 30%; }
.narrow { max-width: 760px; }
code.key { font-size: 15px; padding: 3px 8px; background: var(--line-2); border-radius: 6px; letter-spacing: .04em; }
.t.roles td, .t.roles th { padding: 8px 14px; }
.t td .muted.small, .t td .small.muted { display: block; }
@media (max-width: 1180px) { .cat-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .complaint-form { flex-wrap: wrap; } .complaint-form input { flex-basis: 100%; } }
.stack > .check { display: flex; }
.stack > .btn { display: flex; width: fit-content; }
.sticky-side .stack > .btn, .auth .form .btn { width: 100%; }

/* ------------------------------------------------------------ logins & reset page */
.cred { margin-bottom: 18px; border-color: #C4E5D6; box-shadow: inset 4px 0 0 var(--action); }
.cred-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.cred-row span { width: 120px; color: var(--ink-3); font-size: 13px; }
.cred-row code { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; user-select: all; }
.cred-actions { margin-top: 14px; }
.reset-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.reset-card { width: 100%; max-width: 440px; background: var(--paper); border-radius: 18px; padding: 28px 24px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5); }
.reset-brand { padding: 0 0 18px; color: var(--ink); }
.reset-card h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.015em; }
.reset-card h2 + .ur { margin: 2px 0 14px; color: var(--ink-2); font-size: 17px; text-align: left; }
.reset-card p.ur { text-align: right; }
.reset-card .who { color: var(--ink-2); font-weight: 600; margin: 0 0 16px; }
.reset-card .btn { width: 100%; height: 46px; }
.reset-card .field b.ur { font-weight: 600; }
.reset-card .done { width: 56px; height: 56px; border-radius: 50%; background: var(--action-tint); color: var(--action); display: grid; place-items: center; margin-bottom: 14px; }
.reset-card .done svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.login-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn.danger-solid { background: var(--red); color: #fff; }
.btn.danger-solid:hover { background: #A8352F; }

.reset-card.install { max-width: 560px; }
.reset-card .req { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 12px; font-size: 13px; }
.reset-card .req .pill { min-width: 38px; justify-content: center; }
.reset-card details.data .stack { margin-top: 10px; }

.reset-page.legal { place-items: start center; }
.reset-card.legal-card { max-width: 760px; }
.legal-card p, .legal-card li { line-height: 1.65; }
.legal-card hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0 8px; }
.legal-card .ur { text-align: right; font-size: 15px; }
.legal-card .ur-title { text-align: right; }

.demo-bar { margin: -6px 0 18px; padding: 10px 14px; border-radius: 10px; background: var(--orange); color: #3B2600; font-size: 13.5px; }
.demo-bar a { color: #3B2600; font-weight: 700; text-decoration: underline; margin-left: 6px; }
.demo-switch h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.demo-switch.is-on { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.demo-switch .row .btn { flex: none; }

.demo-toggle { flex: none; }
.demo-toggle .switch { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font: 600 12.5px var(--font); cursor: pointer; }
.demo-toggle .knob { width: 34px; height: 22px; border-radius: 999px; background: #CBD5DB; position: relative; transition: background .15s; }
.demo-toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.demo-toggle .switch.on { border-color: var(--orange); background: var(--orange-tint); color: var(--orange-ink); }
.demo-toggle .switch.on .knob { background: var(--orange); }
.demo-toggle .switch.on .knob::after { transform: translateX(12px); }
@media (max-width: 900px) { .demo-toggle .lbl { display: none; } .demo-toggle .switch { padding: 0 5px; } }
