@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

/* ==========================================================================
   Tavrions control room design system
   Brand tokens only. Tints are mixes of a brand colour with white.
   ========================================================================== */
:root {
  --red: #E00000;
  --peach: #FFA97B;
  --cream: #FFECCB;
  --lime: #9FED72;
  --white: #FFFFFF;
  --ink: #260707;

  /* tints (brand colour mixed with white) */
  --ink-70: #675151;      /* 70% ink + 30% white, secondary text on cream and white */
  --ink-15: #DCD6D6;      /* 15% ink, quiet rules */
  --cream-50: #FFF6E5;    /* 50% cream */
  --peach-40: #FFDDCA;    /* 40% peach */
  --lime-40: #D9F8C7;     /* 40% lime */
  --red-12: #FCE0E0;      /* 12% red */
  --ink-90: #3C2020;      /* 90% ink, sidebar hover */
  --grid-line: #FFD7B8;   /* about 45% peach, grid paper lines */

  --font-head: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --line: 2px solid var(--ink);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-lift: 8px 8px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --sidebar-w: 264px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }
code, kbd, pre, .mono { font-family: var(--font-mono); }
pre { background: var(--ink); color: var(--cream); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .85rem; line-height: 1.55; }
code { font-size: .9em; background: var(--cream-50); border: 1px solid var(--ink-15); padding: .05em .35em; border-radius: 4px; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
hr { border: 0; border-top: var(--line); margin: 1.5rem 0; }
.muted { color: var(--ink-70); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* focus: always visible */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--lime); border-radius: 6px; }
.sidebar :focus-visible { outline-color: var(--lime); box-shadow: none; }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--white); color: var(--ink); padding: .6rem 1rem; border: var(--line); border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* ==========================================================================
   App shell
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--ink) var(--sidebar-w), transparent var(--sidebar-w)); }
.sidebar {
  background: var(--ink); color: var(--cream);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 1.1rem .9rem 1.5rem;
  border-right: var(--line);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; color: var(--cream); text-decoration: none; padding: .35rem .5rem 1rem; }
