/* FW-Gastro Cloud: the same look as the box's web version. One typeface (Geist), quiet neutral surfaces, the
   brigade's red on the mark and the figures that matter; colour otherwise only says something (ok, warning, problem).
   Wide screens: the menu is a sidebar; phones: a bar with a menu button. */
@font-face {
    font-family: "Geist";
    src: url("/fonts/Geist-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bg: #f4f3f1;
    --surface: #ffffff;
    --surface-2: #f0eeeb;
    --surface-3: #e4e1dd;
    --text: #161514;
    --muted: #5d5955;
    --border: #e4e1dc;
    --rule: #eeece8;
    --control: #d2cec8;
    --primary: #1c1b1a;
    --on-primary: #ffffff;
    --accent: #b71c1c;
    --accent-text: #ffffff;
    --ok: #1f7a4a;
    --ok-bg: #e3f6ea;
    --ok-ink: #0d3d22;
    --warn: #a35a00;
    --warn-bg: #fff6e0;
    --warn-ink: #7a3e00;
    --warn-edge: #f3d27a;
    --bad: #c4242a;
    --bad-bg: #fdecea;
    --bad-ink: #831c1e;
    --info: #1d5fbf;
    --info-bg: #eaf1fc;
    --info-ink: #133e7c;
    --code-bg: #f0eeeb;
    /* the payment methods as shades of one ink: the share reads without a rainbow */
    --cash: #161514;
    --card: #6b6966;
    --twint: #a3a09c;
    --voucher: #cfccc7;
    --off: #e4e1dd;
    --radius: 10px;
    --radius-s: 8px;
    --float: 0 1px 2px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .16);
    --sidebar: 232px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0f0f0f;
        --surface: #181818;
        --surface-2: #222222;
        --surface-3: #2e2e2e;
        --text: #f4f4f4;
        --muted: #b4b4b4;
        --border: #2a2a2a;
        --rule: #222222;
        --control: #444444;
        --primary: #f4f4f4;
        --on-primary: #111111;
        --accent: #f05252;
        --accent-text: #1a0606;
        --ok: #4cc584;
        --ok-bg: #12291c;
        --ok-ink: #9fe3bd;
        --warn: #f0b14a;
        --warn-bg: #2e2208;
        --warn-ink: #f6d59a;
        --warn-edge: #5c4512;
        --bad: #f07178;
        --bad-bg: #2f1517;
        --bad-ink: #f7b3b6;
        --info: #7fb0f5;
        --info-bg: #15243a;
        --info-ink: #b9d4fb;
        --code-bg: #222222;
        --cash: #f4f4f4;
        --card: #a8a8a8;
        --twint: #6e6e6e;
        --voucher: #444444;
        --off: #2e2e2e;
        --float: 0 12px 32px rgba(0, 0, 0, .6);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------------------------------------------------------------- the menu */
header.top {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

header.top .bar {
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

header.top .brand {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    margin-right: auto;
    display: flex;
    align-items: center;
    letter-spacing: -.01em;
}

header.top .brand span { color: var(--muted); font-weight: 500; margin-left: 5px; }

header.top .brand img { width: 34px; height: 34px; margin-right: 10px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; }

.menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.menu-button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.menu-button:hover { background: var(--surface-2); }
.menu-button span, .menu-button span::before, .menu-button span::after { display: block; width: 18px; height: 2px; border-radius: 1px; background: var(--text);
    position: relative; transition: transform .2s, background-color .2s; }
.menu-button span::before, .menu-button span::after { content: ""; position: absolute; left: 0; }
.menu-button span::before { top: -6px; }
.menu-button span::after { top: 6px; }
.menu-toggle:checked + .menu-button span { background: transparent; }
.menu-toggle:checked + .menu-button span::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle:checked + .menu-button span::after { transform: translateY(-6px) rotate(-45deg); }
.menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--primary); }

header.top nav { display: none; flex-direction: column; gap: 2px; flex: 1 1 100%; padding: 6px 0 4px; }
header.top .user { display: none; flex: 1 1 100%; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px;
    border-top: 1px solid var(--border); padding: 10px 10px 4px; }
.menu-toggle:checked ~ nav, .menu-toggle:checked ~ .user { display: flex; }

header.top nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 0 10px;
    min-height: 34px;
    border-radius: var(--radius-s);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color .15s, color .15s;
}

