/* FTHorizon — interface styles.
   Palette: spruce (primary), slate ink, cool grey-green paper, Baltic amber for deadlines and warnings.
   Type: IBM Plex Sans (Latin, Estonian, Cyrillic), tabular figures for amounts. */

@font-face { font-family: "Plex"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.77bc02670657.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: "Plex"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.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: "Plex"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.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: "Plex"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-700-normal.c277d7b83f8a.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: "Plex"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-400-normal.1bc0d8e41d21.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-500-normal.93a0df997e00.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-600-normal.8fccbdf5bf67.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-700-normal.46ac4a467593.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-400-normal.7dec1409f343.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-500-normal.eabefad2e9c0.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-600-normal.ff40080a5003.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-700-normal.fe1b8353cdd7.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }

/* ------------------------------------------------------------------ tokens */
:root {
  --paper: #f3f6f4;        /* page */
  --surface: #ffffff;      /* panels, tables */
  --surface-2: #eaf0ec;    /* table heads, subtotals */
  --ink: #1d2b2a;          /* text */
  --ink-2: #4d5e5b;        /* secondary text */
  --rule: #d6dfda;         /* lines */
  --rule-strong: #b7c6bf;
  --spruce: #1f5c4d;       /* primary */
  --spruce-ink: #ffffff;
  --spruce-soft: #e1eee9;
  --amber: #b4740d;        /* deadlines, warnings */
  --amber-soft: #fbf1df;
  --danger: #a3322a;
  --danger-soft: #fbeceb;
  --ok: #23704a;
  --ok-soft: #e5f3eb;
  --side: #17322b;         /* sidebar */
  --side-ink: #d7e6df;
  --side-ink-2: #8fb0a4;
  --side-active: #24493f;
  --focus: #3a8f78;
  --r-s: 4px;
  --r-m: 8px;
  --shadow-pop: 0 10px 30px rgba(14, 33, 28, .18);
  --font: "Plex", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0f1716; --surface: #16211f; --surface-2: #1c2a27; --ink: #e2ebe7; --ink-2: #9db1aa;
  --rule: #263734; --rule-strong: #35504a; --spruce: #5cb197; --spruce-ink: #0c1715; --spruce-soft: #1d3a32;
  --amber: #e2a440; --amber-soft: #33270f; --danger: #ec7d73; --danger-soft: #3a1c1a; --ok: #6cc597; --ok-soft: #173326;
  --side: #0b1311; --side-ink: #cfe0d9; --side-ink-2: #7d9b91; --side-active: #1a2e29; --focus: #7cd0b5;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1716; --surface: #16211f; --surface-2: #1c2a27; --ink: #e2ebe7; --ink-2: #9db1aa;
    --rule: #263734; --rule-strong: #35504a; --spruce: #5cb197; --spruce-ink: #0c1715; --spruce-soft: #1d3a32;
    --amber: #e2a440; --amber-soft: #33270f; --danger: #ec7d73; --danger-soft: #3a1c1a; --ok: #6cc597; --ok-soft: #173326;
    --side: #0b1311; --side-ink: #cfe0d9; --side-ink-2: #7d9b91; --side-active: #1a2e29; --focus: #7cd0b5;
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { font-family: var(--font); font-size: 15px; color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.5; background: var(--paper); font-feature-settings: "tnum" 0; }
a { color: var(--spruce); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 0 0 1.1rem; }
h2 { font-size: 1.12rem; line-height: 1.3; font-weight: 600; margin: 2rem 0 .7rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 .5rem; }
p { margin: .5rem 0 .8rem; max-width: 78ch; }
.muted { color: var(--ink-2); }
p.muted { font-size: .93rem; }
.mono { font-family: var(--mono); font-size: .92em; }
small { font-size: .85em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .4rem .7rem; z-index: 50; }
.skip:focus { left: .5rem; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--side) 252px, transparent 252px); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 0 0 1.5rem; scrollbar-width: thin; scrollbar-color: var(--side-active) transparent;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 1.05rem 1.1rem .6rem; }
.brand { display: inline-flex; align-items: center; gap: .1rem; font-weight: 600; font-size: 1.08rem; color: var(--side-ink); text-decoration: none; letter-spacing: .01em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 1.85rem; height: 1.85rem; margin-right: .45rem; border-radius: var(--r-s);
  background: var(--amber); color: #1b1305; font-weight: 700; font-size: .78rem; letter-spacing: .02em;
}
.brand-plain { color: var(--ink); }
.sidebar .sidebar-close { display: none; color: var(--side-ink); }

