/* Owner panel + super admin. Server-rendered, no build step. The accent is the client's own brand colour
   (set as --brand on <body>), everything else is a calm neutral system. */
:root {
  --brand: #0E5E7E;
  --bg: #F3F5F6;
  --surface: #FFFFFF;
  --surface-2: #F7F9FA;
  --ink: #15202A;
  --ink-2: #3D4B58;
  --muted: #66737F;
  --line: #E1E6EA;
  --line-2: #CBD3DA;
  --ok: #18794A; --ok-soft: #E3F3E9;
  --warn: #965500; --warn-soft: #FCEFD7; --warn-line: #EFC57D;
  --bad: #B42318; --bad-soft: #FCE8E6;
  --off: #5F6C78; --off-soft: #EDF0F2;
  --ext: #5D6A76;
  --radius: 14px;
  --radius-s: 10px;
  --head-h: 112px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1418; --surface: #151D23; --surface-2: #1A232A; --ink: #E5ECF1; --ink-2: #C0CBD4; --muted: #8F9EAB;
    --line: #25313A; --line-2: #34424D;
    --ok: #4CC38A; --ok-soft: #12291F; --warn: #F0A742; --warn-soft: #2E2312; --warn-line: #6A4C1C;
    --bad: #F47067; --bad-soft: #33181A; --off: #9AA8B4; --off-soft: #222C34; --ext: #6F7D89;
    color-scheme: dark;
  }
}

