/* Kafe Lipa sales dashboard. Mobile first; tokens on :root, dark set below. */
:root {
  --bg: #f6f4ef; --surface: #ffffff; --ink: #14212b; --muted: #4d5b66;
  --brand: #0b4f6c; --brand-ink: #ffffff; --accent: #8f5208; --accent-soft: #fbeedd;
  --line: #d9d4c8; --ok: #1d6b3a; --err: #a4231b; --focus: #8f5208;
  --radius: 14px; --gutter: 16px; --field: #807a70; /* field and chip edges: at least 3:1 on the page and on panels */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0f171d; --surface: #17232c; --ink: #eef2f4; --muted: #a9b7c1;
  --brand: #5fb3d6; --brand-ink: #0b1a22; --accent: #f0b35a; --accent-soft: #3a2a14;
  --line: #2c3b46; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a; --field: #8a94a0;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f171d; --surface: #17232c; --ink: #eef2f4; --muted: #a9b7c1;
  --brand: #5fb3d6; --brand-ink: #0b1a22; --accent: #f0b35a; --accent-soft: #3a2a14;
  --line: #2c3b46; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a; --field: #8a94a0;
  color-scheme: dark;
}
.made svg .hat-line { stroke: var(--muted); }

* { box-sizing: border-box; }
p, ul, ol, dl { margin: 0 0 16px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 9; }
.skip:focus { left: 8px; }

.demo-bar { margin: 0; padding: 8px var(--gutter); background: var(--accent-soft); color: var(--ink); font-size: 16px; text-align: center; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter); max-width: 1040px; margin: 0 auto; }
.brand { display: flex; gap: 12px; align-items: center; min-height: 44px; min-width: 44px; font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.logo-bg { fill: var(--brand); }
.logo-key { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; }
.tools { display: flex; gap: 8px; }
.chip { min-width: 44px; min-height: 44px; padding: 0 8px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }

main { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 28px 0; }
h1 { font-size: clamp(30px, 7vw, 50px); line-height: 1.1; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: clamp(24px, 5vw, 32px); margin: 0 0 12px; }
h3 { margin: 0 0 8px; font-size: 19px; }
.kicker { color: var(--accent); font-weight: 700; margin: 0; }
.lead { font-size: 19px; color: var(--muted); max-width: 40em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); }
.facts li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