.client-card {
  display: grid; gap: .1rem; margin: .4rem .8rem .9rem; padding: .7rem .8rem; border-radius: var(--r-m);
  background: var(--side-active); color: var(--side-ink); text-decoration: none; border: 1px solid rgba(255, 255, 255, .06);
}
.client-card:hover { border-color: rgba(255, 255, 255, .18); }
.client-name { font-weight: 600; line-height: 1.25; }
.client-meta { font-size: .82rem; color: var(--side-ink-2); font-variant-numeric: tabular-nums; }
.client-no { color: var(--amber); font-weight: 600; }
.client-switch { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; font-size: .8rem; color: var(--side-ink-2); }
.client-switch .i { width: 14px; height: 14px; }

.nav { display: grid; gap: 1px; padding: 0 .6rem; }
.nav a {
  display: flex; align-items: center; gap: .7rem; padding: .44rem .6rem; border-radius: var(--r-s);
  color: var(--side-ink); text-decoration: none; font-size: .94rem;
}
.nav a .i { color: var(--side-ink-2); }
.nav a:hover { background: rgba(255, 255, 255, .05); }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.nav a[aria-current="page"] .i { color: var(--amber); }
.nav-group { margin: 1.05rem .6rem .3rem; font-size: .78rem; font-weight: 500; color: var(--side-ink-2); letter-spacing: .02em; }
.nav-admin { margin-top: auto; padding-top: 1rem; }
.nav-admin .nav-group { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .9rem; margin-top: 0; }

.page { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .5rem; padding: .55rem 1.6rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; }
.topbar-client { font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar form { margin: 0; }
.lang select { width: auto; padding: .28rem 1.6rem .28rem .5rem; font-size: .85rem; background-position: right .4rem center; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border-radius: var(--r-s);
  background: transparent; border: 1px solid transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.user-link { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .5rem; border-radius: var(--r-s); color: var(--ink); text-decoration: none; font-size: .9rem; }
.user-link:hover { background: var(--surface-2); }
.topbar .menu-btn { display: none; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}
main { width: 100%; max-width: 1240px; padding: 1.6rem 1.6rem 4rem; }
.scrim { position: fixed; inset: 0; background: rgba(8, 18, 16, .45); z-index: 30; }

/* ------------------------------------------------------------------ panels */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.empty { padding: 2.4rem 1.2rem; }
.narrow { max-width: 460px; margin: 3rem auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.cards a.card { display: block; text-decoration: none; color: var(--ink); margin: 0; }
.cards a.card:hover { border-color: var(--spruce); }
.cards a.card h2, .cards a.card h3 { margin: 0 0 .3rem; color: var(--spruce); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .2rem 1.1rem; }
.card.grid { gap: .9rem 1.4rem; }
.card.grid > div > .muted:first-child { font-size: .84rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.2rem; padding: .25rem; background: var(--surface-2); border-radius: var(--r-m); width: fit-content; max-width: 100%; }
.tabs a { padding: .35rem .8rem; border-radius: var(--r-s); text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
details { margin: .6rem 0; }
details > summary { cursor: pointer; color: var(--spruce); font-weight: 500; padding: .3rem 0; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); margin-bottom: 1rem; }
.table-wrap table { border: none; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
thead th { font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--spruce-soft) 45%, transparent); }
.card table th, .card table td { padding-left: 0; }
.card table thead th { background: transparent; }
td.num, th.num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td, tr.total th { font-weight: 650; border-top: 2px solid var(--ink); background: var(--surface); }
tr.subtotal td { font-weight: 600; background: var(--surface-2); }
tr.section th { background: var(--surface-2); color: var(--ink); font-size: .86rem; }
tr.muted td { color: var(--ink-2); }
td.empty, .empty { text-align: center; padding: 2.2rem 1rem; color: var(--ink-2); }
.lines input, .lines select { padding: .32rem .4rem; font-size: .9rem; }
.lines td { padding: .3rem .35rem; }
.lines .w-num { width: 7.5rem; }
.lines .w-sm { width: 5rem; }

/* ------------------------------------------------------------------ forms */
label { display: block; font-weight: 500; font-size: .9rem; margin: .8rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month],
input[type=search], input[type=tel], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--rule-strong); border-radius: var(--r-s);
  font: inherit; color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--spruce); box-shadow: 0 0 0 3px color-mix(in srgb, var(--spruce) 22%, transparent); }
