/* Techdesk design system. Tokens on :root so a partner theme can override them (white-labelling). */
:root {
  --brand: #181854;          /* navy: header, primary actions, headings */
  --brand-hover: #2a2a8a;
  --brand-tint: #ecedf7;     /* icon tiles, SLA tags */
  --brand-ink: #ffffff;      /* text on --brand */
  --accent: #FCB400;         /* amber: header rule, mark, "ends soon" */
  --accent-ink: #181854;
  --page: #f1f5f9;
  --card: #ffffff;
  --raised: #f8fafc;         /* table heads, zebra */
  --zebra: #fbfcfe;
  --border: #e2e8f0;
  --border-soft: #eef2f7;
  --border-input: #cbd5e1;
  --text: #334155;
  --muted: #586577;          /* 5.4:1 on --page, 5.9:1 on --card */
  --faint: #586577;
  --heading: #181854;
  --link: #181854;
  --link-hover: #2a2a8a;
  --primary: var(--brand);
  --primary-ink: #ffffff;
  --primary-hover: var(--brand-hover);
  --danger: #b91c1c;
  --danger-tint: #fef2f2;
  --focus: #181854;
  --header-bg: var(--brand);
  --header-ink: #ffffff;
  --header-muted: #cbd5e1;
  --avatar: #2c2c75;
  --badge-soon-bg: #FCB400;  --badge-soon-ink: #181854;
  --badge-warn-bg: #fff4d1;  --badge-warn-ink: #7a5300;
  --badge-ok-bg: #e7f5ee;    --badge-ok-ink: #14532d;
  --badge-exp-bg: #f1f5f9;   --badge-exp-ink: #475569;
  --bar-track: #eef2f7;
  --dot-1: #181854; --dot-2: #5b5ba8; --dot-3: #a5a5d6; --dot-4: #cfcfe8; --dot-5: #94a3b8;
  --s-1: #181854; --s-2: #3d3d8f; --s-3: #6f6fb8; --s-4: #a5a5d6; --s-other: #94a3b8; --seg-gap: #ffffff;
  --split-30: #FCB400; --split-60: #f8d77a; --split-90: #fbe9b5;
  --good: #14532d;
  --notice-bg: #ecedf7; --notice-ink: #181854; --notice-rule: #181854;
  --error-bg: #fef2f2; --error-ink: #7f1d1d; --error-rule: #b91c1c;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(24, 24, 84, .08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #020617;
    --card: #0f172a;
    --raised: #111c33;
    --zebra: #0c1528;
    --border: #1e293b;
    --border-soft: #1e293b;
    --border-input: #334155;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --faint: #94a3b8;
    --heading: #f8fafc;
    --link: #FCB400;
    --link-hover: #ffd25c;
    --brand-tint: #1e1e4a;
    --primary: #FCB400;
    --primary-ink: #181854;
    --primary-hover: #ffc933;
    --danger: #f87171;
    --danger-tint: #2a0f12;
    --focus: #FCB400;
    --header-bg: #0f172a;
    --header-muted: #cbd5e1;
    --avatar: #2c2c75;
    --badge-exp-bg: #1e293b;   --badge-exp-ink: #cbd5e1;
    --bar-track: #1e293b;
    --dot-1: #FCB400; --dot-2: #a5a5d6; --dot-3: #7c7cc4; --dot-4: #5b5ba8; --dot-5: #64748b;
    --s-1: #c7c7ec; --s-2: #9a9ad6; --s-3: #6f6fb8; --s-4: #4a4a96; --s-other: #64748b; --seg-gap: #0f172a;
    --split-30: #FCB400; --split-60: #b7861a; --split-90: #6b5418;
    --good: #86efac;
    --notice-bg: #1e1e4a; --notice-ink: #e2e8f0; --notice-rule: #FCB400;
    --error-bg: #2a0f12; --error-ink: #fecaca; --error-rule: #f87171;
    --shadow: none;
    --shadow-lg: none;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--page); color: var(--text);
       font: 14px/1.5 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