.grid { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; }
.card p { margin: 0; color: var(--muted); }
.review blockquote { margin: 8px 0; font-style: italic; }
.review figcaption { color: var(--muted); font-size: 15px; }
.tag { display: inline-block; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--accent-soft); color: var(--ink); border-radius: 6px; padding: 2px 8px; }
.note { color: var(--muted); font-size: 15px; margin-top: -4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px var(--gutter); margin: 12px 0; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; font-size: 18px; margin-bottom: 8px; padding: 0; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 15px; margin-right: 4px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 12px 12px; border: 1px solid var(--field); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
textarea { min-height: 110px; }
/* one height for every single-line field, so neighbours share a centre line; a button never touches the field above it */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: 48px; padding-top: 8px; padding-bottom: 8px; }
input[type="checkbox"], input[type="radio"] { margin: 0; padding: 0; }
select + .btn, input + .btn, textarea + .btn { margin-top: 12px; }
.hint { color: var(--muted); font-size: 16px; margin: 8px 0 0; max-width: 68ch; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.slots .hint { grid-column: 1 / -1; }
.slot { min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.slot[aria-checked="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.msg { min-height: 1.5em; font-weight: 600; margin: 12px 0 0; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }

.foot { max-width: 1040px; margin: 0 auto; padding: 24px var(--gutter) 40px; color: var(--muted); font-size: 16px; }
.foot p { margin: 0 0 4px; } .sig { font-style: italic; }
.made { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }


/* Owner view */
.owner table { width: 100%; border-collapse: collapse; font-size: 15px; }
.owner th, .owner td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.owner .table-wrap { overflow-x: auto; }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  #reviews .grid { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px; }
  .panel { padding: 28px; }
  #book-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  #book-form .btn.wide, #book-form .msg { grid-column: 1 / -1; }
}

/* ---- Pilot 07 dashboard additions ---- */
.dash h1 { font-size: clamp(26px, 6vw, 38px); margin: 8px 0 12px; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin-bottom: 16px; }
.range label { margin-top: 0; }
.range .quick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.range .quick .chip { padding: 0 16px; }
.kpis { display: grid; gap: 12px; }
.kpi p { margin: 0; }
.kpi-label { color: var(--muted); font-weight: 600; font-size: 15px; }
.kpi-val { font-size: clamp(26px, 6vw, 34px); font-weight: 800; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 14px; }
.chart { margin: 16px 0; }
.chart h2 { font-size: 20px; }
.svg-chart { width: 100%; height: auto; display: block; }
.svg-chart .bar { fill: var(--brand); }
.svg-chart .axis { stroke: var(--line); }
.svg-chart .ax-t { fill: var(--muted); font-size: 22px; }
details { margin-top: 8px; color: var(--muted); }
details table { width: 100%; border-collapse: collapse; font-size: 14px; }
details th, details td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
details .table-wrap { max-height: 280px; overflow-y: auto; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: 1fr; gap: 4px; }
.hb-name { font-weight: 600; }
.hb-track { height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.hb-fill { display: block; height: 100%; background: var(--accent); }
.hb-val { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
input[type=file] { padding: 12px; }
@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .range { grid-template-columns: 180px 180px 1fr; }
  .range .quick { grid-column: auto; }
}

/* ---- Back office (shared by the three rebuilt pilots) ---- */
[hidden] { display: none !important; }
/* back-office menu: always one line; it scrolls sideways when the screen is narrower than the menu */
.admin-nav { max-width: 1040px; margin: 0 auto 8px; padding: 4px var(--gutter); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.admin-nav a { flex: none; white-space: nowrap; }
.admin-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.admin-nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tools .chip { padding: 0 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 14px; color: var(--muted); }
td.detail { overflow-wrap: anywhere; max-width: 40ch; font-size: 14px; color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; margin-bottom: 12px; }
.filters label { margin-top: 0; }
.check { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.check input { width: 24px; height: 24px; min-height: 0; margin: 0; }
.check label { margin: 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.pager { justify-content: space-between; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn.danger { border-color: var(--err); color: var(--err); }
.panel.danger { border-color: var(--err); }
.badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.notice { background: var(--accent-soft); color: var(--ink); padding: 12px 12px; border-radius: 10px; border-left: 4px solid var(--accent); margin: 12px 0; }
.msg.ok:not(:empty)::before { content: "✓ "; }
.msg.err:not(:empty)::before { content: "! "; }
.facts-list { display: grid; gap: 12px; margin: 12px 0; }
.facts-list div { display: grid; gap: 2px; }
.facts-list dt { font-weight: 700; }
.facts-list dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.neg { color: var(--err); font-weight: 700; }
.pos { color: var(--ok); font-weight: 700; }
.two { display: grid; gap: 0 16px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
.plain { list-style: none; padding: 0; margin: 0; }
.links li { margin: 8px 0; }
.links a { display: inline-block; min-height: 44px; line-height: 44px; }
fieldset.cat-edit { border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px 12px; margin: 12px 0; }
fieldset.cat-edit legend { font-size: 16px; padding: 0 4px; }
h1, h2, h3, td, th, dd, p, li { overflow-wrap: anywhere; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
/* 320 px: nothing may push the page wider than the screen. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input, select, textarea { min-width: 0; max-width: 100%; }
.range > *, .filters > *, .two > *, .hours > * { min-width: 0; }
.top { flex-wrap: wrap; gap: 8px; }
.tools { flex-wrap: wrap; }
.chip { white-space: nowrap; }
.btn { white-space: nowrap; }
.nowrap { white-space: nowrap; }
/* ---- round 2 (12.11.2026): no jumps, phone header ---- */
/* everything under the page heading is held in place, invisible, until the first data is drawn (public/js/ui.js) */
html.adm-loading main > :not(h1) { visibility: hidden; }
html.adm-loading .foot { visibility: hidden; }
label.check { min-height: 44px; align-items: center; }
/* pager on a phone: the count on its own line, Previous and Next side by side under it */
@media (max-width: 480px) { .pager { display: grid; grid-template-columns: 1fr 1fr; } .pager > :not(button):not(a) { grid-column: 1 / -1; grid-row: 1; text-align: center; } }
/* running text stops at a readable line length; a fold's summary is a 44 px target; code-like text is never under 14 px */
main p { max-width: 68ch; }
summary { padding: 12px 0; cursor: pointer; }
.mono { font-size: 1em; }
/* chart labels are ordinary text around the drawing (dash.js), so they keep one size on every screen */
.chart-note { color: var(--muted); font-size: 16px; margin: 0 0 4px; }
.chart-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 16px; margin: 4px 0 0; max-width: none; }
/* a tick box's words are part of its 44 px target; fields side by side align on the field, not on a wrapped label */
.check label { display: flex; align-items: center; min-height: 44px; flex: 1; }
.two { align-items: end; }
/* a form's button never sits flush under the row of fields above it */
form > .btn:not(:first-child), form > p > .btn:only-child { margin-top: 12px; }
