/* ==========================================================================
   UltraPay visual identity (v2: calm and light)
   --------------------------------------------------------------------------
   Mostly white and soft neutral greys, generous but efficient spacing, and a
   single gentle accent: a soft msasa copper, used sparingly for the primary
   action, the current state and key figures. Status colours are muted so
   that data stays the focus.
   Type is Geist throughout, with Geist Mono for figures in tables.
   Fonts load from Google Fonts in development; local installs must bundle
   them under wwwroot/fonts before release (no internet assumed on site).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap");

:root {
  --bg: #f7f7f6;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --hover: #f2f2f0;
  --ink: #15171a;
  --ink-2: #4f555d;
  --ink-3: #868c94;
  --line: #ebebe8;
  --line-2: #dededa;

  --accent: #b5633e;
  --accent-strong: #97502f;
  --accent-wash: #f8eee8;
  --accent-ink: #ffffff;

  --good: #2f7a57;
  --good-wash: #e8f3ed;
  --warn: #a8701a;
  --warn-wash: #faf1e1;
  --info: #3b6a9e;
  --info-wash: #e9f0f8;
  --bad: #b8432a;
  --bad-wash: #fbeae5;

  --tile-copper: #fcebe2;
  --tile-green: #e1f4ea;
  --tile-blue: #e3edfc;
  --tile-plum: #f1e6f9;
  --tile-amber: #fdf2d9;
  --tile-rose: #fce6ec;

  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 1px 1px rgba(20, 22, 26, .02);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}

/* Light is the default for everyone. Dark mode applies only when the user
   chooses it with the theme switch, which sets data-theme="dark". */
:root[data-theme="dark"] {
  --bg: #0f1012;
  --surface: #16181b;
  --surface-2: #1a1c20;
  --hover: #1f2226;
  --ink: #eceef0;
  --ink-2: #a9aeb5;
  --ink-3: #737981;
  --line: #25282c;
  --line-2: #30343a;
  --accent: #df8a62;
  --accent-strong: #eaa17e;
  --accent-wash: #2b1d16;
  --accent-ink: #1a0f0a;
  --good: #6fbf97;
  --good-wash: #15261d;
  --warn: #e2b058;
  --warn-wash: #2a2111;
  --info: #86b0dc;
  --info-wash: #152131;
  --bad: #ec8a74;
  --bad-wash: #2d1712;
  --tile-copper: #2e1d15;
  --tile-green: #142a1e;
  --tile-blue: #15223a;
  --tile-plum: #261a31;
  --tile-amber: #2e2410;
  --tile-rose: #301820;
  --shadow: none;
  color-scheme: dark;
}

/* ---------- Colour icons -------------------------------------------------- */

.cicon { flex: none; display: block; }

.tile {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
}
.tile-copper { background: var(--tile-copper); }
.tile-green { background: var(--tile-green); }
.tile-blue { background: var(--tile-blue); }
.tile-plum { background: var(--tile-plum); }
.tile-amber { background: var(--tile-amber); }
.tile-rose { background: var(--tile-rose); }

/* ---------- Base ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1:focus { outline: none; }
a { color: inherit; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Shell --------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 18px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; color: var(--ink); }
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }

.company {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
}
.company-badge {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-wash); color: var(--accent-strong);
  font-weight: 650; font-size: 12px;
}
.company-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.company-meta { color: var(--ink-3); font-size: 12px; }
.company .chev { margin-left: auto; color: var(--ink-3); }

.search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  color: var(--ink-3); font-size: 13px;
}
.search kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { color: var(--ink-3); font-size: 11.5px; font-weight: 500; padding: 14px 10px 4px; }

.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.active { background: var(--hover); color: var(--ink); }
.nav a.active .icon { color: var(--accent); }
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--accent-strong); background: var(--accent-wash);
  border-radius: 999px; padding: 0 7px;
}

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }

.theme-switch {
  display: flex; align-items: center; gap: 8px;
  margin: 0 4px; padding: 6px 8px;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  cursor: pointer; text-align: left;
}
.theme-switch:hover { background: var(--hover); color: var(--ink); }
.theme-switch .when-dark { display: none; }
:root[data-theme="dark"] .theme-switch .when-dark { display: inline-flex; align-items: center; gap: 8px; }
:root[data-theme="dark"] .theme-switch .when-light { display: none; }
.theme-switch .when-light { display: inline-flex; align-items: center; gap: 8px; }
.rules-status { display: flex; gap: 9px; font-size: 12px; color: var(--ink-3); padding: 0 8px; line-height: 1.4; }
.rules-status strong { color: var(--ink-2); font-weight: 600; display: block; }
.dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--warn); }

.main { min-width: 0; padding: 22px clamp(16px, 3vw, 36px) 48px; }

/* ---------- Page header --------------------------------------------------- */

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  border-radius: 999px; padding: 3px 10px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface);
}
.pill-warn { border-color: transparent; background: var(--warn-wash); color: var(--warn); }

