/* KwikDrop portals (admin, vendor, business)
   Brand colours come from Admin > Branding and are printed as CSS variables by the layout. */

:root {
  --paper: #F4F6F8;
  --surface: #FFFFFF;
  --ink: #16202A;
  --ink-2: #44525F;
  --ink-3: #75828F;
  --line: #DCE2E7;
  --line-soft: #EBEFF2;
  --surface-2: #FAFBFC;
  --brand: #0E7C66;
  --brand-contrast: #FFFFFF;
  --accent: #F2B632;
  --accent-contrast: #16202A;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, var(--surface));
  --brand-ink: color-mix(in srgb, var(--brand) 78%, black);
  --info: #2563A8;
  --info-soft: #E8F0FA;
  --attention: #C98A0B;
  --attention-soft: #FDF4E2;
  --attention-ink: #7A5200;
  --good: #1E7A3C;
  --good-soft: #E6F4EA;
  --bad: #B4371F;
  --bad-soft: #FBEAE6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(22, 32, 42, .05);
  --shadow-pop: 0 12px 32px rgba(22, 32, 42, .16);
  --sidebar-w: 252px;
  --topbar-h: 60px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dark mode: set by the theme toggle (saved per browser) or the device setting */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0D1318;
  --surface: #151D24;
  --surface-2: #1A232B;
  --ink: #E7EDF2;
  --ink-2: #B5C1CC;
  --ink-3: #8595A4;
  --line: #2A3541;
  --line-soft: #212B35;
  --brand-soft: color-mix(in srgb, var(--brand) 24%, #151D24);
  --brand-ink: color-mix(in srgb, var(--brand) 50%, white);
  --info: #86B8EE;
  --info-soft: #14263A;
  --attention-soft: #2F2611;
  --attention-ink: #F3C76E;
  --good: #63CF8A;
  --good-soft: #13291C;
  --bad: #F28E79;
  --bad-soft: #351B16;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] img.logo-img, :root[data-theme="dark"] .brand img { background: #fff; }
:root[data-theme="dark"] .bars .bar.is-zero { background: var(--line); }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator, :root[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.8); }
html { transition: background-color .2s; }
.theme-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; }
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
img { max-width: 100%; }
.num, td.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-lg { width: 22px; height: 22px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- App shell: sidebar + top bar + content ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .18s ease; }
.app.is-collapsed { --sidebar-w: 74px; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden auto;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-soft); flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; flex: none; }
.brand-text { min-width: 0; }
.brand strong { display: block; font-size: 16.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; white-space: nowrap; }