.brand__logo { display: inline-flex; background: var(--cream); border-radius: var(--radius-sm); padding: .45rem .65rem; box-shadow: 3px 3px 0 var(--lime); }
.brand__logo img { display: block; height: 28px; width: auto; }
[hidden] { display: none !important; }
.guest__logo { display: block; height: 36px; width: auto; }
.btn--google { width: 100%; justify-content: center; gap: .6rem; }
.btn--google .g-logo { width: 18px; height: 18px; flex: none; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.divider { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0; color: var(--ink-70); font-size: .8rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 2px solid var(--ink-15); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.legacy-login { margin-top: 1.25rem; border-top: 2px solid var(--ink-15); padding-top: .9rem; }
.legacy-login summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.legacy-login[open] summary { margin-bottom: .75rem; }
.brand__mark { width: 38px; height: 38px; border-radius: 10px; background: var(--red); border: 2px solid var(--cream); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; color: var(--white); font-size: 1.15rem; box-shadow: 3px 3px 0 var(--lime); }
.brand__name { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand__sub { display: block; font-family: var(--font-mono); font-size: .68rem; color: var(--peach); letter-spacing: .08em; text-transform: uppercase; }
.nav-group { margin-top: .9rem; }
.nav-group__title { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--peach); padding: 0 .6rem .35rem; margin: 0; font-weight: 500; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: flex; align-items: center; gap: .65rem; color: var(--cream); text-decoration: none;
  padding: .5rem .6rem; border-radius: var(--radius-sm); font-weight: 500; position: relative;
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { background: var(--ink-90); }
.nav-link[aria-current="page"] { background: var(--ink-90); color: var(--lime); font-weight: 600; }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -.9rem; top: 6px; bottom: 6px; width: 6px; border-radius: 0 6px 6px 0; background: var(--lime); }
.sidebar__foot { margin-top: auto; padding: 1rem .6rem 0; font-size: .78rem; color: var(--cream); opacity: .85; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: var(--line);
  display: flex; align-items: center; gap: 1rem; padding: .65rem 1.5rem; min-height: 64px;
}
.topbar .topbar__menu { display: none; }
.search { flex: 1; max-width: 520px; position: relative; }
.search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; pointer-events: none; }
.search input[type="search"] { width: 100%; padding-left: 2.4rem; }
.topbar__spacer { flex: 1; }
.user-menu { position: relative; }
.user-menu__button { display: flex; align-items: center; gap: .55rem; background: var(--white); border: var(--line); border-radius: 999px; padding: .2rem .7rem .2rem .2rem; cursor: pointer; font: inherit; color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: .78rem; }
.user-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 230px; padding: .5rem; display: none; z-index: 30; }
.user-menu__panel.is-open { display: block; }
.user-menu__panel a, .user-menu__panel button { display: flex; width: 100%; gap: .5rem; align-items: center; padding: .55rem .65rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.user-menu__panel a:hover, .user-menu__panel button:hover { background: var(--cream-50); }
.user-menu__head { padding: .5rem .65rem .65rem; border-bottom: 1px solid var(--ink-15); margin-bottom: .35rem; }
.user-menu__panel svg { width: 18px; height: 18px; flex: none; }
.user-menu__panel form { margin: 0; }

.content { padding: 1.5rem 1.75rem 3rem; max-width: 1440px; width: 100%; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0 0 .75rem; font-size: .85rem; font-family: var(--font-mono); }
.breadcrumb li + li::before { content: "/"; margin-right: .35rem; color: var(--ink-70); }
.breadcrumb a { color: var(--ink-70); }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head p { margin: .25rem 0 0; color: var(--ink-70); max-width: 70ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ==========================================================================
   Surfaces
   ========================================================================== */
.card {
  background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem; transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  min-width: 0;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lift); }
.card--flat:hover { transform: none; box-shadow: var(--shadow); }
.card--cream { background: var(--cream-50); }
.card--lime { background: var(--lime-40); }
.card--peach { background: var(--peach-40); }
.card--red { background: var(--red-12); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card__head h2, .card__head h3 { margin: 0; }
.card + .card { margin-top: 1.25rem; }
.section { margin-top: 1.5rem; }
.grid { display: grid; gap: 1.25rem; }
.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--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 1rem; }

/* metrics */
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat__label { font-size: .8rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-70); }
.stat__value { font-family: var(--font-mono); font-weight: 600; font-size: 2.3rem; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: .9rem; font-weight: 500; letter-spacing: 0; }
.stat__meta { font-size: .85rem; color: var(--ink-70); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* definition list */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.facts dt { font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-70); padding-top: .15rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ==========================================================================
   Badges, lights, chips
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem .12rem .45rem; border: var(--line);
  border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--white); color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink); transform: rotate(-1deg); line-height: 1.4;
}
.badge svg { width: 14px; height: 14px; flex: none; }
.badge--ok { background: var(--lime); }
.badge--warn { background: var(--peach); }
.badge--bad { background: var(--red); color: var(--white); }
.badge--neutral { background: var(--white); }
.badge--plain { transform: none; box-shadow: none; }
.tag { display: inline-block; font-family: var(--font-mono); font-size: .75rem; padding: .05rem .45rem; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--cream-50); margin: 0 .25rem .25rem 0; }
.light { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; flex: none; background: var(--white); }
.light--ok { background: var(--lime); }
.light--warn { background: var(--peach); }
.light--bad { background: var(--red); animation: blink 1.6s steps(2, start) infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 4px var(--red-12); } }
.suggestion { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; background: var(--cream-50); border: 1.5px dashed var(--ink); border-radius: 6px; padding: .1rem .5rem; }