/* links inside running text are underlined; nav, buttons and card-head links are not */
p a, dd a, .notice a, .label-row a, .auth-note a, .auth-foot a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--heading); font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 16px; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); }
svg { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
           white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 10; padding: 8px 14px; border-radius: var(--radius-sm);
        background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip:focus { top: 8px; }

/* ---------- header ---------- */
.site-header { background: var(--header-bg); border-bottom: 4px solid var(--accent); color: var(--header-ink); }
.header-inner { max-width: 1320px; margin: 0 auto; padding: 0 32px; min-height: 64px; display: flex; flex-wrap: wrap;
                align-items: center; gap: 12px 40px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--header-ink); }
.brand:hover { color: var(--header-ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
              display: flex; align-items: center; justify-content: center; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a { color: var(--header-muted); padding: 8px 14px; border-radius: 6px; font-weight: 500; }
.nav a:hover { color: var(--header-ink); background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--header-ink); background: rgba(255, 255, 255, .12); font-weight: 600; }
.site-header :focus-visible { outline-color: var(--accent); }
.who { display: flex; align-items: center; gap: 12px; }
.who-text { text-align: right; line-height: 1.25; }
.who-name { display: block; color: var(--header-ink); font-weight: 600; }
.who-org { display: block; color: var(--accent); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--avatar); color: #fff; display: flex;
          align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.signout { margin: 0; }
.btn-header { height: 34px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 6px;
              background: transparent; color: var(--header-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-header:hover { background: rgba(255, 255, 255, .1); }

/* ---------- layout ---------- */
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 32px; flex: 1 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px;
             margin-bottom: 24px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.page-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; color: var(--muted); }
.page-sub .mono { color: var(--heading); font-weight: 600; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.asof { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.site-footer { width: 100%; max-width: 1320px; margin: 0 auto; padding: 8px 32px 32px; color: var(--faint); font-size: 12px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
        min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
             padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head a { font-size: 13px; font-weight: 600; }
.card-body { padding: 18px 22px; }
.card-body > :last-child { margin-bottom: 0; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
             padding: 14px 22px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.page > .card + .card, .page > .card + .grid-main, .page > .grid-main + .card, .page > .grid-2 + .card,
.section-gap { margin-top: 20px; }
.empty { padding: 18px 22px; color: var(--muted); }

/* ---------- staff overview (dashboard) ---------- */
.staff-overview { display: grid; gap: 20px; margin-top: 20px; }
.activity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; }
.activity-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.activity-when { flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
.fault-failed { border-top: 1px solid var(--border); }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.kpi { padding: 20px 22px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-tint); color: var(--heading);
            display: flex; align-items: center; justify-content: center; }
.kpi-value { font-size: 32px; font-weight: 600; color: var(--heading); line-height: 1; }
.kpi-sub { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* dashboard v2 tiles */
.kpi > .kpi-label { display: block; margin-bottom: 12px; }
.kpi-line { display: flex; align-items: baseline; gap: 8px; }
.kpi-line .kpi-value { font-size: 34px; }
.kpi-unit { color: var(--muted); }
.kpi-date { font-size: 22px; font-weight: 600; color: var(--heading); line-height: 1.2; }
.kpi .kpi-sub { margin-top: 10px; font-size: 13px; overflow-wrap: anywhere; }
.kpi-sub a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.kpi-good { color: var(--good); font-weight: 600; }
.kpi-accent { border-top: 4px solid var(--accent); }
.split { margin-top: 12px; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bar-track); }
.split > span { display: block; height: 100%; }
.split-30 { background: var(--split-30); } .split-60 { background: var(--split-60); } .split-90 { background: var(--split-90); }
.split-legend { margin-top: 8px; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.page-actions-center { align-items: center; gap: 16px; }
.page-actions-center .asof { margin: 0; }

/* renewals chart: heights are .h-N (percent of the plot); series colours are .s-N classes (CSP: no inline styles) */
.card-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.chart-card { margin-bottom: 24px; }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.s-1 { background: var(--s-1); } .s-2 { background: var(--s-2); } .s-3 { background: var(--s-3); }
.s-4 { background: var(--s-4); } .s-other { background: var(--s-other); }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 22px 22px 18px; }
.chart { min-width: 560px; }
.chart-plot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: end; height: 200px;
              padding-top: 22px; border-bottom: 1px solid var(--border); }
.bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; border-radius: 4px 4px 0 0; }
.bar:hover { text-decoration: none; }
.bar:hover .seg { filter: brightness(1.15); }
.bar-stack { position: relative; display: flex; flex-direction: column; min-height: 0; }
.bar-total { position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 4px; text-align: center; font-size: 12px;
             font-weight: 600; color: var(--heading); }
.seg { display: block; min-height: 2px; }
.seg + .seg { border-top: 2px solid var(--seg-gap); }
.bar-total + .seg { border-radius: 4px 4px 0 0; }
.chart-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin-top: 8px; text-align: center;
                font-size: 12px; color: var(--muted); }
.h-0 { height: 0; } .h-5 { height: 5%; } .h-10 { height: 10%; } .h-15 { height: 15%; } .h-20 { height: 20%; }
.h-25 { height: 25%; } .h-30 { height: 30%; } .h-35 { height: 35%; } .h-40 { height: 40%; } .h-45 { height: 45%; }
.h-50 { height: 50%; } .h-55 { height: 55%; } .h-60 { height: 60%; } .h-65 { height: 65%; } .h-70 { height: 70%; }
.h-75 { height: 75%; } .h-80 { height: 80%; } .h-85 { height: 85%; } .h-90 { height: 90%; } .h-95 { height: 95%; }
.h-100 { height: 100%; }

/* due list + client list */
.grid-due { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-due-solo { grid-template-columns: minmax(0, 1fr); }
.due-month { display: flex; justify-content: space-between; padding: 10px 22px; background: var(--raised);
             border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 600; color: var(--muted);
             text-transform: uppercase; letter-spacing: .6px; }
.due-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 22px;
           border-bottom: 1px solid var(--border-soft); }
.due-day { font-weight: 600; color: var(--heading); white-space: nowrap; }
.due-main { min-width: 0; overflow-wrap: anywhere; }
.due-main a { font-size: 12px; }
.org-list { list-style: none; margin: 0; padding: 0; }
.org-list > li { border-top: 1px solid var(--border-soft); }
.org-list > li:first-child { border-top: 0; }
.org-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; color: var(--text); }
a.org-row:hover { background: var(--raised); text-decoration: none; color: var(--text); }
.org-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.org-next { text-align: right; white-space: nowrap; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 12px; background: var(--raised); text-align: left; font-size: 12px; font-weight: 600;
            color: var(--muted); text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
.table td { padding: 12px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr:nth-child(even) { background: var(--zebra); }
.table .serial { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table .num { text-align: right; }
.cell-main { display: block; font-weight: 600; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- badges & tags ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-soon { background: var(--badge-soon-bg); color: var(--badge-soon-ink); }
.badge-warn { background: var(--badge-warn-bg); color: var(--badge-warn-ink); }
.badge-ok { background: var(--badge-ok-bg); color: var(--badge-ok-ink); }
.badge-expired { background: var(--badge-exp-bg); color: var(--badge-exp-ink); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--brand-tint); color: var(--heading);
       font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- bars & dots ---------- */
.meter { margin-bottom: 14px; }
.meter:last-child { margin-bottom: 0; }
.meter-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 6px; }
.meter-label span:first-child { font-weight: 600; overflow-wrap: anywhere; }
.meter-label span:last-child { color: var(--muted); white-space: nowrap; }
.bar-track { height: 8px; border-radius: 4px; background: var(--bar-track); overflow: hidden; }
.bar-fill { height: 8px; border-radius: 4px; background: var(--dot-1); }
.bar-fill.accent { background: var(--accent); }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; }
.w-100 { width: 100%; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0;
             border-top: 1px solid var(--border-soft); }
.legend li:first-child { border-top: 0; padding-top: 0; }
.legend .name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.legend .count { color: var(--muted); white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-1 { background: var(--dot-1); } .dot-2 { background: var(--dot-2); } .dot-3 { background: var(--dot-3); }
.dot-4 { background: var(--dot-4); } .dot-5 { background: var(--dot-5); }

/* ---------- forms & buttons ---------- */
label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
input, select, textarea { min-height: 40px; width: 100%; padding: 0 12px; border: 1px solid var(--border-input);
                          border-radius: var(--radius-sm); background: var(--card); color: var(--text);
                          font: inherit; font-size: 14px; font-weight: 400; }
input[readonly] { background: var(--raised); color: var(--muted); }
input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack button[type="submit"] { margin-top: 6px; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-row label { flex: 1 1 200px; }
.form-row > div, .form-row > button { flex: 0 0 auto; }
.table .form-row { flex-wrap: nowrap; gap: 8px; }
.table .form-row input, .table .form-row select { min-width: 160px; }
.inline-form { display: inline-flex; margin: 0; }
.label-row { display: flex; justify-content: space-between; gap: 8px; }

button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
               padding: 0 16px; border: 1px solid var(--primary); border-radius: var(--radius-sm);
               background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 600;
               cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-ink);
                           text-decoration: none; }
.btn-ghost, button.btn-ghost { background: var(--card); color: var(--link); border-color: var(--border-input); }
.btn-ghost:hover, button.btn-ghost:hover { background: var(--raised); color: var(--link-hover); border-color: var(--border-input); }
.danger, button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.danger:hover, button.danger:hover { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }
.btn-sm, button.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; min-height: 46px; font-size: 15px; }

/* asset filter bar */
.filters { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(5, minmax(0, 1fr)) auto; gap: 12px;
           padding: 18px 22px; border-bottom: 1px solid var(--border); align-items: end; }
.filters label { font-size: 12px; color: var(--muted); }
.input-icon { position: relative; display: block; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 36px; }
.filters-simple { grid-template-columns: minmax(0, 1fr) auto; }
.filters-contracts { grid-template-columns: minmax(0, 2.2fr) repeat(2, minmax(0, 1fr)) auto; }
.results { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
           padding: 12px 22px; font-size: 13px; color: var(--muted); }
.results strong { color: var(--heading); }

/* pagination */
.pager { display: flex; flex-wrap: wrap; gap: 6px; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center;
                        justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border-input);
                        color: var(--link); font-weight: 600; }
.pager a:hover { background: var(--raised); text-decoration: none; }
.pager [aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pager .gap { border: 0; min-width: 16px; padding: 0; color: var(--muted); }

/* segmented tabs */
.tabs { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.tabs a { min-height: 36px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 7px; color: var(--muted);
          font-weight: 600; }
.tabs a:hover { color: var(--link); background: var(--raised); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); }

/* notices */
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-sm);
          background: var(--notice-bg); color: var(--notice-ink); border-left: 4px solid var(--notice-rule); font-weight: 500; }