.nav { padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.nav-group:first-child { margin-top: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.nav-item .icon { color: var(--ink-3); }
.nav-item:hover { background: var(--line-soft); color: var(--ink); }
.nav-item:hover .icon { color: var(--ink-2); }
.nav-item.is-current { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav-item.is-current .icon { color: var(--brand); }
.nav-item.is-current::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.badge { min-width: 22px; padding: 1px 7px; border-radius: 99px; font-size: 12px; font-weight: 650; text-align: center; background: var(--accent); color: var(--accent-contrast); font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; padding: 12px 22px 16px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* Collapsed (desktop): icons only, labels as tooltips */
.app.is-collapsed .sidebar .brand { padding: 0; justify-content: center; }
.app.is-collapsed .brand-text,
.app.is-collapsed .nav-label,
.app.is-collapsed .nav-group,
.app.is-collapsed .sidebar-foot .version-text { display: none; }
.app.is-collapsed .nav { padding: 10px 10px 16px; }
.app.is-collapsed .nav-item { justify-content: center; padding: 10px; }
.app.is-collapsed .nav-item.is-current::before { left: -10px; }
.app.is-collapsed .nav-item .badge { position: absolute; top: 2px; right: 2px; min-width: 18px; padding: 0 5px; font-size: 10.5px; }
.app.is-collapsed .nav-group + .nav-item, .app.is-collapsed .nav-sep { margin-top: 10px; border-top: 1px solid var(--line-soft); }
.app.is-collapsed .sidebar-foot { padding: 12px 0 16px; text-align: center; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: none; color: var(--ink-2); cursor: pointer; flex: none; position: relative; text-decoration: none;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn .dot-count { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.menu-btn { display: none; }
.topbar-title { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.topbar-search { flex: 1; max-width: 420px; position: relative; margin-left: 6px; }
.topbar-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.topbar-search input[type=search] { padding-left: 36px; background: var(--paper); border-color: var(--line-soft); min-height: 38px; }
.topbar-spacer { flex: 1; }
.city-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Profile menu */
.profile { position: relative; }
.profile > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 99px; cursor: pointer; }
.profile > summary::-webkit-details-marker { display: none; }
.profile > summary:hover { background: var(--line-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-contrast); font-weight: 700; font-size: 13.5px; flex: none; letter-spacing: .02em; }
.profile-text { line-height: 1.2; text-align: left; }
.profile-name { display: block; font-weight: 600; font-size: 14px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-role { display: block; font-size: 12px; color: var(--ink-3); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 250px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px;
}
.profile-menu .menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.profile-menu .menu-head strong { display: block; }
.menu-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-item .icon { color: var(--ink-3); }
.menu-item:hover { background: var(--line-soft); color: var(--ink); }
.menu-item.is-danger { color: var(--bad); }
.menu-item.is-danger .icon { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }

.content { padding: 26px 30px 64px; width: 100%; max-width: 1400px; }
.overlay { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 4px; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand-ink); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; }
.flash .icon { margin-top: 2px; }
.flash-success { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, var(--surface)); color: var(--good); }
.flash-error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, var(--surface)); color: var(--bad); }
.flash-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, var(--surface)); color: var(--info); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel, .panel + .grid, .grid + .panel, .grid + .grid { margin-top: 20px; }
.grid > .panel + .panel, .grid > * + .panel { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.panel-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.panel-body { padding: 16px 18px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-attention { border-color: color-mix(in srgb, var(--attention) 45%, var(--surface)); }
.panel-attention .panel-head { background: var(--attention-soft); border-radius: var(--radius) var(--radius) 0 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack > * + * { margin-top: 20px; }

/* ---------- Stat cards ---------- */
.today { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.today > div { padding: 16px 18px; border-left: 1px solid var(--line-soft); }
.today > div:first-child { border-left: 0; }
.today dt { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.today dd { margin: 4px 0 0; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.today dd small { font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line-soft); }
.checklist li:first-child { border-top: 0; }
.checklist .count { font-weight: 650; font-variant-numeric: tabular-nums; }
.checklist .count.is-hot { color: var(--attention-ink); }

.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 140px; padding: 16px 18px 0; }
.bars .bar { background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars .bar.is-zero { background: var(--line); }
.bars-axis { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; padding: 6px 18px 14px; font-size: 11px; color: var(--ink-3); text-align: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
thead th { border-top: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
td.right, th.right { text-align: right; }
td .sub { display: block; font-size: 13px; color: var(--ink-3); }
.code { font-weight: 650; letter-spacing: 0.01em; }
tr.is-link { cursor: pointer; }
.empty { padding: 36px 18px; text-align: center; color: var(--ink-3); }
.empty .icon { width: 32px; height: 32px; display: block; margin: 0 auto 8px; color: var(--line); }

/* ---------- Pills ---------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill-muted { background: var(--line-soft); color: var(--ink-2); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-attention { background: var(--attention-soft); color: var(--attention-ink); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Route strip: a delivery's seven stops ---------- */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); position: relative; }
.route .stop { position: relative; display: flex; flex-direction: column; align-items: center; }
.route .stop::before { content: ""; position: absolute; top: calc(var(--dot) / 2 - 1px); left: -50%; width: 100%; height: 2px; background: var(--line); }
.route .stop:first-child::before { display: none; }
.route .stop-past::before, .route .stop-now::before { background: var(--brand); }
.route .dot { width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--surface); border: 2px solid var(--line); position: relative; z-index: 1; }
.route .stop-past .dot { background: var(--brand); border-color: var(--brand); }
.route .stop-now .dot { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.route-done .stop-now .dot { background: var(--good); border-color: var(--good); box-shadow: none; }
.route-done .stop::before { background: var(--good); }
.route-stopped .stop-past::before, .route-stopped .stop-now::before { background: var(--ink-3); }
.route-stopped .stop-past .dot { background: var(--ink-3); border-color: var(--ink-3); }
.route-stopped .stop-now .dot { border-color: var(--bad); background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.route-sm { --dot: 9px; width: 132px; }
.route-lg { --dot: 16px; padding: 4px 0; }
.route-lg .stop-label { margin-top: 8px; font-size: 13px; font-weight: 600; text-align: center; color: var(--ink-2); }
.route-lg .stop-next .stop-label { color: var(--ink-3); font-weight: 400; }
.route-lg .stop-time { font-size: 12px; color: var(--ink-3); min-height: 18px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .route-lg:not(.route-done):not(.route-stopped) .stop-now .dot { animation: pulse 2s ease-in-out infinite; }
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px var(--brand-soft); } }

/* ---------- Forms & buttons ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
input:not([type]), input[type=text], input[type=datetime-local], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 40px;
}
input[type=file] { padding: 7px; }
input[type=color] { width: 52px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 72px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  padding: 10px 15px; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--brand); color: var(--brand-contrast);
}
.btn .icon { width: 16px; height: 16px; vertical-align: 0; }
.btn:hover { background: color-mix(in srgb, var(--brand) 85%, black); color: var(--brand-contrast); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 85%, black); color: var(--accent-contrast); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: var(--line-soft); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--surface)); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-small { padding: 7px 11px; min-height: 32px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.filters .field { margin: 0; }
.filters input[type=search] { min-width: 260px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1; min-width: 140px; }

.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 10px 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.is-current { color: var(--ink); border-bottom-color: var(--brand); }
.tab-count { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }

.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line-soft); font-size: 14px; flex-wrap: wrap; }
.pager .pager-count { margin-right: auto; }
.pager-count { color: var(--ink-3); font-size: 13px; padding: 12px 18px; margin: 0; border-top: 1px solid var(--line-soft); }

/* ---------- Detail lists ---------- */
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.facts dt { color: var(--ink-3); font-size: 14px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stops { display: grid; gap: 16px; }
.stop-card { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.stop-card .mark { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand); margin-top: 4px; }
.stop-card.dropoff .mark { background: var(--brand); }
.stop-card h3 { margin-bottom: 2px; }
.breakdown { width: 100%; }
.breakdown td { padding: 6px 0; border: 0; }
.breakdown tr.total td { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 650; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--line-soft); }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.code-box { display: inline-block; font-size: 22px; font-weight: 700; letter-spacing: 0.2em; padding: 4px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.doc { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.doc .actions { display: flex; gap: 6px; margin-top: 10px; }
details.action { border-top: 1px solid var(--line-soft); }
details.action summary { padding: 12px 18px; cursor: pointer; font-weight: 600; list-style: none; }
details.action summary::-webkit-details-marker { display: none; }
details.action summary::after { content: "+"; float: right; color: var(--ink-3); }
details.action[open] summary::after { content: "–"; }
details.action .panel-body { padding-top: 0; }

/* Permission checkboxes (roles) */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.perm-group { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.perm-group h3 { font-size: 13.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.perm-group .check { font-size: 14px; margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; background: var(--line-soft); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }

/* Branding */
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); vertical-align: -4px; }
.brand-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.brand-preview .bp-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; }
.brand-preview .bp-bar img { width: 30px; height: 30px; border-radius: 6px; background: #fff; object-fit: contain; }
.brand-preview .bp-body { padding: 16px 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; background: var(--line-soft); display: block; flex: none; }
.thumb-lg { width: 96px; height: 96px; }
.thumb-placeholder { display: grid; place-items: center; color: var(--ink-3); }

/* API reference */
.endpoint { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line-soft); }
.endpoint:first-child { border-top: 0; }
.verb { font-size: 12px; font-weight: 700; padding: 3px 0; border-radius: 4px; text-align: center; align-self: start; }
.verb-GET { background: var(--info-soft); color: var(--info); }
.verb-POST { background: var(--good-soft); color: var(--good); }
.verb-PUT { background: var(--attention-soft); color: var(--attention-ink); }
.verb-DELETE { background: var(--bad-soft); color: var(--bad); }
.endpoint code { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.endpoint p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-line; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: #0B1116; color: #E6EDF3; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 0; }

/* Single-card pages (login, installer, update) */
.solo { max-width: 440px; margin: 0 auto; padding: 48px 16px; }
.solo .brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding-bottom: 24px; text-decoration: none; color: var(--ink); }
.solo .brand strong { font-size: 19px; }
.auth-page { min-height: 100vh; background: linear-gradient(160deg, var(--brand-soft), var(--paper) 55%); }

/* ---------- Responsive ---------- */
.panel-body .grid + .grid { margin-top: 0; }
@media (max-width: 1200px) {
  .grid-main, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today { grid-template-columns: repeat(2, 1fr); }
  .today > div:nth-child(3) { border-left: 0; }
  .today > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

/* Tablet and phone: the sidebar becomes a drawer opened from the menu button */
@media (max-width: 960px) {
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); --sidebar-w: 280px; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; height: auto; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .app.is-collapsed .brand-text, .app.is-collapsed .nav-label, .app.is-collapsed .nav-group, .app.is-collapsed .sidebar-foot .version-text { display: revert; }
  .app.is-collapsed .nav-label { display: block; }
  .app.is-collapsed .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .app.is-collapsed .nav-item .badge { position: static; }
  .app.is-collapsed .sidebar .brand { padding: 0 18px; justify-content: flex-start; }
  .overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(22, 32, 42, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.nav-open .overlay { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .collapse-btn { display: none; }
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar-search { max-width: none; }
  .profile-text { display: none; }
  .profile > summary { padding: 3px; }
  .content { padding: 18px 16px 56px; }
  .grid-2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 110px 1fr; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  .filters .field { flex: 1 1 160px; }
  .route-lg .stop-label { font-size: 11px; }
}

/* Phone: tables turn into stacked cards (each cell shows its column name) */
@media (max-width: 720px) {
  h1 { font-size: 21px; }
  .topbar-search { display: none; }
  .topbar-title { display: block; flex: 1; }
  .city-chip { display: none; }
  .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .table-wrap { overflow: visible; }
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 10px 16px; border-top: 1px solid var(--line-soft); }
  table.cards tbody tr:first-child { border-top: 0; }
  table.cards td { border: 0; padding: 5px 0 5px 40%; position: relative; text-align: left; overflow-wrap: anywhere; min-height: 28px; }
  table.cards td::before { content: attr(data-label); position: absolute; left: 0; top: 6px; width: calc(40% - 12px); font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
  table.cards td:not([data-label])::before, table.cards td[data-label=""]::before { display: none; }
  table.cards td:not([data-label]), table.cards td[data-label=""] { padding-left: 0; }
  table.cards td.right { text-align: left; }
  table.cards td:empty { display: none; }
  table.cards td .route-sm { width: 100%; max-width: 220px; }
  .pager { justify-content: space-between; }
  .pager .pager-count { width: 100%; padding: 0; border: 0; }
  .endpoint { grid-template-columns: 1fr; gap: 4px; }
  .verb { justify-self: start; padding: 3px 8px; }
}
@media (max-width: 520px) {
  .route-lg .stop:not(.stop-now) .stop-label, .route-lg .stop:not(.stop-now) .stop-time { visibility: hidden; }
  .route-lg .stop-now .stop-label { white-space: nowrap; }
  .route-lg .stop:first-child.stop-now .stop-label { align-self: flex-start; }
  .route-lg .stop:last-child.stop-now .stop-label { align-self: flex-end; }
  .today dd { font-size: 22px; }
  .profile-menu { position: fixed; right: 10px; left: 10px; top: calc(var(--topbar-h) + 4px); width: auto; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .overlay, .app { transition: none; } }

/* Location picker (shop sign-up, booking) */
.picker-map { height: 280px; border-radius: var(--radius-sm); border: 1px solid var(--line); z-index: 0; }
.kd-locate { width: 36px; height: 36px; display: grid; place-items: center; background: var(--surface); border: 2px solid rgba(0,0,0,.2); border-radius: 6px; cursor: pointer; color: var(--ink); }
.kd-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 1000; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); }
.kd-suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.kd-suggest li:hover { background: var(--line-soft); }
.kd-suggest strong { display: block; font-size: 14px; }
.kd-suggest span { display: block; font-size: 12.5px; color: var(--ink-3); }

/* Shop portal: order cards */
.order-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.order-card.is-new { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.order-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-card ul { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.order-card li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.order-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--good); }
.switch input:checked::after { transform: translateX(18px); }


/* ---------- v0.0.4: dashboard filter and stat cards ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; margin-bottom: 18px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line-soft); }
.seg button { font: inherit; font-size: 13.5px; font-weight: 550; border: 0; background: none; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); background: var(--surface); }
.seg button.is-current { background: var(--surface); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(22, 32, 42, .12); }
.filter-dates { display: flex; align-items: center; gap: 8px; }
.filter-dates input { width: auto; min-height: 36px; padding: 6px 9px; font-size: 14px; }
.filter-city { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ink-3); }
.filter-city select { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat dt { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.stat dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat dd small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.stat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.stat-icon .icon { width: 17px; height: 17px; }
.stat-icon.is-good { background: var(--good-soft); color: var(--good); }
.stat-icon.is-info { background: var(--info-soft); color: var(--info); }
.stat-icon.is-bad { background: var(--bad-soft); color: var(--bad); }
.stat-icon.is-accent { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.delta.is-up { color: var(--good); }
.delta.is-down { color: var(--bad); }
.chart-wrap { padding-bottom: 4px; }
.bars .bar { transition: height .4s ease; }
.bars .bar.is-in { background: var(--brand); }
.bars .bar-tip { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink-2); opacity: 0; transition: opacity .15s; pointer-events: none; }
.bars .bar:hover .bar-tip { opacity: 1; }
.bars .bar:hover { filter: brightness(1.1); }
.meter { margin: 0 0 12px; }
.meter-label { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.meter-track { height: 7px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter-fill.tone-good { background: var(--good); } .meter-fill.tone-bad { background: var(--bad); } .meter-fill.tone-info { background: var(--info); }
.meter-fill.tone-attention { background: var(--attention); } .meter-fill.tone-muted { background: var(--ink-3); }
.page-head .actions .btn-quiet { min-height: 38px; }
@media (max-width: 1200px) { .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .filter-bar { padding: 10px; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .filter-dates, .filter-city { width: 100%; margin-left: 0; }
  .filter-dates input, .filter-city select { flex: 1; }
  .stat-cards { gap: 10px; }
  .stat { padding: 12px; }
  .stat dd { font-size: 19px; }
  .stat dt { gap: 7px; font-size: 12px; }
  .stat-icon { width: 26px; height: 26px; }
}

/* ---------- Sign-in pages ---------- */
body.auth2 { background: var(--paper); min-height: 100vh; }
.auth2-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth2-art { position: relative; overflow: hidden; color: var(--brand-contrast); background: linear-gradient(150deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 62%, black) 100%); display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth2-art .blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .45; animation: kdFloat 14s ease-in-out infinite; }
.auth2-art .b1 { width: 420px; height: 420px; right: -120px; top: -120px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%); }
.auth2-art .b2 { width: 320px; height: 320px; left: -100px; bottom: -80px; background: radial-gradient(circle, rgba(255,255,255,.35), transparent 70%); animation-delay: -5s; }
.auth2-art .b3 { width: 180px; height: 180px; left: 40%; top: 18%; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%); animation-delay: -9s; }
@keyframes kdFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(24px, -18px) scale(1.06); } 66% { transform: translate(-16px, 14px) scale(.96); } }
.auth2-art-inner { position: relative; z-index: 1; max-width: 460px; width: 100%; }
.auth2-brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -.01em; }
.auth2-brand img { width: 46px; height: 46px; border-radius: 12px; background: #fff; object-fit: contain; padding: 3px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.auth2-brand small { display: block; font-size: 13px; font-weight: 500; opacity: .8; letter-spacing: 0; }
.auth2-route { display: block; width: 100%; height: auto; margin: 34px 0 20px; color: #fff; }
.auth2-art h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -.02em; margin-bottom: 12px; animation: kdUp .7s ease both; }
.auth2-art p { opacity: .88; font-size: 16px; max-width: 420px; animation: kdUp .7s .1s ease both; }
.auth2-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.auth2-art li { display: flex; align-items: center; gap: 12px; font-weight: 600; animation: kdUp .6s ease both; }
.auth2-art li span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); }
@keyframes kdUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth2-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px; position: relative; }
.auth2-top { position: absolute; top: 16px; left: 20px; right: 16px; display: flex; justify-content: space-between; align-items: center; }
.auth2-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-3); text-decoration: none; }
.auth2-back:hover { color: var(--ink); }
.auth2-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px; box-shadow: 0 24px 60px rgba(22,32,42,.10); animation: kdUp .6s ease both; }
.auth2-card h1 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 6px; }
.auth2-card .lead { color: var(--ink-3); margin-bottom: 22px; }
.auth2-brand-sm { display: none; color: var(--ink); font-size: 19px; margin-bottom: 22px; }
.auth2-brand-sm img { width: 38px; height: 38px; box-shadow: none; border: 1px solid var(--line); }
.auth2-foot { font-size: 12.5px; color: var(--ink-3); margin: 22px 0 0; }
.auth2-foot a { color: var(--ink-3); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; transition: color .15s; }
.input-icon input { padding-left: 42px; min-height: 48px; border-radius: 12px; font-size: 15.5px; background: var(--surface-2); }
.input-icon input:focus { background: var(--surface); }
.input-icon:focus-within > .icon { color: var(--brand); }
.input-icon .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--ink-3); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.input-icon .pw-toggle:hover { background: var(--line-soft); color: var(--ink); }
.input-icon .pw-toggle .icon-hide, .input-icon .pw-toggle.is-on .icon-show { display: none; }
.input-icon .pw-toggle.is-on .icon-hide { display: inline; }
.input-icon input[type=password], .input-icon input.has-toggle { padding-right: 48px; }
.btn-lg { min-height: 50px; border-radius: 12px; font-size: 15.5px; }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--brand-contrast); border-right-color: transparent; animation: kdSpin .7s linear infinite; }
@keyframes kdSpin { to { transform: rotate(360deg); } }
.auth2-alt { text-align: center; font-size: 14px; color: var(--ink-3); margin: 18px 0 0; }
.auth2-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; margin: 20px 0 14px; }
.auth2-divider::before, .auth2-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.portal-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.portal-links a { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.portal-links a:hover { border-color: var(--brand); color: var(--brand-ink); }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-boxes input { text-align: center; font-size: 22px; font-weight: 700; min-height: 54px; padding: 0; border-radius: 12px; background: var(--surface-2); }
.prefix-input { display: flex; }
.prefix-input .prefix { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.prefix-input input { border-radius: 0 12px 12px 0; min-height: 48px; font-size: 16px; }
@media (max-width: 900px) {
  .auth2-grid { grid-template-columns: 1fr; }
  .auth2-art { display: none; }
  .auth2-brand-sm { display: inline-flex; }
  .auth2-main { justify-content: flex-start; padding-top: 72px; background: linear-gradient(180deg, var(--brand-soft), var(--paper) 340px); }
  .auth2-card { padding: 26px 22px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .auth2-art .blob, .auth2-art h2, .auth2-art p, .auth2-art li, .auth2-card { animation: none; } }

/* ---------- CMS ---------- */
.cms-group > summary { cursor: pointer; list-style: none; }
.cms-group > summary::-webkit-details-marker { display: none; }
.cms-group[open] > summary .icon { transform: rotate(180deg); }
.cms-group:not([open]) > summary { border-bottom: 0; }
.cms-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.cms-fields .is-wide, .cms-fields .switch { grid-column: 1 / -1; }
.sticky-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.prose { line-height: 1.65; }
.prose h2 { font-size: 22px; margin: 22px 0 10px; } .prose h3 { font-size: 18px; margin: 18px 0 8px; } .prose h4 { font-size: 16px; margin: 16px 0 6px; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; } .prose li { margin: 4px 0; }
@media (max-width: 720px) { .cms-fields { grid-template-columns: 1fr; } }

/* ---------- Promotions ---------- */
.promo-preview { position: relative; min-height: 130px; border-radius: 14px; padding: 18px; color: #fff; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; overflow: hidden; }
.promo-preview::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.05)); }
.promo-preview > * { position: relative; }
.promo-preview strong { font-size: 18px; } .promo-preview span { font-size: 13.5px; opacity: .9; }
.promo-preview em { font-style: normal; align-self: flex-start; margin-top: 6px; background: var(--accent); color: var(--accent-contrast); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 99px; }
input[type=datetime-local] { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 40px; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-box { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); min-height: 280px; max-height: 60vh; scroll-behavior: smooth; }
.chat-empty { margin: auto; text-align: center; color: var(--ink-3); font-size: 14px; }
.chat-empty .icon { width: 30px; height: 30px; display: block; margin: 0 auto 6px; opacity: .6; }
.chat-day { align-self: center; font-size: 11.5px; font-weight: 600; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line-soft); padding: 2px 10px; border-radius: 99px; margin: 6px 0; }
.msg { display: flex; flex-direction: column; max-width: 78%; animation: kdUp .25s ease both; }
.msg.is-mine { align-self: flex-end; align-items: flex-end; }
.msg.is-theirs { align-self: flex-start; }
.msg.is-system { align-self: center; max-width: 90%; }
.msg-who { font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin: 0 6px 3px; }
.msg-bubble { padding: 9px 13px; border-radius: 16px; line-height: 1.45; overflow-wrap: anywhere; font-size: 14.5px; }
.msg.is-theirs .msg-bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.is-mine .msg-bubble { background: var(--brand); color: var(--brand-contrast); border-bottom-right-radius: 5px; }
.msg.is-internal .msg-bubble { background: var(--attention-soft); color: var(--attention-ink); border: 1px dashed var(--attention); }
.msg.is-system .msg-bubble { background: none; color: var(--ink-3); font-size: 12.5px; text-align: center; padding: 2px; }
.msg-time { font-size: 11px; color: var(--ink-3); margin: 3px 6px 0; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line-soft); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.chat-form textarea { min-height: 44px; max-height: 160px; resize: none; border-radius: 22px; padding: 11px 16px; line-height: 1.4; }
.chat-form .btn { border-radius: 50%; width: 44px; height: 44px; min-height: 44px; padding: 0; flex: none; }
.chat-form .chat-extra { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.chat-closed { padding: 14px; text-align: center; color: var(--ink-3); font-size: 14px; border-top: 1px solid var(--line-soft); }
.inbox-row { display: flex; gap: 12px; align-items: flex-start; }
.inbox-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.inbox-avatar.is-rider { background: var(--info-soft); color: var(--info); }
.inbox-avatar.is-vendor { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.unread-dot { display: inline-block; min-width: 20px; padding: 0 6px; height: 20px; line-height: 20px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; }
tr.is-unread td { font-weight: 600; }
.view-as-bar { align-items: center; } .view-as-bar span { flex: 1; }

/* ---------- Rider web portal ---------- */
body.rapp { background: var(--paper); min-height: 100vh; padding-bottom: 76px; }
.rapp-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.rapp-top img { width: 36px; height: 36px; border-radius: 9px; background: #fff; }
.rapp-who { flex: 1; min-width: 0; line-height: 1.2; }
.rapp-who strong { display: block; } .rapp-who span { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rapp-main { max-width: 620px; margin: 0 auto; padding: 14px; }
.rapp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.rapp-card h3 { margin-bottom: 8px; }
.rapp-offer { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); animation: kdUp .3s ease both; }
.rapp-offer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rapp-offer-head strong { font-size: 22px; }
.rapp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.rapp-actions .btn { min-height: 46px; }
.rapp-map { height: 210px; border-radius: 12px; margin: 6px 0 12px; z-index: 0; }
.rapp-empty { text-align: center; color: var(--ink-3); padding: 50px 20px; }
.rapp-empty .icon { width: 42px; height: 42px; color: var(--brand); }
.rapp-empty h2 { margin: 10px 0 4px; color: var(--ink); }
.rapp-balance { text-align: center; } .rapp-balance span { color: var(--ink-3); } .rapp-balance strong { display: block; font-size: 34px; letter-spacing: -.02em; margin: 4px 0; } .rapp-balance small { color: var(--ink-3); }
.rapp-list { list-style: none; margin: 0; padding: 0; }
.rapp-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.rapp-list li:first-child { border-top: 0; }
.rapp-list small { display: block; color: var(--ink-3); font-size: 12px; }
.rapp-list .pos { color: var(--good); } .rapp-list .neg { color: var(--bad); }
.rapp-chat summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-weight: 800; }
.rapp-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.rapp-nav button { border: 0; background: none; padding: 10px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-3); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.rapp-nav button.is-current { color: var(--brand); }

/* ---- v0.0.5: approvals, CRUD forms ---------------------------------------- */
.inline-actions { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.approval-panel { border-color: color-mix(in srgb, var(--attention, #b45309) 35%, var(--line)); }
.approval-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.danger-zone { border-color: color-mix(in srgb, var(--bad, #b91c1c) 30%, var(--line)); }
.danger-zone h2 { color: var(--bad, #b91c1c); }
.product-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.product-row:first-child { border-top: 0; }
.product-row img, .product-row .ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-2, #f3f4f6); display: grid; place-items: center; color: var(--ink-3); }
.product-row details { grid-column: 1 / -1; }
.product-row details > summary { cursor: pointer; color: var(--brand); font-size: 13px; }
.quote-list { display: grid; gap: 6px; margin: 8px 0 0; }
.quote-list div { display: flex; justify-content: space-between; font-size: 14px; }

/* v0.0.6: "Use my current location" */
.kd-here { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 8px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--brand-ink, var(--brand)); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.kd-here:hover { background: var(--brand-soft); }
.kd-here .icon { width: 16px; height: 16px; }
.picker-map.is-locating { opacity: .7; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label-row label { margin-bottom: 6px; }
details.new-account { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 16px; background: var(--surface); }
details.new-account summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
details.new-account[open] summary { margin-bottom: 12px; }

/* ---- Live tracking map (kd-track.js) ---------------------------------------------- */
.kd-track { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface, #fff); }
.kd-track-map { height: 340px; z-index: 0; }
@media (max-width: 640px) { .kd-track-map { height: 280px; } }
.kd-track-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--line-soft, var(--line)); min-height: 44px; }
.kd-track-info.is-stale { background: #FDF6E3; color: #7A5410; }
.kd-track-info.is-lost { background: #FDECEC; color: #8A1F1F; }
.kd-track-sep { margin: 0 8px; opacity: .45; }
.kd-track-flag { display: inline-block; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; background: currentColor; margin-right: 8px; }
.kd-track-flag { color: inherit; background: rgba(0,0,0,.08); }
.kd-rider-icon { position: relative; }
.kd-rider-dot { position: absolute; left: 5px; top: 5px; width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; }
.kd-rider-dot svg { transition: transform .6s ease; }
.kd-rider-pulse { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; opacity: .35; animation: kd-pulse 1.8s ease-out infinite; }
@keyframes kd-pulse { from { transform: scale(.6); opacity: .45; } to { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kd-rider-pulse { animation: none; } .kd-rider-dot svg { transition: none; } }
.kd-stop-icon { position: relative; }
.kd-stop-label { position: absolute; left: 50%; top: 0; transform: translateX(-50%); color: #fff; font: 700 11px/1 'Public Sans', system-ui, sans-serif; padding: 6px 9px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.25); white-space: nowrap; }
.kd-stop-pin { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 10px solid; }
.kd-track-recenter { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(0,0,0,.2); background: #fff; color: #1B2B26; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,.2); }
:root[data-theme="dark"] .kd-track-info.is-stale { background: #3A2E10; color: #F5D58A; }
:root[data-theme="dark"] .kd-track-info.is-lost { background: #3D1616; color: #F5A3A3; }
:root[data-theme="dark"] .kd-track-flag { background: rgba(255,255,255,.12); }

/* ---- Show / hide on every password field (pw.js) ---------------------------------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 50px !important; }
.pw-auto-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; background: none; color: var(--ink-3); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.pw-auto-toggle:hover { background: var(--line-soft); color: var(--ink); }
.pw-auto-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-auto-toggle .pw-i-hide, .pw-auto-toggle.is-on .pw-i-show { display: none; }
.pw-auto-toggle.is-on .pw-i-hide { display: inline; }

/* ---- Place search list (Admin > Cities) ------------------------------------------- */
.place-list { list-style: none; margin: 6px 0 0; padding: 4px; position: absolute; left: 16px; right: 16px; z-index: 1000; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 300px; overflow: auto; }
.place-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.place-list li span { font-size: 12.5px; color: var(--ink-3); }
.place-list li:hover, .place-list li:focus { background: var(--brand-soft); outline: none; }
.flash-warn { background: #FDF6E3; color: #7A5410; border: 1px solid #F0D9A0; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
:root[data-theme="dark"] .flash-warn { background: #3A2E10; color: #F5D58A; border-color: #5A4718; }

/* ---- Product editor (shop portal) --------------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile.is-new { outline: 2px dashed var(--brand); outline-offset: -2px; }
.photo-main { position: absolute; left: 6px; top: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.photo-remove { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 5px 8px; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; color: var(--ink-3); cursor: pointer; font-size: 13px; font-weight: 600; }
.photo-add:hover { border-color: var(--brand); color: var(--brand); }
.option-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 4px; margin-bottom: 12px; background: var(--surface-2); }
.option-row .form-row { grid-template-columns: 1fr 1fr auto; }
.option-row .opt-del { margin-bottom: 16px; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); }
.tag-input .tags { display: contents; }
.tag-input input.opt-new { flex: 1; min-width: 180px; border: 0; box-shadow: none; padding: 6px; background: transparent; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; border-radius: 99px; background: var(--brand-soft); font-size: 13px; font-weight: 600; }
.tag input[type=color] { width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 50%; overflow: hidden; cursor: pointer; background: none; }
.tag input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.tag input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.tag button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--ink-3); padding: 0 4px; }
.variant-table input[type=number], .variant-table input[type=text] { min-width: 80px; }
.variant-table .v-photo { white-space: nowrap; }
.variant-table .v-photo img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; vertical-align: middle; }
@media (max-width: 640px) { .option-row .form-row { grid-template-columns: 1fr; } }

/* ---- Admin > Product categories --------------------------------------------------- */
.cat-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.sub-row td { background: var(--surface-2); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); }
.icon-pick input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.icon-pick input:focus-visible + span { outline: 2px solid var(--brand); }

/* v0.2.0 orders: pickup, cash, coupon tags and the hand-over form */
.order-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.order-card .order-tags { margin: 0; }
.order-card .order-tags:empty { display: none; }
.order-tags .tag { padding: 4px 10px; font-weight: 600; }
.order-tags .tag-warn { background: var(--attention-soft, #fff4d6); color: var(--attention-ink, #7a5300); }
.variant-chip { display: inline-block; padding: 1px 8px; margin-left: 4px; border-radius: 99px; background: var(--bg, #f3f4f6); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2, inherit); }
.collect-panel { margin-bottom: 18px; border-color: var(--brand); }
.collect-panel form { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.collect-panel h2 { font-size: 17px; display: flex; gap: 8px; align-items: center; margin: 0 0 2px; }
.collect-panel p { margin: 0; }
.collect-row { display: flex; gap: 8px; }
.collect-row input { width: 120px; font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

.opt-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.opt-suggest #optSuggest { display: contents; }
.opt-suggest[hidden] { display: none; }

/* v0.3.0 Rides admin */
.mode-pick { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.choice-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice-line > span { display: flex; flex-direction: column; gap: 2px; }
.choice-line:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-line input { margin-top: 3px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
ul.checklist.panel-body li { justify-content: flex-start; padding: 8px 0; }
.driver-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.driver-card header, .incident header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.driver-card h3, .incident h3 { font-size: 16px; margin: 0 0 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.driver-card .facts { grid-template-columns: 120px 1fr; font-size: 14px; }
.doc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.doc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.doc-chip.is-approved { background: var(--good-soft); color: var(--good); border-color: transparent; }
.doc-chip.is-pending { background: var(--info-soft); color: var(--info); border-color: transparent; }
.doc-chip.is-rejected, .doc-chip.is-missing { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.driver-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.driver-actions input[type=text] { flex: 1 1 220px; min-width: 0; }
.incident.is-sos { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.incident.is-sos h3 { color: var(--bad); }
.btn.is-current { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
@media (max-width: 640px) { .driver-cards { grid-template-columns: 1fr; } }
.rides-top { align-items: start; }
ul.checklist.panel-body li { gap: 10px; align-items: flex-start; }
ul.checklist.panel-body li .icon { color: var(--brand); flex: none; margin-top: 2px; }
ul.checklist.panel-body { padding: 6px 18px 12px; }

/* ---- Bookings (shop portal) ------------------------------------------- */
:root { --bk-pending: #C98A0B; --bk-confirmed: #2563A8; --bk-active: #7C3AED; --bk-done: #1E7A3C; --bk-off: #8595A4; --bk-bad: #B4371F; }
tr[data-href]:hover td { background: var(--surface-2); }
tr.is-selected td { background: var(--brand-soft); }
.cell-with-thumb { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb-round { border-radius: 50%; }
.bk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.bk-toolbar .seg a { font-size: 13.5px; font-weight: 550; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; text-decoration: none; }
.bk-toolbar .seg a.is-current { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.bk-nav { display: flex; align-items: center; gap: 6px; }
.bk-nav strong { margin-left: 6px; white-space: nowrap; }
.bk-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-items: center; }
.bk-filters select, .bk-filters input { width: auto; min-width: 0; max-width: 220px; }
.bk-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); vertical-align: middle; }
.bk-pending_payment, .bk-pending_confirmation { --c: var(--bk-pending); }
.bk-confirmed { --c: var(--bk-confirmed); }
.bk-checked_in, .bk-in_progress { --c: var(--bk-active); }
.bk-completed { --c: var(--bk-done); }
.bk-cancelled { --c: var(--bk-off); }
.bk-no_show { --c: var(--bk-bad); }
.bk-chip { display: block; padding: 6px 8px; border-radius: 8px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); color: var(--ink); font-size: 13px; text-decoration: none; line-height: 1.3; margin-bottom: 6px; overflow: hidden; }
.bk-chip span { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-chip.bk-cancelled { text-decoration: line-through; opacity: .7; }
.bk-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bk-col { padding: 10px 8px; border-left: 1px solid var(--line-soft); min-height: 220px; min-width: 0; }
.bk-col:first-child { border-left: 0; }
.bk-col.is-today { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.bk-col-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; color: var(--ink-3); text-decoration: none; font-size: 13px; }
.bk-col-head strong { font-size: 18px; color: var(--ink); }
.bk-col.is-today .bk-col-head strong { color: var(--brand); }
.bk-none { color: var(--line); }
.bk-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bk-dow { padding: 8px 10px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line-soft); }
.bk-cell { min-height: 92px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bk-cell:nth-child(7n + 1) { border-left: 0; }
.bk-cell:hover { background: var(--surface-2); }
.bk-cell.is-other { color: var(--ink-3); background: var(--surface-2); }
.bk-cell.is-today .bk-num { background: var(--brand); color: var(--brand-contrast); border-radius: 99px; padding: 0 7px; align-self: flex-start; }
.bk-num { font-weight: 650; font-size: 14px; }
.bk-count { font-size: 12.5px; color: var(--ink-2); }
.bk-dots, .bk-legend { display: flex; flex-wrap: wrap; gap: 4px; }
.bk-dots i, .bk-legend i { width: 8px; height: 8px; border-radius: 99px; background: var(--c); display: inline-block; }
.bk-legend { gap: 6px 16px; padding: 12px 18px; border-top: 1px solid var(--line-soft); color: var(--ink-3); }
.bk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.slot { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot:hover { border-color: var(--brand); }
.slot.is-current { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; font-weight: 550; color: var(--ink-2); background: var(--surface); }
.chip-check input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.chip-check input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.bk-hours { display: flex; flex-direction: column; }
.bk-hours-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.bk-hours-row .bk-break, .bk-hours-row .bk-closed-label { grid-column: 2; }
.bk-hours-row .bk-closed-label { grid-row: 1; }
.bk-hours-row:first-child { border-top: 0; }
.bk-times { display: flex; align-items: center; gap: 6px; }
.bk-times input { width: 128px; padding: 6px 8px; }
.bk-break input { width: 110px; padding: 4px 6px; font-size: 13px; }
.bk-break .small { width: 40px; }
.bk-times span { color: var(--ink-3); font-size: 13px; }
.bk-closed-label { display: none; }
.bk-hours-row.is-closed .bk-times { display: none; }
.bk-hours-row.is-closed .bk-closed-label { display: block; }
.bk-day { margin: 0; }
.bk-off { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.bk-closure-form { display: grid; grid-template-columns: 1fr 1fr 1.5fr auto; gap: 12px; align-items: end; }
.bk-closure-form .field { margin-bottom: 0; }
.bk-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bk-bar { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; flex: 1; min-width: 60px; }
.bk-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
td .bk-bar { display: inline-block; width: 90px; vertical-align: middle; margin-right: 8px; }
.bk-bars { display: flex; flex-direction: column; gap: 8px; }
.bk-bars > div { display: grid; grid-template-columns: 48px 1fr 32px; align-items: center; gap: 10px; font-size: 13.5px; }
.bk-bars b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .bk-week { grid-template-columns: 1fr; }
  .bk-col { border-left: 0; border-top: 1px solid var(--line-soft); min-height: 0; display: grid; grid-template-columns: 64px 1fr; gap: 0 10px; }
  .bk-col-head { grid-row: span 20; flex-direction: column; gap: 0; }
  .bk-cell { min-height: 64px; padding: 6px; }
  .bk-count { display: none; }
  .bk-filters { margin-left: 0; width: 100%; }
  .bk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-hours-row { grid-template-columns: 1fr; gap: 6px; }
  .bk-hours-row .bk-break, .bk-hours-row .bk-closed-label { grid-column: 1; }
  .bk-hours-row .bk-closed-label { grid-row: auto; }
  .bk-closure-form { grid-template-columns: 1fr 1fr; }
}
.checklist .sub { display: block; font-size: 13px; }
.slot-grid > span { grid-column: 1 / -1; }
.bk-narrow .bk-hours-row { grid-template-columns: minmax(0, 1fr); }
.bk-narrow .bk-hours-row .bk-break, .bk-narrow .bk-hours-row .bk-closed-label { grid-column: 1; grid-row: auto; }
.bk-narrow .bk-times input { width: auto; flex: 1; min-width: 0; }
.alert-list li.is-new { background: var(--brand-soft); }

/* ---- Digital services, resellers ------------------------------------------ */
.badge-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: color-mix(in srgb, var(--b, var(--brand)) 80%, black); background: color-mix(in srgb, var(--b, var(--brand)) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--b, var(--brand)) 40%, var(--surface)); white-space: nowrap; vertical-align: middle; }
:root[data-theme="dark"] .badge-chip { color: color-mix(in srgb, var(--b, var(--brand)) 70%, white); }
.badge-chip .icon { width: 14px; height: 14px; }
.badge-chip-lg { font-size: 14px; padding: 6px 14px; }
.badge-chip-lg .icon { width: 17px; height: 17px; }
.net-dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; margin-right: 6px; vertical-align: middle; border: 1px solid rgba(0,0,0,.08); }
.net-edit summary { list-style: none; }
.net-edit summary::-webkit-details-marker { display: none; }
.net-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.net-form input[type=color] { width: 44px; padding: 2px; height: 36px; }
.net-form input[name=name] { width: 120px; }
.checklist li:has(.net-edit[open]) { flex-wrap: wrap; }
pre.json { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px; margin: 6px 0 0; max-height: 220px; overflow: auto; }
.price-grid td { vertical-align: middle; }
.price-grid th .sub { font-weight: 500; }
.pg-in { width: 96px; padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.pg-in.is-empty { background: var(--attention-soft); border-color: color-mix(in srgb, var(--attention) 35%, var(--surface)); }
.pg-in.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.pg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); position: sticky; bottom: 0; background: var(--surface); }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.input-prefix span { display: flex; align-items: center; padding: 0 8px; background: var(--surface-2); color: var(--ink-3); font-size: 13px; white-space: nowrap; border-right: 1px solid var(--line); }
.input-prefix input { border: 0; border-radius: 0; min-width: 0; flex: 1; }
.field-error { color: var(--bad); font-size: 13px; margin-top: 4px; }
.rs-share .panel-body { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rs-share .panel-body > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.rs-link { font-size: 16px; overflow-wrap: anywhere; }
.rs-share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-price { width: 110px; padding: 6px 8px; text-align: right; }
.price-grid th .sub { display: block; margin-top: 4px; font-size: 12px; white-space: nowrap; }
.price-grid td:first-child, .price-grid th:first-child { min-width: 190px; }
.rs-prices td:first-child { min-width: 160px; }
.share-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rs-share-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rs-share-row > div { display: flex; flex-direction: column; min-width: 0; }
.ad-packages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ad-pkg { position: relative; cursor: pointer; }
.ad-pkg input { position: absolute; opacity: 0; }
.ad-pkg > span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ad-pkg input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.ad-pkg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ad-pkg .num { font-weight: 650; }
.seg a { font-size: 13.5px; font-weight: 550; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; text-decoration: none; }
.seg a.is-current { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.day-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; align-items: end; height: 160px; }
.day-bar { height: 100%; display: flex; align-items: flex-end; }
.day-bar i { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.day-bar:hover i { background: var(--accent); }
.day-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.stat-icon.is-warn, .ov-ic.is-warn { background: var(--attention-soft); color: var(--attention); }
/* Dashboard: platform overview strip */
.overview-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: -6px 0 20px; }
.ov { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.ov:hover { border-color: var(--brand); }
.ov > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ov strong { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov small { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.ov-ic .icon { width: 16px; height: 16px; }
.ov-ic.is-good { background: var(--good-soft); color: var(--good); }
.ov-ic.is-bad { background: var(--bad-soft); color: var(--bad); }
.ov-ic.is-accent { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
td.is-neg { color: var(--bad); }
td.is-pos { color: var(--good); }
.big-num { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.prod-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.prod-cell img, .prod-ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--line-soft); display: grid; place-items: center; color: var(--ink-3); }
.prod-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.share-row > .small { color: var(--ink-3); }
@media (max-width: 760px) { .overview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ledger-top { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 16px; margin-bottom: 20px; align-items: start; }
@media (max-width: 1000px) { .ledger-top { grid-template-columns: 1fr; } }
.ledger-top > .panel { margin: 0; }