/* ==========================================================================
   Buttons and forms
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; font-size: .92rem;
  padding: .55rem 1rem; border: var(--line); border-radius: 10px; cursor: pointer; text-decoration: none;
  background: var(--red); color: var(--white); box-shadow: var(--shadow-sm); transition: transform .12s var(--ease), box-shadow .12s var(--ease);
  min-height: 42px; line-height: 1.2;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--secondary { background: var(--white); color: var(--ink); }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--small { padding: .3rem .65rem; min-height: 34px; font-size: .84rem; box-shadow: 2px 2px 0 var(--ink); }
.btn--icon { padding: .45rem; min-width: 42px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }

label, .label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.hint { font-size: .8rem; color: var(--ink-70); margin-top: .25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], input[type="file"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white); border: var(--line); border-radius: var(--radius-sm);
  padding: .5rem .7rem; min-height: 42px;
}
input[type="file"] { padding: .4rem; }
input.mono, textarea.mono { font-family: var(--font-mono); font-size: .9rem; }
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-radius: var(--radius-sm); }
.field { margin-bottom: 1rem; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-12); }
.error-text { display: flex; gap: .3rem; align-items: center; color: var(--ink); background: var(--red-12); border-left: 4px solid var(--red); font-size: .84rem; padding: .25rem .5rem; margin-top: .35rem; border-radius: 0 6px 6px 0; }
.error-text svg { width: 14px; height: 14px; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.filters .field--wide { max-width: 320px; flex-basis: 220px; }
.filters__actions { display: flex; gap: .5rem; }

.kv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: .6rem; align-items: start; margin-bottom: .6rem; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { background: var(--ink); color: var(--cream); text-align: left; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: .7rem .8rem; white-space: nowrap; font-family: var(--font-mono); }
.table th a { color: var(--cream); text-decoration: none; }
.table th a:hover { text-decoration: underline; }
.table td { padding: .65rem .8rem; border-top: 1px solid var(--ink-15); vertical-align: top; }
.table tbody tr:hover td { background: var(--cream-50); }
.table td.num, .table th.num { text-align: right; }
.table .row-actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.table tr.is-focus td { background: var(--cream-50); }

/* pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.pager__links { display: flex; gap: .35rem; flex-wrap: wrap; }
.pager__links a, .pager__links span { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 .55rem; border: var(--line); border-radius: 8px; background: var(--white); text-decoration: none; font-family: var(--font-mono); font-weight: 500; }
.pager__links [aria-current="page"] { background: var(--ink); color: var(--cream); }
.pager__links .is-disabled { opacity: .45; }

/* ==========================================================================
   Boards, timeline, health
   ========================================================================== */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.board__col { background: var(--cream-50); border: var(--line); border-radius: var(--radius); padding: .75rem; min-height: 200px; }
.board__col h2 { font-size: 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.board__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.ticket { background: var(--white); border: var(--line); border-radius: 10px; padding: .7rem .8rem; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.ticket:hover, .ticket:focus-within { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.ticket a { font-weight: 600; text-decoration: none; }
.ticket a:hover { text-decoration: underline; }
.ticket__meta { display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center; margin-top: .45rem; font-size: .8rem; color: var(--ink-70); }
.ticket__move { margin-top: .55rem; display: flex; gap: .35rem; flex-wrap: wrap; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 1.1rem .9rem; }
.timeline li::before { content: ""; position: absolute; left: -1.25rem; margin-left: -8px; top: .25rem; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: var(--white); }
.timeline li.kind-status::before { background: var(--peach); }
.timeline li.kind-comment::before { background: var(--lime); }
.timeline__meta { font-size: .8rem; color: var(--ink-70); font-family: var(--font-mono); }
.timeline__body { white-space: pre-wrap; overflow-wrap: anywhere; }

.health-card { display: flex; flex-direction: column; gap: .6rem; }
.health-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.health-card h3 { margin: 0; font-size: 1.05rem; }
.health-strip { display: flex; gap: 2px; height: 22px; align-items: stretch; }
.health-strip span { flex: 1; border: 1px solid var(--ink); border-radius: 2px; background: var(--white); }
.health-strip .s-up { background: var(--lime); }
.health-strip .s-degraded { background: var(--peach); }
.health-strip .s-down { background: var(--red); }
.health-strip .s-maintenance { background: var(--ink-15); }

/* charts (hand made SVG) */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-mono); font-size: 11px; fill: var(--ink); }
.chart .axis { stroke: var(--ink); stroke-width: 1.5; }
.chart .gridline { stroke: var(--ink-15); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line--ink { stroke: var(--ink); }
.chart .area { fill: var(--cream-50); }
.chart .dot { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.chart .bar { stroke: var(--ink); stroke-width: 1.5; }
.chart .bar--a { fill: var(--ink-15); }
.chart .bar--b { fill: var(--ink-70); }
.chart .bar--c { fill: var(--cream); }
.chart .bar--bad { fill: var(--red); }
.chart .threshold { stroke: var(--ink); stroke-dasharray: 5 4; stroke-width: 1.5; }
.sparkline { width: 100%; height: 40px; display: block; }
.sparkline .line { fill: none; stroke: var(--red); stroke-width: 2; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.bars li { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: .6rem; align-items: center; font-size: .88rem; }
.bars__track { height: 16px; border: 2px solid var(--ink); border-radius: 5px; background: var(--white); overflow: hidden; }
.bars__fill { height: 100%; background: var(--ink-70); border-right: 2px solid var(--ink); }
.bars__fill--zero { border-right: 0; }
.data-toggle summary { cursor: pointer; font-size: .82rem; font-weight: 600; margin-top: .5rem; }
.meter { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--lime); border-right: 2px solid var(--ink); }
.meter--near span { background: var(--peach); }
.meter--over span { background: var(--red); }

/* ==========================================================================
   Feedback: toasts, alerts, empty states, dialog
   ========================================================================== */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .6rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .6rem; align-items: flex-start; background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; animation: toast-in .25s var(--ease); }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: .1rem; }
.toast--ok { background: var(--lime); }
.toast--bad { background: var(--peach); }
.toast__close { margin-left: auto; background: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink); padding: 0 .25rem; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.notice { display: flex; gap: .7rem; align-items: flex-start; border: var(--line); border-radius: var(--radius); padding: .85rem 1rem; background: var(--white); margin-bottom: 1rem; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: .1rem; }
.notice--info { background: var(--cream-50); }
.notice--ok { background: var(--lime-40); }
.notice--warn { background: var(--peach-40); }
.notice--bad { background: var(--red-12); }
.notice p:last-child { margin-bottom: 0; }

.copy-box { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.copy-box input { flex: 1 1 260px; font-family: var(--font-mono); font-size: .85rem; }

.empty { text-align: center; padding: 2.5rem 1rem; border: 2px dashed var(--ink); border-radius: var(--radius); background: var(--cream-50); }
.empty svg { width: 44px; height: 44px; }
.empty h3 { margin-top: .6rem; }
.empty p { color: var(--ink-70); max-width: 50ch; margin: 0 auto .9rem; }

dialog.confirm { border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 1.4rem; max-width: min(440px, calc(100vw - 2rem)); color: var(--ink); background: var(--white); }
dialog.confirm::backdrop { background: rgba(38, 7, 7, .55); }
dialog.confirm h2 { display: flex; align-items: center; gap: .5rem; }
dialog.confirm h2 svg { width: 24px; height: 24px; }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .45rem .9rem; border: var(--line); border-radius: 999px; text-decoration: none; background: var(--white); font-weight: 600; font-size: .88rem; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--cream); }