header.top nav a:hover { color: var(--text); background: var(--surface-2); }
header.top nav a.active { color: var(--text); background: var(--surface-3); font-weight: 500; }
header.top nav a .badge { margin-left: auto; }
header.top nav .nav-group { font-size: .8rem; color: var(--muted); padding: 18px 10px 6px; }
header.top .user a { color: var(--text); font-weight: 500; }

@media (min-width: 1024px) {
    header.top { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); border-bottom: 0; border-right: 1px solid var(--border); overflow-y: auto; }
    header.top .bar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; min-height: 100%; padding: 18px 10px 14px; gap: 0; }
    header.top .brand { margin: 0 0 18px; padding: 0 8px; }
    .menu-button { display: none; }
    header.top nav { display: flex; flex: 1; padding: 0; }
    header.top .user { display: flex; flex: none; padding: 12px 8px 0; }
    body:has(header.top) main { margin-left: var(--sidebar); max-width: none; padding-left: 32px; padding-right: 32px; }
    body:has(header.top) main > * { max-width: 1200px; }
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 56px;
}

h1 { font-size: 1.5rem; margin: 4px 0 18px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 12px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 18px 0 8px; font-weight: 600; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 16px;
}

.title-row h1 { margin: 0; }
.title-row h2 { margin: 0; }

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    align-items: start;
}

.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    min-width: 0;
}

.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.stat { font-size: 1.6rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }

th, td {
    text-align: left;
    padding: 10px 10px;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

th { font-size: 13px; color: var(--muted); font-weight: 500; border-bottom-color: var(--border); }
tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    min-height: 21px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge.info { background: var(--info-bg); color: var(--info-ink); }
header.top nav .badge.bad { background: var(--bad); color: #fff; }

.flash {
    padding: 11px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid transparent;
    animation: flash-in .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }

.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.bad { background: var(--bad-bg); color: var(--bad-ink); }
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-edge); }

form.stack { display: grid; gap: 14px; }
form.inline { display: inline; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > label { flex: 1 1 180px; }

label { display: grid; gap: 6px; font-size: 13.5px; color: var(--text); font-weight: 500; }

input, select, textarea {
    font: inherit;
    font-weight: 400;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--control);
    border-radius: var(--radius-s);
    padding: 9px 11px;
    min-height: 40px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--primary); box-shadow: none; }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); }

textarea.code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 13px;
    min-height: 480px;
    white-space: pre;
    background: var(--code-bg);
}

button, .button {
    font: inherit;
    font-weight: 600;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--on-primary);
    border-radius: var(--radius-s);
    padding: 0 14px;
    min-height: 38px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, transform .12s cubic-bezier(.2, .8, .2, 1);
}

button:hover, .button:hover { background: color-mix(in srgb, var(--primary) 86%, var(--bg)); }
button:active, .button:active { transform: scale(.97); }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--control); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); }
button.link { background: none; border: 0; color: var(--text); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); text-underline-offset: 3px; }
button.link:hover { background: none; }
button.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
button.danger:hover { background: var(--bad-bg); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

pre, code.block {
    display: block;
    background: var(--code-bg);
    border-radius: var(--radius-s);
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
    margin: 0;
}

code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
code.big { font-size: 1.4rem; font-weight: 700; letter-spacing: .08em; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 13.5px; }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

ul.problems { margin: 0; padding-left: 20px; color: var(--bad); }

.menu-cat { margin-bottom: 12px; }
.menu-cat h3 { margin: 0 0 4px; }

nav.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
nav.tabs a {
    text-decoration: none;
    color: var(--text);
    padding: 0 14px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--control);
    background: var(--surface);
    transition: background-color .15s;
}
nav.tabs a:hover { background: var(--surface-2); }
nav.tabs a.active { color: var(--on-primary); background: var(--primary); border-color: var(--primary); font-weight: 600; }

.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 400; }
/* the setup steps of an event or template: numbered, each a link with what is done */
.steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.steps li { padding-left: 4px; }
.steps li::marker { color: var(--muted); }
details > summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
details[open] > summary { margin-bottom: 8px; }

