/* boka-admin. No JavaScript and a strict CSP: everything here is CSS (no inline styles, no web fonts). */
/* Colours, type and shapes follow the booking app's design v2 "Fjord" (boka-saas app/static/css/v2/tokens.css,
   commit 5217bbe), copied, not linked: the admin site shares no files with a booking app. Inter is self-hosted
   (fonts/, SIL Open Font License). Fjord has no dark theme; the one below is ours, in the same palette. */
@font-face {
  font-family: "Inter v2"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter v2"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --bg: #f5f7f6; --surface: #ffffff; --surface-2: #eef2f1; --ink: #14201d; --ink-2: #2c3a36; --muted: #4a5753;
  --line: #dfe5e3; --line-strong: #6b7a76;
  --accent: #0b6b63; --accent-hover: #085750; --accent-ink: #ffffff; --accent-soft: #e1f0ee;
  --good: #166534; --good-soft: #f0faf3;
  --bad: #b42318; --bad-soft: #fef3f2; --warn: #92400e; --warn-soft: #fffaeb; --gold: #b45309;
  --side: #ffffff; --side-ink: #14201d; --side-muted: #4a5753; --side-hover: #eef2f1; --side-line: #dfe5e3;
  --ring: #0b6b63; --shadow: 0 1px 2px rgba(20, 32, 29, .05), 0 4px 14px rgba(20, 32, 29, .06);
  --r: 12px; --r-sm: 10px;
  --font: "Inter v2", Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1513; --surface: #141e1b; --surface-2: #1b2824; --ink: #e5edea; --ink-2: #c6d2ce; --muted: #9db0aa;
    --line: #26342f; --line-strong: #5d6f69;
    --accent: #3fb3a6; --accent-hover: #5fcabd; --accent-ink: #04201c; --accent-soft: #12302c;
    --good: #6fd39a; --good-soft: #10281a;
    --bad: #ff8f84; --bad-soft: #3a1714; --warn: #f5c451; --warn-soft: #33270b; --gold: #f5c26b;
    --side: #141e1b; --side-ink: #e5edea; --side-muted: #9db0aa; --side-hover: #1b2824; --side-line: #26342f;
    --ring: #3fb3a6; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh;
}
body.bare { display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.25; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
h2 { font-size: 1.125rem; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: .9rem; margin: 20px 0 8px; color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- sidebar (Fjord shell: a light surface, a border, the page you are on filled in teal) ---------------- */
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  background: var(--side); color: var(--side-ink); padding: 14px 10px 10px; border-right: 1px solid var(--side-line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; font-weight: 700; padding: 4px 10px; }
.brand:hover { color: var(--accent); }
.brand small { display: block; font-weight: 500; font-size: .78rem; color: var(--side-muted); }
.mark {
  position: relative; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: none;
  font-weight: 800; background: #0b6b63; color: #fff;
}
.mark::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; background: #f5c26b;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.side nav { display: grid; gap: 1px; }
.side nav a {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 10px; border-radius: var(--r-sm);
  color: var(--side-ink); text-decoration: none; font-weight: 500; font-size: .93rem; transition: background .12s, color .12s;
}
.side nav a .i { color: var(--side-muted); width: 20px; height: 20px; stroke-width: 1.75; }
.side nav a:hover { background: var(--side-hover); color: var(--side-ink); }
.side nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.side nav a[aria-current="page"] .i { color: var(--accent-ink); }
/* groups, as the booking app's V2 menu: an uppercase title that opens and closes its pages (details/summary, no script) */
.nav-group { margin-top: 8px; }
.nav-group summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 28px; padding: 0 10px; border-radius: 8px;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--side-muted);
  cursor: pointer; list-style: none; transition: background .12s;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { background: var(--side-hover); }
.nav-group .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .12s; }
.nav-group:not([open]) .chev { transform: rotate(-90deg); }
.nav-group > a { margin-top: 1px; }
.who { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--side-line); }
.who-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; font-weight: 500; }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem;
}
.avatar.sm { width: 24px; height: 24px; font-size: .75rem; margin-right: 8px; vertical-align: middle; }
.who .icon-btn { color: var(--side-muted); }
.who .icon-btn:hover { color: var(--side-ink); background: var(--side-hover); }