.notice-error { background: var(--error-bg); color: var(--error-ink); border-left-color: var(--error-rule); }

/* definition lists */
.spec { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spec > div { padding: 14px 22px; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.spec dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.spec dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.kv { margin: 0; padding: 6px 22px 12px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.cover-sla { font-size: 28px; font-weight: 600; color: var(--heading); line-height: 1.2; }
.cover-type { margin: 4px 0 16px; color: var(--muted); }
.cover-dates { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* stat list (admin home) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-bottom: 24px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-top: 1px solid var(--border-soft); }
.link-list li:first-child { border-top: 0; }
.link-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; font-weight: 600; }
.link-list .muted { font-weight: 400; }

/* ---------- signed-out (auth) layout ---------- */
.auth { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-card { padding: 36px 36px 30px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lead { margin: 0 0 26px; color: var(--muted); }
.auth-note { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft);
             color: var(--muted); font-size: 13px; }
.auth-foot { margin: 18px 0 0; text-align: center; color: var(--faint); font-size: 12px; }
.steps { list-style: none; margin: 0 0 20px; padding: 0; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 18px 40px; counter-increment: step; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
                      background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px;
                      display: flex; align-items: center; justify-content: center; }
.steps > li > p { margin: 2px 0 10px; }
.qr { display: block; width: 200px; height: 200px; padding: 8px; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.secret { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 6px; background: var(--raised); border: 1px solid var(--border);
          font-size: 13px; letter-spacing: 1px; word-break: break-all; color: var(--heading); }

/* contracts */
.contract-sla { min-width: 180px; }
.contract-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.contract-head .spec { border-right: 1px solid var(--border-soft); }
.contract-renewals .kpi-label { display: block; }

/* tickets (summary only) */
.ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px;
              border-bottom: 1px solid var(--border-soft); overflow-wrap: anywhere; }
.ticket-row:last-child { border-bottom: 0; }
.ticket-num { font-weight: 600; color: var(--heading); }
.ticket-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
                padding: 14px 22px; margin: -8px 0 24px; color: var(--muted); }
.ticket-strip-value { font-size: 20px; font-weight: 600; color: var(--heading); margin-right: 4px; }
.ticket-strip a { font-size: 13px; font-weight: 600; }

/* report a fault */
.fault-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }
textarea { min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
[aria-invalid="true"] { border-color: var(--error-rule); }
.field-error { font-size: 12px; font-weight: 600; color: var(--error-ink); }
.impact { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.impact legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.impact-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.impact-option { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px; cursor: pointer;
                 border: 1px solid var(--border-input); border-radius: var(--radius-sm); background: var(--card); }
.impact-option:has(input:checked) { border-color: var(--primary); background: var(--raised); }
.impact-option input { width: auto; min-height: 0; margin: 2px 0 0; accent-color: var(--primary); }
.impact-label { display: block; font-weight: 600; }
.impact-hint { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.fault-submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
                padding-top: 6px; }
.fault-submit button { margin-top: 0; }
button[disabled], button[disabled]:hover { opacity: .55; cursor: not-allowed; background: var(--primary);
                                           border-color: var(--primary); }
.fault-row-ref { font-weight: 600; color: var(--heading); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-due, .contract-head, .fault-grid { grid-template-columns: minmax(0, 1fr); }
  .contract-head .spec { border-right: 0; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .f-search { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .header-inner { padding: 10px 16px; gap: 10px 16px; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a { padding: 8px 10px; }
  .who { margin-left: auto; }
  .who-text { display: none; }
  .page { padding: 20px 16px; }
  .site-footer { padding: 8px 16px 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 26px; }
  .table { min-width: 640px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .spec { grid-template-columns: minmax(0, 1fr); }
  .impact-options { grid-template-columns: minmax(0, 1fr); }
  .card-head, .card-body, .results, .card-foot, .kv, .spec > div, .link-list a,
  .chart-scroll, .due-month, .due-row, .org-row, .ticket-row, .ticket-strip, .activity-row { padding-left: 16px; padding-right: 16px; }
  .kpi-line .kpi-value { font-size: 28px; }
  .due-row { grid-template-columns: 52px minmax(0, 1fr); }
  .due-row .badge { grid-column: 2; justify-self: start; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .auth-card { padding: 28px 20px 24px; }
  h1 { font-size: 22px; }
}
@media (max-width: 380px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