/* guest pages */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.guest__card { width: 100%; max-width: 440px; }
.guest__brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.25rem; justify-content: center; }
.guest__brand .brand__mark { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.guest__brand .brand__name { font-size: 1.6rem; }

.setup-table td, .setup-table th { font-size: .85rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-105%); transition: transform .22s var(--ease); }
  .sidebar.is-open { transform: none; box-shadow: 8px 0 0 var(--ink); }
  .scrim { position: fixed; inset: 0; background: rgba(38, 7, 7, .5); z-index: 45; }
  .topbar .topbar__menu { display: inline-flex; }
  .content { padding: 1.25rem 1rem 3rem; }
  .topbar { padding: .6rem 1rem; gap: .6rem; }
  .board { grid-template-columns: repeat(4, minmax(250px, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 1.6rem; }
  .grid--2, .grid--3, .grid--4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stat__value { font-size: 1.9rem; }
  .user-menu__name { display: none; }
  .search { max-width: none; }
  .board { grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
  .kv-row { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dd { margin-bottom: .4rem; }
  .filters .field { max-width: none; flex-basis: 100%; }
  .page-head__actions { width: 100%; }

  /* tables become stacked cards */
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { background: var(--white); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: .9rem; padding: .35rem 0; }
  .table--stack td { border: 0; padding: .35rem .9rem; display: grid; grid-template-columns: 38% 1fr; gap: .6rem; text-align: left !important; overflow-wrap: anywhere; }
  .table--stack td::before { content: attr(data-label); font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-70); padding-top: .15rem; }
  .table--stack td[data-label=""]::before { content: none; }
  .table--stack td[data-label=""] { grid-template-columns: 1fr; }
  .table--stack .row-actions { justify-content: flex-start; }
  .table--stack tbody tr:hover td { background: transparent; }
  .bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .bars__track { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover, .ticket:hover, .btn:hover, .btn:active, .ticket:focus-within { transform: none; }
}

@media print {
  body { background: var(--white); font-size: 11pt; }
  .sidebar, .topbar, .toasts, .no-print, .page-head__actions, .filters, .pager { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
  .card:hover { transform: none; }
  .badge { box-shadow: none; transform: none; }
  a { text-decoration: none; }
}