/* Derived from --brand where it is set (on <body>), so each client gets their own accent. */
body { --accent: var(--brand); --accent-ink: var(--brand); --accent-soft: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
@media (prefers-color-scheme: dark) {
  body { --accent-ink: color-mix(in srgb, var(--brand) 45%, #ffffff); --accent-soft: color-mix(in srgb, var(--brand) 26%, var(--surface)); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.wide, body.wide .wrap { max-width: 1240px; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; margin: 26px 0 16px; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 650; margin: 0 0 10px; }
h3 { font-size: 16px; font-weight: 650; margin: 0; }
code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--off-soft); padding: 1px 5px; border-radius: 5px; }
.mono, pre { font: 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { white-space: pre-wrap; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.right { text-align: right; }
.err { color: var(--bad); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }

/* ------------------------------------------------------------------ controls */
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 12px 0; }
.help { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 1px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 10px 12px; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); }
textarea { line-height: 1.45; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 0; display: inline-block; accent-color: var(--accent); flex-shrink: 0; }
input[type=color] { padding: 4px; height: 44px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 15px; color: var(--ink); min-height: 44px; margin: 6px 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset[disabled] input, fieldset[disabled] textarea { opacity: .75; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn .ico { width: 18px; height: 18px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.ok { color: #08130d; } }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--surface)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--off-soft); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 44px; padding: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px 10px; min-height: 44px; }
.card > .btn, form.card > .btn, .card .row .btn { margin-top: 12px; }
.hint { font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------------ chips */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; line-height: 1; padding: 6px 10px; border-radius: 999px; white-space: nowrap; background: var(--off-soft); color: var(--off); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--accent-soft); color: var(--accent-ink); }
.chip.info::before { display: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--off-soft); color: var(--off); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* ------------------------------------------------------------------ owner header + tabs */
.app-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.head-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.prop { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.mark { width: 40px; height: 40px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: .03em; flex-shrink: 0; }
.mark.big { width: 56px; height: 56px; border-radius: 15px; font-size: 20px; }
.prop-text { display: flex; flex-direction: column; min-width: 0; }
.prop-name { font-size: 17px; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-sub { font-size: 13px; color: var(--muted); }
.demo-tag { font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 4px 9px; border-radius: 999px; letter-spacing: .02em; }
.logout { margin-left: auto; }
.logout .btn { min-height: 44px; }
.head-row .demo-tag { margin-left: auto; }
.tabs-row { display: flex; gap: 2px; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 46px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a .ico { width: 18px; height: 18px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a[aria-current] .ico { color: var(--accent-ink); }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
@media (prefers-color-scheme: dark) { .tab-badge { color: #1b1405; } }
.demo-bar { background: var(--warn-soft); color: var(--ink-2); font-size: 14px; border-bottom: 1px solid var(--warn-line); }
.demo-bar .wrap { padding-top: 10px; padding-bottom: 10px; }
.demo-bar b { color: var(--ink); }
.demo-cta { border-top: 1px solid var(--line); background: var(--surface); }
.demo-cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 12px; padding-top: 8px; padding-bottom: 8px; color: var(--muted); font-size: 14.5px; text-align: center; }
.demo-cta a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--accent-ink); font-weight: 650; text-decoration: none; }
.demo-cta a .ico { width: 18px; height: 18px; }
.demo-cta a:hover { text-decoration: underline; text-underline-offset: 3px; }

main { padding-bottom: 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 28px 0 20px; }
.page-head h1 { margin: 0; }
.lede { margin: 4px 0 0; color: var(--muted); font-size: 15.5px; }
.lede::first-letter { text-transform: uppercase; }

/* ------------------------------------------------------------------ flash + attention */
.flash { padding: 12px 16px; border-radius: var(--radius-s); margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); }
header.top + main .flash, main > .flash:first-child { margin-top: 16px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 600; }
.flash.err { background: var(--bad-soft); color: var(--bad); border-color: transparent; font-weight: 600; }
.attention { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); text-decoration: none; margin-bottom: 16px; font-size: 16px; }
.attention .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent); flex-shrink: 0; }
.attention .go { margin-left: auto; font-weight: 650; color: var(--warn); }

/* ------------------------------------------------------------------ tiles + savings */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); text-decoration: none; min-width: 0; }
a.tile:hover { border-color: var(--line-2); }
.tile.warn { box-shadow: inset 4px 0 0 var(--warn); }
.tile-label { font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.tile-value { font-size: 32px; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: auto; }
.tile-sub { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.meter { display: block; height: 6px; border-radius: 999px; background: var(--off-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.savings { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 32px; background: var(--brand); color: #fff; border-radius: var(--radius); padding: 22px 26px; margin-bottom: 20px; }
.savings h2 { font-size: 15px; font-weight: 600; color: rgb(255 255 255 / .85); margin: 0 0 2px; }
.savings-value { display: block; font-size: 40px; font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.savings p { margin: 0; color: rgb(255 255 255 / .92); max-width: 62ch; font-size: 15.5px; }
.savings .note { color: rgb(255 255 255 / .72); white-space: nowrap; }

/* ------------------------------------------------------------------ panels + lists */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.panel-head .muted { font-size: 14px; }
.panel-head h2::first-letter { text-transform: uppercase; }
.head-link { font-size: 14.5px; font-weight: 600; }
.count { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--off-soft); color: var(--off); }
.count.warn { background: var(--warn-soft); color: var(--warn); }
.more { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 0 0; font-weight: 600; font-size: 15px; border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.cols > * { margin-bottom: 0; }
.cols:empty { display: none; }
.cols-agenda { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }

.lines { list-style: none; margin: 0; padding: 0; }
.line { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; padding-top: 4px; }
.line-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.line-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-main span { font-size: 14px; color: var(--muted); }
.line-end { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.line-end.muted { font-weight: 400; font-size: 13.5px; }
.line .chip { flex-shrink: 0; }
.day-badge { width: 46px; height: 50px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; flex-shrink: 0; }
.day-badge b { font-size: 19px; font-weight: 700; }
.day-badge small { font-size: 11.5px; font-weight: 650; }
.day-badge.is-today { background: var(--accent); color: #fff; }

.empty { display: flex; gap: 14px; align-items: flex-start; padding: 10px 2px 6px; color: var(--ink-2); font-size: 15px; }
.empty .ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--off-soft); color: var(--muted); }
.empty p { margin: 0; max-width: 52ch; }
.empty b { color: var(--ink); }

.steps ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; }
.steps li::before { content: counter(s); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.steps li a, .steps .step-title { font-weight: 650; }
.steps li > span:last-child { color: var(--muted); font-size: 14.5px; }

/* ------------------------------------------------------------------ request cards */
.req { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; }
.panel .req { border: 0; border-radius: 0; padding: 14px 0; margin: 0; }
.panel .req + .req { border-top: 1px solid var(--line); }
.panel .req:first-child { padding-top: 4px; }
.req-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.req-head h3 { font-size: 16.5px; min-width: 0; overflow-wrap: anywhere; }
.req-when { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 0 10px; }
.req-when b { font-weight: 600; }
.req-when span { color: var(--ink-2); }
.req-meta { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.req-meta a { overflow-wrap: anywhere; }
.req-meta .lang { font-weight: 700; color: var(--ink-2); background: var(--off-soft); padding: 0 6px; border-radius: 5px; }
.req-msg { margin: 10px 0 0; padding: 9px 12px; background: var(--surface-2); border-left: 3px solid var(--line-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--ink-2); white-space: pre-wrap; font-size: 15px; }
.req-foot { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.req-price { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.req-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.req-actions form { margin: 0; }
.msg { background: var(--surface-2); border-radius: var(--radius-s); padding: 9px 12px; margin: 8px 0; white-space: pre-wrap; }

/* ------------------------------------------------------------------ agenda */
.slots { list-style: none; margin: 0; padding: 0; }
.sub-head { font-size: 15px; margin: 16px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.slot { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.slot:first-child, .now-line + .slot { border-top: 0; }
.slot-time { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.15; }
.slot-time small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.slot-main { display: flex; flex-direction: column; min-width: 0; }
.slot-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-main span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.is-past { opacity: .55; }
.slot.is-now { background: var(--accent-soft); border-radius: var(--radius-s); padding: 10px 12px; margin: 0 -12px; border-top-color: transparent; }
.now-line { display: flex; align-items: center; gap: 8px; color: var(--bad); font-size: 12.5px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.now-line::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.now-line::after { content: ''; flex: 1; height: 2px; background: currentColor; border-radius: 2px; }
.now-line span { order: 0; }

/* ------------------------------------------------------------------ segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--off-soft); border-radius: 12px; margin-bottom: 16px; }
.seg a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.seg a::first-letter { text-transform: uppercase; }
.seg a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(16 24 32 / .1); }
.seg-n { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ------------------------------------------------------------------ stay calendar */
.cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-range { display: inline-block; font-size: 17px; font-weight: 650; padding: 0 6px; }
.cal-range::first-letter { text-transform: uppercase; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; margin-bottom: 16px; }
.cal-layout > .panel { margin-bottom: 0; }
.day-panel { position: sticky; top: calc(var(--head-h) + 16px); }
.day-panel h3 { font-size: 14px; color: var(--ink-2); margin: 14px 0 2px; }
.months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.month h2 { font-size: 16px; margin: 0 0 10px; }
.month h2::first-letter { text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 2px; }
.day { position: relative; min-height: 46px; aspect-ratio: 1 / .9; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.day:hover { border-color: var(--muted); }
.day .occ { font-size: 10.5px; font-weight: 600; opacity: .85; margin-top: 2px; }
.day.is-past { opacity: .5; }
.day.is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.day.is-selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); z-index: 1; }
.day.is-today.is-selected { box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.day.busy, .sw.busy { background: var(--accent); border-color: var(--accent); color: #fff; }
.day.hold, .sw.hold { background: var(--warn-soft); border: 1px dashed var(--warn); color: var(--warn); }
.day.ext, .sw.ext { background: var(--ext); border-color: var(--ext); color: #fff; }
.day.shut, .sw.shut, .sw.closed { background: repeating-linear-gradient(135deg, var(--off-soft) 0 5px, var(--line-2) 5px 7px); border-color: var(--line-2); color: var(--ink-2); }
.day.lvl1, .sw.lvl1 { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: transparent; }
.day.lvl2 { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); border-color: transparent; }
.day.lvl3, .sw.lvl3 { background: color-mix(in srgb, var(--accent) 38%, var(--surface)); border-color: transparent; }
.day.lvl4 { background: color-mix(in srgb, var(--accent) 78%, #000); border-color: transparent; color: #fff; }
.day.lvl5, .sw.lvl5 { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .day.lvl1, .sw.lvl1 { background: color-mix(in srgb, var(--accent-ink) 16%, var(--surface)); }
  .day.lvl2 { background: color-mix(in srgb, var(--accent-ink) 28%, var(--surface)); }
  .day.lvl3, .sw.lvl3 { background: color-mix(in srgb, var(--accent-ink) 42%, var(--surface)); }
  .day.lvl4 { background: color-mix(in srgb, var(--accent-ink) 58%, var(--surface)); color: #fff; }
  .day.lvl5, .sw.lvl5, .day.busy, .sw.busy { background: color-mix(in srgb, var(--accent-ink) 78%, var(--surface)); border-color: transparent; color: #0b1216; }
}
.day.has-hold::before { content: ''; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: 13.5px; color: var(--ink-2); align-items: center; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 7px; border: 1px solid transparent; }
.sw.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); vertical-align: 0; }
.sw.closed { border-radius: 4px; }

/* ------------------------------------------------------------------ appointment week */
.wk { display: grid; grid-template-columns: 54px repeat(var(--cols), minmax(0, 1fr)); padding: 0; overflow: hidden; }
.wk-col, .wk-hours { min-width: 0; }
.wk-col { border-left: 1px solid var(--line); }
.wk-day { height: 46px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 14px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.wk-day b { text-transform: capitalize; }
.wk-col.is-today .wk-day { color: var(--accent-ink); background: var(--accent-soft); }
.wk-body { position: relative; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--off-soft) 6px 7px); }
.wk-hours .wk-body { background: var(--surface); }
.wk-hours .wk-body span { position: absolute; right: 8px; font-size: 12px; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.wk-hours .wk-body span:first-child { transform: none; }
.wk-col .wk-body::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour, 66px); pointer-events: none; z-index: 1; }
.wk-open { position: absolute; left: 0; right: 0; background: var(--surface); }
.wk-ev { position: absolute; left: 4px; right: 4px; z-index: 2; border-radius: 7px; padding: 3px 7px; font-size: 12.5px; line-height: 1.25; overflow: hidden; background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--ink); }
.wk-ev b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.wk-ev span { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev.pending { background: var(--warn-soft); border-left-color: var(--warn); }
.wk-ev.is-past { opacity: .6; }
.wk-block { position: absolute; left: 0; right: 0; z-index: 2; background: repeating-linear-gradient(135deg, var(--off-soft) 0 5px, var(--line-2) 5px 7px); font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 4px 6px; overflow: hidden; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; }
.wk-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.wk-list { display: none; }
.wk-day-card.is-closed { padding-top: 12px; padding-bottom: 12px; }
.wk-day-card.is-closed .panel-head { margin: 0; }
.wk-day-card.is-closed h2 { color: var(--muted); font-weight: 600; }
.wk-day-card.is-today { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.block-line { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 14.5px; margin: 0 0 6px; }
.block-line .ico { width: 16px; height: 16px; }
.block-form .grid2 { margin-top: -4px; }

/* ------------------------------------------------------------------ report */
.report-lede { margin: 0 0 16px; color: var(--ink-2); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 40px; align-items: center; gap: 12px; font-size: 14.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: var(--off-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); min-width: 4px; }
.bar-fill.zero { min-width: 0; }
.bar-value { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.big-sentence { font-size: 20px; line-height: 1.35; margin: 2px 0 8px; }
.big-sentence b { color: var(--accent-ink); }
.report-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > .panel:last-child { margin-bottom: 0; }
.stack:empty { display: none; }
.report-foot { max-width: 80ch; margin-top: 4px; }
.print-head { display: none; }

/* ------------------------------------------------------------------ settings */
.link-card { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; padding: 14px 18px; }
.link-card > .ico:first-child { color: var(--accent-ink); }
.link-card > .ico:last-child { margin-left: auto; color: var(--muted); }
.link-card span { display: flex; flex-direction: column; }
.link-card .muted { font-size: 14px; }
.settings .panel > p:first-of-type { margin-top: 0; }
.seasons { display: grid; gap: 8px; }
.season { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)) 1.3fr; gap: 8px; align-items: center; }
.season label { margin: 0; }
.season label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.season label.check > span { position: static; width: auto; height: auto; clip: auto; font-size: 14px; }
.season input { margin-top: 0; }
.season-head span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(to bottom, transparent, var(--bg) 35%); z-index: 5; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }

/* ------------------------------------------------------------------ login */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 420px; padding: 0; }
.login-card { padding: 28px; }
.login-card h1 { margin: 16px 0 4px; font-size: 24px; }
.login-card .btn { margin-top: 8px; }

/* ------------------------------------------------------------------ super admin (kept simple) */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
header.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-left: auto; }
header.top nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
header.top nav a.active, header.top nav a:hover { background: var(--bg); color: var(--accent-ink); }
header.top nav form { display: inline; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card.narrow { max-width: 440px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.secret { font: 600 20px ui-monospace, Menlo, monospace; background: var(--warn-soft); padding: 4px 10px; border-radius: 6px; display: inline-block; letter-spacing: .05em; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 12px; color: var(--muted); font-weight: 600; }
main > form.row { margin: 8px 0 24px; }

/* ------------------------------------------------------------------ responsive */
@media screen and (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .day-panel { position: static; }
}
@media screen and (max-width: 900px) {
  .wk { display: none; }
  .wk-list { display: block; }
  .cols, .cols-agenda, .report-cols { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 720px) {
  .wrap { padding: 0 16px; }
  body.app:not(.login) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .app-head { position: static; }
  .head-row { min-height: 60px; }
  .prop-sub { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgb(16 24 32 / .06); }
  .tabs-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0 4px; }
  .tabs a { flex-direction: column; justify-content: center; gap: 3px; min-height: 64px; padding: 6px 2px 8px; font-size: 11.5px; border-bottom: 0; margin: 0; text-align: center; }
  .tabs a .ico { width: 22px; height: 22px; box-sizing: content-box; padding: 3px 14px; border-radius: 999px; }
  .tabs a[aria-current] { color: var(--ink); }
  .tabs a[aria-current] .ico { background: var(--accent-soft); }
  .tabs .tab-extra { display: none; }
  .tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .demo-bar { font-size: 13.5px; }
  h1 { font-size: 24px; }
  .page-head { margin: 20px 0 16px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 28px; }
  .tile-label { font-size: 13.5px; }
  .savings { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 6px; }
  .savings-value { font-size: 34px; }
  .savings .note { white-space: normal; }
  .panel { padding: 16px; }
  .req-foot { flex-direction: column; align-items: stretch; }
  .req-actions { width: 100%; }
  .req-actions form, .req-actions > .btn { flex: 1 1 0; }
  .req-actions .btn { width: 100%; }
  .req-actions .hint { flex-basis: 100%; text-align: center; }
  .seg { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg a { min-height: 44px; padding: 0 8px; }
  .months { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cal-grid { gap: 3px; }
  .day { aspect-ratio: auto; min-height: 48px; }
  .slot.is-now { margin: 0 -8px; padding: 10px 8px; }
  .season-head { display: none; }
  .season { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
  .season label:first-child, .season label.check { grid-column: 1 / -1; }
  .season label > span { position: static; width: auto; height: auto; clip: auto; display: block; font-size: 13px; margin-bottom: 4px; }
  .season input { margin-top: 0; }
  .sticky-save { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sticky-save .btn { width: 100%; }
  .page-actions { width: 100%; }
  .page-actions .btn { width: 100%; }
  .bars li { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) 34px; gap: 10px; }
}
@media screen and (max-width: 380px) {
  .tiles { gap: 8px; }
  .tile-value { font-size: 26px; }
  .tabs a { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ------------------------------------------------------------------ print (monthly report as PDF) */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #111; --ink-2: #333; --muted: #555; --line: #d9dee3; --off-soft: #eceff2; color-scheme: light; }
  body { background: #fff; font-size: 10.5pt; }
  .app-head, .demo-bar, .demo-cta, .seg, .page-actions, .skip, .sticky-save, .tabs { display: none !important; }
  body.app { padding: 0 !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .print-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--brand); }
  .print-head div { display: flex; flex-direction: column; }
  .print-head b { font-size: 15pt; }
  .print-head span:not(.mark) { color: var(--muted); font-size: 10pt; }
  .page-head { margin: 0 0 4px; }
  .page-head h1 { font-size: 18pt; }
  .report-lede { margin-bottom: 12px; }
  .tiles { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile-value { font-size: 20pt; }
  .cols, .report-cols { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .panel, .tile, .savings, .bars li { break-inside: avoid; }
  .panel { padding: 12px 14px; margin-bottom: 10px; }
  .savings, .mark, .bar-fill, .meter span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .savings { padding: 14px 18px; margin-bottom: 12px; }
  .savings-value { font-size: 24pt; }
  a { color: inherit; text-decoration: none; }
}