/* ---------- Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 550; font-size: 13.5px;
  border-radius: var(--radius-s); padding: 8px 14px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--hover); }
.btn-icon { padding: 7px; }

/* ---------- Grid and cards ------------------------------------------------ */

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 14px; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.card-head a { font-size: 12.5px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.card-head a:hover { color: var(--accent); }
.card-body { padding: 16px 18px; }

/* KPI tiles */

.kpi { padding: 14px 16px; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; color: var(--ink-2); }
.kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.kpi-value small { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-right: 4px; font-family: var(--font); }
.kpi-foot { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.delta { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
.delta.up { color: var(--good); }
.delta.flat { color: var(--ink-3); }

/* Pay run card */

.payrun { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 8px; padding: 20px 22px 18px; position: relative; overflow: hidden; }
.payrun-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.payrun-title h2 { font-size: 18px; }
.status { font-size: 12px; font-weight: 550; border-radius: 999px; padding: 2px 9px; }
.status-review { background: var(--accent-wash); color: var(--accent-strong); }
.status-draft { background: var(--hover); color: var(--ink-2); }
.status-approved { background: var(--info-wash); color: var(--info); }
.status-done { background: var(--good-wash); color: var(--good); }

/* Sign-in */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.auth-shell > .payrun-art { position: absolute; right: 4vw; bottom: 0; width: min(360px, 60vw); opacity: .9; pointer-events: none; }
.auth-card {
  position: relative; z-index: 1; width: min(400px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 40px -20px rgba(20, 22, 26, .25); padding: 28px;
}
.auth-brand { padding: 0 0 22px; }
.auth-title { font-size: 22px; }
.auth-sub { margin: 4px 0 18px; color: var(--ink-2); }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; }
.field input {
  font: inherit; font-size: 14px; font-weight: 400; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-s);
  padding: 9px 11px;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.field-error { color: var(--bad); font-size: 12px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.btn-block { width: 100%; padding: 10px 14px; }

.notice { border-radius: var(--radius-s); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.notice-bad { background: var(--bad-wash); color: var(--bad); }
.notice-good { background: var(--good-wash); color: var(--good); }
.notice-info { background: var(--info-wash); color: var(--info); }

/* Signed-in user in the sidebar */
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.me-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
  background: var(--accent-wash); color: var(--accent-strong);
}
.me-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.me-role { font-size: 11.5px; color: var(--ink-3); }
.me form { margin-left: auto; }
.linklike { font: inherit; font-size: 12px; color: var(--ink-2); background: none; border: 0; padding: 4px; cursor: pointer; }
.linklike:hover { color: var(--accent-strong); text-decoration: underline; }

/* Pay run actions */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: contents; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.hint { font-size: 12.5px; color: var(--ink-3); }

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

.row-link { text-decoration: none; }
.row-link:hover { color: var(--accent-strong); text-decoration: underline; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--accent-strong); }
.register td { white-space: nowrap; }
.register td:first-child { white-space: normal; min-width: 180px; }
.zwg { font-family: var(--font); font-size: 10.5px; color: var(--ink-3); margin-right: 2px; }

.empty { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { font-size: 17px; }
.empty p { margin: 0; color: var(--ink-2); max-width: 46ch; }
.payrun-meta { color: var(--ink-2); margin: 4px 0 18px; }
.payrun-meta b { color: var(--ink); font-weight: 600; }

.stepper { display: flex; list-style: none; margin: 0 0 18px; padding: 0; }
.step { flex: 1; position: relative; font-size: 12px; color: var(--ink-3); padding-top: 18px; }
.step::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--line-2); }
.step::after {
  content: ""; position: absolute; top: 0; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-2);
}
.step.done { color: var(--ink-2); }
.step.done::before { background: var(--good); }
.step.done::after { background: var(--good); border-color: var(--good); }
.step.now { color: var(--ink); font-weight: 600; }
.step.now::before { background: linear-gradient(90deg, var(--accent) 30%, var(--line-2) 30%); }
.step.now::after { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.step:last-child { flex: 0 0 auto; }
.step:last-child::before { display: none; }
.step { padding-right: 8px; white-space: nowrap; }

.payrun-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 16px; }
.fig { padding: 10px 12px; border-right: 1px solid var(--line); min-width: 0; }
.fig:last-child { border-right: 0; }
.fig-label { font-size: 11.5px; color: var(--ink-3); }
.fig-value { font-size: 15px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.payrun-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.payrun-art { align-self: end; justify-self: end; width: 200px; color: var(--ink-3); }

/* Tables */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3);
  padding: 9px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.table .main-cell { font-weight: 550; }
.table .sub-cell { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.table-wrap { overflow-x: auto; }

.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.sev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev-high { color: var(--bad); }
.sev-med { color: var(--warn); }
.sev-info { color: var(--info); }

.tag { font-size: 11.5px; font-weight: 550; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.tag-soon { background: var(--bad-wash); color: var(--bad); }
.tag-mid { background: var(--warn-wash); color: var(--warn); }
.tag-later { background: var(--hover); color: var(--ink-2); }

.link { color: var(--accent-strong); font-weight: 550; text-decoration: none; white-space: nowrap; font-size: 12.5px; }
.link:hover { text-decoration: underline; }

/* Cost summary list */

.ledger { list-style: none; margin: 0; padding: 4px 18px 12px; }
.ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ledger li span:first-child { color: var(--ink-2); }
.ledger li.total { border-bottom: 0; border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 10px; font-weight: 600; }
.ledger li.total span:first-child { color: var(--ink); }
.ledger .group { color: var(--ink-3); font-size: 11.5px; font-weight: 500; border-bottom: 0; padding: 10px 0 2px; }

/* Workforce */

.wf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.wf-stat { padding: 12px 16px; border-right: 1px solid var(--line); }
.wf-stat:last-child { border-right: 0; }
.wf-stat b { display: block; font-size: 18px; font-weight: 600; }
.wf-stat span { font-size: 12px; color: var(--ink-3); }

.events { list-style: none; margin: 0; padding: 6px 18px 12px; }
.events li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
.events .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--hover); color: var(--ink-2); }
.events small { color: var(--ink-3); font-size: 12px; display: block; }
.events time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* Cost trend chart */

.trend { padding: 16px 18px 14px; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 150px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col { width: 100%; max-width: 30px; border-radius: 5px 5px 2px 2px; background: var(--line-2); }
.bar.current .bar-col { background: var(--accent); }
.bar label { font-size: 11.5px; color: var(--ink-3); }
.bar .bar-total { font-size: 11px; color: var(--ink-3); }
.bar.current .bar-total, .bar.current label { color: var(--ink); font-weight: 600; }

/* ---------- Responsive ---------------------------------------------------- */

.tabbar { display: none; }
.show-sm { display: none; }

@media (max-width: 1200px) {
  .span-3 { grid-column: span 6; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 16px 16px 96px; }
  .payrun { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .payrun-art { display: none; }
  .payrun-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig:nth-child(2) { border-right: 0; }
  .fig:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .payrun-actions .btn { flex: 1 1 auto; }
  .stepper .step { font-size: 11px; }
  .wf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-stat:nth-child(2) { border-right: 0; }
  .wf-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .hide-sm { display: none; }
  .show-sm { display: inline-flex; }
  .table th, .table td { padding-left: 14px; padding-right: 14px; }

  .tabbar {
    display: flex; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; font-weight: 500; color: var(--ink-3); text-decoration: none;
    padding: 4px 10px; border-radius: 8px;
  }
  .tabbar a.active { color: var(--accent-strong); }
}

@media (max-width: 520px) {
  .span-3 { grid-column: span 12; }
}

/* ---------- Framework bits ---------------------------------------------- */

#blazor-error-ui {
  background: var(--warn-wash); color: var(--ink);
  bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
  display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem;
  position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.secret {
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .02em;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 2px 8px; margin: 0 4px; user-select: all;
}
.check input[type=radio] { margin-top: 3px; accent-color: var(--accent); }
.check { align-items: flex-start; }
.field select, .field textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 9px 11px;
}
.field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.hint { font-weight: 400; }

/* Filters and forms on list and edit pages */
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; }
.filters .grow { flex: 1 1 260px; }
.filters .field input { width: 100%; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.two-col .span-all { grid-column: 1 / -1; }
.form-actions { margin-top: 16px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] input, fieldset.plain[disabled] select { background: var(--surface-2); color: var(--ink-2); }
input.invalid, select.invalid { border-color: var(--bad) !important; }
.validation-message { color: var(--bad); font-size: 12px; font-weight: 400; }
@media (max-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* Adjustment entry: a compact row of fields */
.adj-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, .7fr); gap: 12px; align-items: start; }
.adj-form .field input:not([type=checkbox]), .adj-form .field select { width: 100%; min-width: 0; }
.date-pair input { min-width: 0; }
.adj-flags { grid-column: 1 / span 4; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
.adj-flags > span { width: 100%; }
.adj-submit { grid-column: 5; align-self: end; }
@media (max-width: 1100px) {
  .adj-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .adj-flags, .adj-submit { grid-column: 1 / -1; }
}
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.regular-tag { font-size: 11px; font-weight: 600; color: var(--info); background: var(--info-wash); border-radius: 5px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; }
.hint-strong { color: var(--info); font-weight: 500; }

/* Statutory returns and file uploads */
.steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { padding-left: 24px; position: relative; }
.checklist li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.checklist li.ok::before { content: "✓"; color: var(--good); }
.checklist li.bad::before { content: "!"; color: var(--bad); left: 5px; }
.link-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.inline-upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 12px 0; }
.inline-upload .field { min-width: 220px; flex: 1 1 260px; }
.sub-head { font-size: 15px; margin: 18px 0 8px; color: var(--ink-2); }