/* ---- page ---------------------------------------------------------------------------------------------- */
main { padding: 28px 32px 72px; max-width: 1280px; width: 100%; }
.page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.sub { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.back:hover { color: var(--ink); }
.back .i { width: 16px; height: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 26px; box-shadow: var(--shadow); margin: 0 0 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 620px; }
.card.center { text-align: center; margin: 10vh auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.code { font-size: 3rem; font-weight: 800; margin: 0; color: var(--muted); }

/* key figures */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; scroll-margin-top: 20px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
a.kpi:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.kpi-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value.small { font-size: 1.05rem; padding: 6px 0 4px; }
.kpi-value small { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-value.ok { color: var(--good); }
.kpi-value.bad { color: var(--bad); }
.kpi-foot { font-size: .82rem; color: var(--muted); }
progress { width: 100%; height: 6px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; appearance: none; margin: 6px 0 2px; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list a { text-decoration: none; color: var(--ink); }
.list a:hover { color: var(--accent); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed time { white-space: nowrap; font-size: .85rem; }
.empty { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 0; }
.empty .i { color: var(--accent); }
div.empty.card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px; }
.names { margin: 0; padding-left: 18px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.card > .table-wrap > table, .table-wrap > table.dash { background: var(--surface); }
.table-wrap:has(> table.dash) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
th { text-align: left; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted { display: block; font-size: .82rem; }
.rowlink { font-weight: 600; color: var(--ink); text-decoration: none; }
.rowlink:hover { color: var(--accent); text-decoration: underline; }
.log td.detail { color: var(--muted); max-width: 420px; overflow-wrap: anywhere; }
.log tr.is-bad td { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }

/* status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px;
  font-size: .8rem; font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--surface-2); color: var(--ink-2);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.paused { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* forms and buttons */
.stack { display: grid; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 6px; }
legend { font-weight: 700; padding: 0; margin-bottom: 10px; }
label { display: block; font-weight: 500; font-size: .9rem; color: var(--ink); }
label small, .hint { display: block; font-weight: 400; font-size: .84rem; color: var(--muted); margin: 4px 0 0; }
.hint { margin: 0; }
input:not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--ink);
  padding: 9px 11px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:not([type=checkbox]):focus, select:focus, textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring); }
input::placeholder { color: var(--muted); opacity: .8; }
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px;
  font: inherit; font-weight: 500; font-size: .9rem; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  color: var(--accent-hover); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: background .16s ease-out, border-color .16s ease-out, color .16s ease-out, transform .16s ease-out;
}
.btn:hover, button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.btn:active, button:active { transform: translateY(1px); }
.btn .i, button .i { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: .84rem; }
.btn.wide { width: 100%; }
.icon-btn { min-height: 34px; padding: 6px 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions.end { justify-content: flex-end; flex-wrap: nowrap; }
.actions form, form.inline { display: inline; margin: 0; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.toolbar .field { min-width: 160px; }
.search { position: relative; flex: 1 1 280px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { margin: 0; padding-left: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px; border-radius: 99px; text-decoration: none;
  font-size: .88rem; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
}
.chips a:hover { border-color: var(--line-strong); color: var(--ink); }
.chips a[aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 20px; scrollbar-width: none; }
.tabs a { padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
section[id] { scroll-margin-top: 16px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 16px; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin-top: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.callout p { margin: 2px 0 0; font-size: .86rem; }
.secret { font-size: 1.1rem; padding: 4px 10px; user-select: all; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.danger-zone.column { display: block; }
.danger-zone h2 { color: var(--bad); margin-bottom: 4px; }
.danger-zone p { margin: 0; }

.flash { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); margin: 0 0 16px; background: var(--accent-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.flash .i { color: var(--accent); margin-top: 2px; }
.flash.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.flash.bad .i { color: var(--bad); }
.flash ul { margin: 0; padding-left: 18px; }

.releases { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
.release.newest { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.release h2 { font-size: .95rem; }
.link-existing { margin-top: 6px; }
.link-existing summary { cursor: pointer; font-size: .84rem; }
.link-existing form { margin-top: 8px; max-width: 320px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }

.login { max-width: 400px; margin: 12vh auto 0; padding: 0 16px; }
.brand.big { color: var(--accent); justify-content: center; margin-bottom: 20px; font-size: 1.15rem; }
.brand.big small { color: var(--muted); }
.login h1 { font-size: 1.25rem; margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- tablet and phone ---------------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; }
  .side nav { order: 3; flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .side nav a { padding: 7px 10px; font-size: .88rem; white-space: nowrap; }
  .side nav a[aria-current="page"] { box-shadow: none; }
  .brand { padding: 0; }
  .mark { width: 30px; height: 30px; }
  .who { margin: 0 0 0 auto; padding: 0; border: 0; }
  .who-name { display: none; }
  main { padding: 20px 16px 56px; }
  h1 { font-size: 1.35rem; }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 1.4rem; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .callout, .danger-zone { flex-direction: column; align-items: stretch; }
  .page .btn.primary { width: 100%; }
  .page > .actions { width: 100%; }
  .page > .actions > * { flex: 1; }
  .page > .actions .btn { width: 100%; }
  /* a phone: customer, state and actions; the rest is on the customer's page */
  .dash th:nth-child(n+3):nth-child(-n+6), .dash td:nth-child(n+3):nth-child(-n+6) { display: none; }
  .dash .btn.small span:not(.sr) { display: none; }
  .dash .btn.ghost { display: none; }        /* "open the copy" is on the customer's page */
  .log th:nth-child(5), .log td:nth-child(5) { display: none; }
  .feed li { flex-direction: column; gap: 0; }
}