img.qr { display: block; background: #fff; padding: 8px; border-radius: var(--radius-s); margin: 8px 0; }

/* figures on top of a page: one container split by hairlines, label over value */
.stats { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stats .card { margin: 0; border: 0; border-radius: 0; box-shadow: -1px 0 0 var(--border), 0 -1px 0 var(--border); }
.stats .card + .card { margin: 0; }
.stats .card .small:first-child, .stats .card .muted:first-child { color: var(--muted); }

.login {
    max-width: 380px;
    margin: 12vh auto 0;
}
.login h1 { display: flex; align-items: center; gap: 10px; }
.login h1::before { content: ""; width: 44px; height: 44px; flex: none; border-radius: 50%; background: #fff url("/logo.png") center / 40px no-repeat; }

.pins { width: auto; min-width: 320px; }
.pins td.pin { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; font-weight: 700; letter-spacing: .1em; }

/* tiles: a card that is a link */
a.tile { color: inherit; text-decoration: none; display: block; transition: border-color .15s; }
a.tile:hover { border-color: var(--control); }
.stat.ok, .stat .ok { color: var(--ok); }
.stat.zero, .stat .zero { color: var(--muted); font-weight: 500; }
.grid > .span-all { grid-column: 1 / -1; }
.stat.warn { color: var(--warn); }
.stat.bad { color: var(--bad); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* box page: jump to a section, stays on top while scrolling */
nav.tabs.sections {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg);
    padding: 8px 0;
    margin-bottom: 12px;
}
@media (max-width: 1023px) { nav.tabs.sections { top: 63px; } }
section[id], div[id] { scroll-margin-top: 64px; }

/* boxes list */
.filters { margin-bottom: 12px; }
.filters nav.tabs { flex: 1 1 100%; margin: 0; }
.filters label.search { flex: 1 1 240px; }
table.fleet ul.problems { padding-left: 16px; }
.bulk { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 4px; display: grid; gap: 8px; }
.bulk h3 { margin-bottom: 0; }

/* connection of the last days */
svg.uptime { display: block; width: 100%; height: 22px; margin-top: 12px; border-radius: 6px; overflow: hidden; }
svg.uptime rect.on { fill: var(--ok); }
svg.uptime rect.off { fill: var(--off); }
.uptime-axis { display: flex; justify-content: space-between; }

/* payment methods as one bar */
.bar svg { display: block; width: 100%; height: 10px; margin-top: 8px; border-radius: 5px; overflow: hidden; }
.method-CASH { fill: var(--cash); background: var(--cash); }
.method-CARD { fill: var(--card); background: var(--card); }
.method-TWINT { fill: var(--twint); background: var(--twint); }
.method-VOUCHER { fill: var(--voucher); background: var(--voucher); }
.legend { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; }
.legend i.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.card.running h3 { margin: 0; }
.card.running .title-row { margin-bottom: 4px; }

/* revenue by hour */
figure.hours { margin: 4px 0 12px; }
figure.hours svg { display: block; width: 100%; height: 90px; }
figure.hours rect { fill: var(--accent); }
figure.hours line.axis { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hours-axis { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
.small-stat { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
table.compare td:first-child { color: var(--muted); }

/* rollout stages of a release */
ol.stages { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; flex-wrap: wrap; }
ol.stages li { flex: 1 1 90px; text-align: center; padding: 7px 8px; border-radius: var(--radius-s); background: var(--surface-2);
    color: var(--muted); font-size: 13px; font-weight: 600; }
ol.stages li.done { background: var(--ok-bg); color: var(--ok-ink); }
ol.stages li.current { background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--warn-edge); }

/* preset forms */
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0; display: grid; gap: 10px; min-width: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.presets .card { margin: 0; }

@media print {
    header.top, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
    main { margin-left: 0 !important; }
    .card { border: 0; padding: 0; }
}

@media (max-width: 600px) {
    dl.facts { grid-template-columns: 1fr; gap: 0 0; }
    dl.facts dd { margin-bottom: 8px; }
}

/* shift plan */
.grid-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); align-items: end; }
td.bad { color: var(--bad); font-weight: 700; }
.print-only { display: none; }
@media print { .print-only { display: inline; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* phones: a long button label wraps instead of running out of its card */
@media (max-width: 600px) {
    button, .button { white-space: normal; text-align: center; padding-top: 7px; padding-bottom: 7px; max-width: 100%; }
}