select {
  appearance: none; padding-right: 2rem; background-repeat: no-repeat; background-position: right .6rem center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23778a85' stroke-width='1.6'/%3E%3C/svg%3E");
}
textarea { min-height: 4.5rem; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; accent-color: var(--spruce); }
.helptext { display: block; color: var(--ink-2); font-size: .84rem; margin-top: .25rem; }
.errorlist { color: var(--danger); margin: .3rem 0; padding-left: 1.1rem; font-size: .88rem; }
.field.check { display: flex; align-items: flex-start; gap: .55rem; flex-wrap: wrap; padding-top: .9rem; }
.field.check label { order: 2; margin: 0; font-weight: 500; flex: 1; }
.field.check input { order: 1; margin-top: .2rem; }
.field.check .helptext, .field.check .errorlist { order: 3; flex-basis: 100%; padding-left: 1.6rem; }
.grid .field textarea { min-height: 4rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.toolbar form { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin: 0; }
.toolbar label { margin: 0 0 .25rem; font-size: .84rem; }
.toolbar input, .toolbar select { width: auto; }

/* ------------------------------------------------------------------ buttons */
button, .button {
  display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-weight: 500; font-size: .94rem; line-height: 1.2;
  padding: .52rem 1rem; border-radius: var(--r-s); border: 1px solid var(--spruce); background: var(--spruce);
  color: var(--spruce-ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
button.secondary, .button.secondary { background: var(--surface); color: var(--spruce); border-color: var(--rule-strong); }
button.secondary:hover, .button.secondary:hover { border-color: var(--spruce); filter: none; }
button.danger, .button.danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--rule)); }
button.danger:hover { background: var(--danger-soft); filter: none; }
button.link { background: none; border: none; color: var(--spruce); padding: 0; text-decoration: underline; font-weight: 400; }
.actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: 1.1rem; align-items: center; }
.inline { display: inline-flex; gap: .45rem; align-items: center; margin: 0; flex-wrap: wrap; }
.inline select, .inline input { width: auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head h1 { margin: 0; }

/* ------------------------------------------------------------------ messages, badges */
.messages { list-style: none; padding: 0; margin: 0 0 1.1rem; display: grid; gap: .45rem; }
.messages li { padding: .65rem .9rem; border-radius: var(--r-m); border: 1px solid var(--rule); background: var(--surface); border-left-width: 4px; }
.messages .success { border-color: var(--ok); background: var(--ok-soft); }
.messages .error { border-color: var(--danger); background: var(--danger-soft); }
.messages .warning { border-color: var(--amber); background: var(--amber-soft); }
.messages .info { border-color: var(--spruce); background: var(--spruce-soft); }
.badge {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 500; line-height: 1.4; padding: .08rem .5rem;
  border-radius: 99px; background: var(--surface-2); color: var(--ink-2); vertical-align: middle; white-space: nowrap;
}
.badge::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.draft, .badge.archived, .badge.warn, .badge.job-queued, .badge.job-running { background: var(--amber-soft); color: var(--amber); }
.badge.issued, .badge.posted, .badge.ok, .badge.job-ok { background: var(--ok-soft); color: var(--ok); }
.badge.cancelled, .badge.bad, .badge.job-failed { background: var(--danger-soft); color: var(--danger); }
.codes { columns: 2; font-family: var(--mono); font-size: 1.05rem; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: var(--r-s); }

/* ------------------------------------------------------------------ client dashboard */
.deadlines { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; margin: 0 0 1.6rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; }
.deadline { display: grid; grid-template-columns: auto 1fr; gap: .1rem .9rem; padding: .95rem 1.1rem; border-right: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; position: relative; }
.deadline:last-child { border-right: none; }
.deadline:hover { background: var(--surface-2); }
.deadline-date { grid-row: span 2; display: grid; place-items: center; width: 3.3rem; height: 3.3rem; border-radius: var(--r-m);
  background: var(--surface-2); line-height: 1; text-align: center; }
.deadline-date b { display: block; font-size: 1.35rem; font-weight: 600; }
.deadline-date small { display: block; font-size: .72rem; color: var(--ink-2); margin-top: .15rem; }
.deadline-title { font-weight: 600; align-self: end; }
.deadline-note { font-size: .86rem; color: var(--ink-2); }
.deadline.soon .deadline-date { background: var(--amber-soft); color: var(--amber); }
.deadline.soon .deadline-date small { color: var(--amber); }
.deadline.overdue .deadline-date { background: var(--danger-soft); color: var(--danger); }
.deadline.done .deadline-date { background: var(--ok-soft); color: var(--ok); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; margin-bottom: 1.6rem; }
.figure { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 1rem 1.1rem; color: var(--ink); text-decoration: none; }
a.figure:hover { border-color: var(--spruce); }
.figure-label { font-size: .88rem; color: var(--ink-2); }
.figure-value { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin: .15rem 0 .1rem; }
.figure-note { font-size: .84rem; color: var(--ink-2); }
.figure-note.warn { color: var(--amber); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.kv { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .45rem 1.2rem; margin: 0; }
.kv dt { color: var(--ink-2); font-size: .9rem; }
.kv dd { margin: 0; }

/* ------------------------------------------------------------------ administration */
.status-list { display: grid; gap: 0; }
.status-row { display: grid; grid-template-columns: 1.6rem minmax(9rem, 14rem) 1fr; gap: .7rem; align-items: start; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.status-row:last-child { border-bottom: none; }
.status-row .i { margin-top: .15rem; }
.status-row.is-ok .i { color: var(--ok); }
.status-row.is-warn .i { color: var(--amber); }
.status-row.is-off .i { color: var(--ink-2); }
.status-row strong { font-weight: 600; }
.log {
  margin: 0; max-height: 60vh; overflow: auto; padding: 1rem 1.1rem; border-radius: var(--r-m); background: #0d1513; color: #cfe3da;
  font-family: var(--mono); font-size: .82rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.command-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.command-grid form { margin: 0; }
.command-grid button { width: 100%; justify-content: center; }
.secret-state { display: inline-flex; align-items: center; gap: .3rem; font-size: .84rem; color: var(--ok); margin-top: .25rem; }

/* ------------------------------------------------------------------ sign-in pages */
.auth-shell { display: grid; grid-template-columns: minmax(280px, 40%) 1fr; min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; background: var(--side); color: var(--side-ink); padding: 2.2rem 2.4rem; display: flex; flex-direction: column; gap: 1.4rem; }
.auth-tagline { font-size: 1.35rem; line-height: 1.35; font-weight: 500; max-width: 22ch; color: #fff; margin-top: auto; }
.auth-ledger { position: absolute; left: 0; top: 16%; width: 100%; color: var(--side-ink-2); opacity: .18; pointer-events: none; }
.auth-tagline { position: relative; }
.auth-main { display: flex; flex-direction: column; padding: 1.4rem 1.6rem 3rem; max-width: none; }
.auth-tools { display: flex; justify-content: flex-end; gap: .4rem; }
.auth-card { width: 100%; max-width: 420px; margin: auto; padding: 1rem 0; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card button[type=submit] { width: 100%; justify-content: center; margin-top: .4rem; }
.auth-brand-mobile { display: none; margin-bottom: 1.4rem; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: var(--shadow-pop); }
  .nav-open .sidebar { transform: none; }
  .sidebar .sidebar-close, .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: .5rem 1rem; }
  .user-link span { display: none; }
  main { padding: 1.1rem 1rem 3rem; }
  h1 { font-size: 1.35rem; }
  .deadline { border-right: none; border-bottom: 1px solid var(--rule); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .figure { padding: .8rem .85rem; }
  .figure-value { font-size: 1.15rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-brand-mobile { display: inline-flex; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd { margin-bottom: .5rem; }
  .status-row { grid-template-columns: 1.6rem 1fr; }
  .status-row > :last-child { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ print */
@media print {
  .sidebar, .topbar, .actions, .scrim, .skip { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card, .table-wrap { border-color: #999; }
}
.status-row .kv { margin: .6rem 0 .2rem; font-size: .9rem; }
/* tables placed directly on the page (not in .table-wrap or a card) */
main > table, main > form > table, main > section > table, main > div:not(.card):not(.table-wrap) > table {
  border: 1px solid var(--rule); border-radius: var(--r-m); border-collapse: separate; border-spacing: 0; overflow: hidden; margin-bottom: 1rem;
}
td.ok { color: var(--ok); font-weight: 600; }
td.bad { color: var(--danger); font-weight: 600; }
