/* ==========================================================================
   OETI Design System - implementation of OETI_Brand_Design_System.md
   Tokens follow the brand doc; the palette is reconciled with the actual
   logo (OETI.png) and corrected for WCAG AA. See ARCHITECTURE/BRANDING notes.
   ========================================================================== */

:root {
  /* --- Brand palette -----------------------------------------------------
     Deep Blue and the greys come from the brand doc (section 3).
     Primary is the logo's own blue (#1557A6, sampled from OETI.png): it is
     both on-logo and passes AA for white text at 7.13:1, where the doc's
     Sky Blue (#4A90E2) only reaches 3.29:1. Sky Blue is kept for decorative
     fills and focus rings, never for text on white.
     The logo's lime (#AECB06) is decorative only - 1.85:1 on white. */
  --color-primary-dark: #0A3D62;   /* OE-Deep Blue  - 11.31:1 on white */
  --color-primary: #1557A6;        /* logo blue     -  7.13:1 on white */
  --color-primary-hover: #114A8E;
  --color-primary-active: #0D3C73;
  --color-accent-sky: #4A90E2;     /* OE-Sky Blue - decorative / focus */
  --color-accent-lime: #AECB06;    /* logo lime   - decorative only   */
  --color-accent-lime-ink: #3F4A02; /* readable text on a lime chip   */
  --color-logo-teal: #005580;

  --color-text: #1A1A1A;           /* OE-Black     */
  --color-text-secondary: #333333; /* OE-Charcoal  */
  --color-text-muted: #5A6672;
  --color-border: #E8E8E8;         /* OE-Silver    */
  --color-background: #F5F5F5;     /* OE-Light Gray */
  --color-surface: #FFFFFF;

  /* Functional (brand doc 3.3) */
  --color-success: #27AE60;
  --color-warning: #E67E22;
  --color-error: #E74C3C;
  --color-info: #3498DB;
  --color-success-bg: #E8F7EF;
  --color-warning-bg: #FDF1E6;
  --color-error-bg: #FDECEA;
  --color-info-bg: #EAF4FC;

  /* Spacing - 8px base (brand doc 5.1) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* Radius (brand doc 5.2) */
  --radius-button: 6px;
  --radius-interactive: 8px;
  --radius-card: 12px;
  --radius-hero: 16px;

  /* Shadows (brand doc 5.3) */
  --elevation-1: 0 2px 4px rgba(10, 61, 98, 0.08);
  --elevation-2: 0 4px 8px rgba(10, 61, 98, 0.12);
  --elevation-3: 0 8px 16px rgba(10, 61, 98, 0.15);

  /* Typography (brand doc 4.1) */
  --font-family: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Motion + depth (see motion.css) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.12s;
  --dur: 0.2s;
  --dur-slow: 0.36s;
  --shadow-hover: 0 10px 24px rgba(10, 61, 98, 0.14), 0 2px 6px rgba(10, 61, 98, 0.08);
  --tabbar-h: 64px;
}

/* --- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.2px;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
html { scroll-behavior: smooth; }
::selection { background: rgba(74, 144, 226, 0.28); }
.icon { flex: none; display: inline-block; vertical-align: -0.2em; }
.skip-link {
  position: fixed; left: var(--space-md); top: -80px; z-index: 200;
  background: var(--color-primary-dark); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-button); transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: var(--space-md); text-decoration: none; }

/* --- Type scale (brand doc 4.2) ---------------------------------------- */
.t-display { font-size: 48px; font-weight: 700; line-height: 1.1; letter-spacing: -0.5px; }
h1, .t-h1   { font-size: clamp(26px, 4.2vw, 36px); font-weight: 700; line-height: 1.2; letter-spacing: -0.3px; }
h2, .t-h2   { font-size: 28px; font-weight: 600; line-height: 1.3; }
h3, .t-h3   { font-size: 20px; font-weight: 600; line-height: 1.4; }
.t-body-lg  { font-size: 16px; font-weight: 400; line-height: 1.6; letter-spacing: 0.3px; }
.t-small    { font-size: 12px; line-height: 1.5; letter-spacing: 0.1px; color: var(--color-text-muted); }
code, .t-code { font-family: var(--font-mono); font-size: 14px; font-weight: 500; line-height: 1.5; }

h1, h2, h3 { margin: 0 0 var(--space-md); color: var(--color-primary-dark); }
p { margin: 0 0 var(--space-md); max-width: 75ch; }  /* brand doc 4.3 */

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a { transition: color var(--dur) ease; }

/* --- Focus (brand doc 5.3 / 13.3) -------------------------------------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent-sky);
  outline-offset: 2px;
  border-radius: var(--radius-button);
}

/* --- Layout ------------------------------------------------------------ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.masthead {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--elevation-1);
  position: sticky;
  top: 0;
  z-index: 10;
  transition: box-shadow var(--dur-slow) ease;
}
.masthead.is-scrolled { box-shadow: 0 6px 18px rgba(10, 61, 98, 0.12); }

.masthead__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Logo lockup: clear space is 1/4 of mark width (brand doc 2.3) */
.brand { display: flex; align-items: center; gap: var(--space-md); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 48px; height: 48px; display: block; transition: transform var(--dur-slow) var(--ease-spring); }
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.06); }
.brand__name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--color-primary-dark);
  line-height: 1.2;
}
.brand__tagline { font-size: 12px; font-weight: 400; color: var(--color-text-secondary); }

.nav { display: flex; gap: var(--space-xs); margin-left: auto; align-items: center; position: relative; }
.nav__link {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-interactive);
  color: var(--color-text);
  font-weight: 600;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.nav__link:hover { background: var(--color-background); text-decoration: none; }
.nav__link .icon { transition: transform var(--dur) var(--ease-spring); }
.nav__link:hover .icon { transform: translateY(-1px) scale(1.1); }
.nav__link[aria-current="page"] { color: var(--color-primary); background: var(--color-info-bg); }

/* JS adds a sliding pill; the link's own background steps aside once it is placed. */
.nav__indicator { display: none; }
.nav.is-ready .nav__indicator {
  display: block; position: absolute; left: 0; top: 0; z-index: 0;
  width: var(--w, 0); height: var(--h, 0);
  transform: translate(var(--x, 0), var(--y, 0));
  background: var(--color-info-bg);
  border-radius: var(--radius-interactive);
  transition: transform 0.35s var(--ease-out), width 0.35s var(--ease-out), height 0.35s var(--ease-out);
  pointer-events: none;
}
.nav.is-ready.no-anim .nav__indicator { transition: none; }
.nav.is-ready .nav__link:hover,
.nav.is-ready .nav__link[aria-current="page"] { background: transparent; }
.nav.is-ready .nav__link:hover { color: var(--color-primary); }

.main { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: var(--space-xl) var(--space-lg); }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}
.page-head p { margin: 0; color: var(--color-text-secondary); }

/* --- Buttons (brand doc 5.5) ------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-button);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  justify-content: center;
  transition: background-color var(--dur) ease, box-shadow var(--dur) ease, transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.btn { white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .icon { transition: transform var(--dur) var(--ease-spring); }
.btn:hover .icon[data-icon="plus"] { transform: rotate(90deg); }
.btn:hover .icon[data-icon="arrow-left"] { transform: translateX(-3px); }
.btn:hover .icon[data-icon="arrow-right"] { transform: translateX(3px); }
.btn:hover .icon[data-icon="download"] { transform: translateY(2px); }
.btn:hover .icon[data-icon="eye"],
.btn:hover .icon[data-icon="pencil"],
.btn:hover .icon[data-icon="send"] { transform: scale(1.15); }
.btn.is-loading { pointer-events: none; opacity: 0.85; }

.btn--primary { background: var(--color-primary); color: #FFFFFF; }
.btn--primary:hover { background: var(--color-primary-hover); box-shadow: var(--elevation-2); }
.btn--primary:active { background: var(--color-primary-active); }

.btn--secondary { background: var(--color-border); color: var(--color-text); }
.btn--secondary:hover { background: #D5D5D5; }
.btn--secondary:active { background: #C5C5C5; }

.btn--text { background: transparent; color: var(--color-primary); padding: var(--space-sm) var(--space-sm); min-height: 0; }
.btn--text:hover { text-decoration: underline; transform: none; }

/* --- Cards ------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--elevation-1);
  padding: var(--space-lg);
}
.card--flush { padding: 0; overflow-x: auto; position: relative; }
.card__head {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.card__head h2, .card__head h3 { margin: 0; }

/* --- Stat tiles -------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--elevation-1);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat__icon {
  position: absolute; top: var(--space-md); right: var(--space-md);
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--color-info-bg); color: var(--color-primary);
  transition: transform var(--dur) var(--ease-spring);
}
.stat:hover .stat__icon { transform: scale(1.12) rotate(-6deg); }
.stat--outstanding .stat__icon { background: var(--color-warning-bg); color: #B25A12; }
.stat--paid .stat__icon { background: var(--color-success-bg); color: #1B7A43; }
.stat--draft .stat__icon { background: var(--color-border); color: var(--color-text-secondary); }
.stat--outstanding { border-left-color: var(--color-warning); }
.stat--paid { border-left-color: var(--color-success); }
.stat--draft { border-left-color: var(--color-text-muted); }

.stat__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}
.stat__value { font-size: clamp(22px, 3vw, 28px); font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.2; color: var(--color-primary-dark); }
.stat__meta { font-size: 12px; color: var(--color-text-muted); margin-top: var(--space-xs); }

/* --- Table ------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.table th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: #FAFBFC;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color var(--dur) ease; }
.table tbody tr:hover { background: #F8FAFD; }
.table tbody tr.is-link { cursor: pointer; }
.table tbody tr.is-link td:first-child { box-shadow: inset 0 0 0 var(--color-primary); transition: box-shadow var(--dur) var(--ease-out); }
.table tbody tr.is-link:hover td:first-child { box-shadow: inset 3px 0 0 var(--color-primary); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--font-mono); font-size: 13px; }

/* --- Status badges -----------------------------------------------------
   Never colour alone (brand doc 13.3): each badge carries its own label. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-button);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge--draft { background: var(--color-border); color: var(--color-text-secondary); }
.badge--sent { background: var(--color-info-bg); color: #1A5E8A; }
.badge--partial { background: var(--color-warning-bg); color: #8A4B11; }
.badge--paid { background: var(--color-success-bg); color: #1B7A43; }
.badge--cancelled { background: var(--color-error-bg); color: #A5281B; }
.badge--reversed { background: var(--color-border); color: var(--color-text-secondary); }

/* Decorative lime accent - dark ink only, never lime text on white */
.badge--accent { background: var(--color-accent-lime); color: var(--color-accent-lime-ink); }

/* --- Empty state ------------------------------------------------------- */
.empty { padding: var(--space-xxl) var(--space-lg); text-align: center; }
.empty__mark { width: 64px; height: 64px; opacity: 0.35; margin-bottom: var(--space-md); }
.empty h3 { margin-bottom: var(--space-sm); }
.empty p { margin: 0 auto; color: var(--color-text-secondary); }

/* --- Detail list ------------------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}
.detail__label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}
.detail__value { font-size: 16px; color: var(--color-text); }

.totals { margin-left: auto; width: 100%; max-width: 360px; }
.totals__row { display: flex; justify-content: space-between; padding: var(--space-sm) 0; }
.totals__row--grand {
  border-top: 2px solid var(--color-primary-dark);
  margin-top: var(--space-sm);
  padding-top: var(--space-md);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

/* --- Footer ------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}

/* --- Forms ------------------------------------------------------------- */
.input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-interactive);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:hover { border-color: #CFD6DD; }
.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
}
.input--num { text-align: right; font-variant-numeric: tabular-nums; }
textarea.input { resize: vertical; line-height: 1.5; }

fieldset[disabled] .input { background: var(--color-background); color: var(--color-text-muted); }
fieldset[disabled] .btn { opacity: 0.5; pointer-events: none; }

label.detail__label { display: block; }

/* Editable table: tighter cells so the inputs sit flush */
.table--editable td { padding: var(--space-sm) var(--space-md); vertical-align: middle; }
.table--editable th { padding: var(--space-sm) var(--space-md); }
.table--editable tbody tr:hover { background: transparent; }

.btn-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.btn-icon:active { transform: scale(0.9); }
.btn-icon:hover { background: var(--color-error-bg); color: #A5281B; border-color: #F3C9C4; }
.btn-icon:hover .icon { transform: rotate(8deg); }

/* --- Action groups ----------------------------------------------------- */
.actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; }
.actions--end { justify-content: flex-end; margin-bottom: var(--space-xl); }

/* --- Notices ----------------------------------------------------------- */
.notice {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-card);
  border-left: 4px solid var(--color-info);
  background: var(--color-info-bg);
  margin-bottom: var(--space-lg);
}
.notice--success { border-left-color: var(--color-success); background: var(--color-success-bg); color: #1B7A43; }
.notice--warning { border-left-color: var(--color-warning); background: var(--color-warning-bg); color: #8A4B11; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Danger button, field errors --------------------------------------- */
.btn--danger { background: var(--color-surface); color: #A5281B; border: 1px solid #F3C9C4; }
.btn--danger:hover { background: var(--color-error-bg); }
.input--error { border-color: var(--color-error); }
.field-error { color: #A5281B; font-size: 12px; margin: var(--space-xs) 0 0; }
.client-link:hover strong { text-decoration: underline; }
.client-link, .table td a { display: inline-flex; align-items: center; min-height: 24px; }

/* --- Dashboard pie ----------------------------------------------------- */
.pie { display: flex; align-items: center; justify-content: center; gap: var(--space-xxl); flex-wrap: wrap; padding: var(--space-md) 0; }
.pie__figure { display: grid; justify-items: center; gap: var(--space-md); }
.pie__chart { width: 220px; height: 220px; flex: none; overflow: visible; }
.pie__slice { cursor: pointer; transform-box: view-box; transition: transform 0.28s var(--ease-spring), filter var(--dur) ease; outline: none; }
.pie__slice.is-active, .pie__slice:focus-visible { transform: translate(var(--tx, 0), var(--ty, 0)); filter: drop-shadow(0 2px 3px rgba(10, 61, 98, 0.35)); }
.pie__readout { min-height: 24px; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; text-align: center; }
.pie__readout strong { color: var(--color-primary-dark); }
.pie__legend { border-collapse: collapse; min-width: 320px; font-variant-numeric: tabular-nums; }
.pie__legend td { padding: 10px var(--space-md); border-bottom: 1px solid var(--color-border); transition: background-color var(--dur) ease; }
.pie__legend td:first-child { padding-left: var(--space-sm); font-weight: 600; }
.pie__legend tbody tr { cursor: default; }
.pie__legend tbody tr.is-active td { background: var(--color-info-bg); }
.pie__legend td.num { text-align: right; }
.pie__legend tfoot td { border-bottom: 0; border-top: 2px solid var(--color-primary-dark); font-weight: 700; color: var(--color-primary-dark); }
.pie__pct { color: var(--color-text-muted); }
.pie__swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: var(--space-sm); vertical-align: -2px; transition: transform var(--dur) var(--ease-spring); }
.pie__legend tr.is-active .pie__swatch { transform: scale(1.35); }

/* --- Invoice letterhead and currency toggle ---------------------------- */
.letterhead { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; }
.letterhead__who { display: flex; align-items: center; gap: var(--space-md); }
.letterhead__logo { width: 72px; height: 72px; object-fit: contain; }
.letterhead__company { font-size: 20px; font-weight: 700; color: var(--color-primary-dark); }
.letterhead__meta { text-align: left; }
.letterhead__number { font-size: 20px; font-weight: 700; color: var(--color-primary-dark); }

.currency { display: inline-flex; align-items: center; gap: var(--space-sm); }
.currency__group {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--color-border); border-radius: var(--radius-button);
  background: var(--color-surface); overflow: hidden;
}
.currency__group::before {
  content: ""; position: absolute; inset: 0 50% 0 0; background: var(--color-primary);
  transition: transform 0.35s var(--ease-out);
}
.currency[data-cur="INR"] .currency__group::before { transform: translateX(100%); }
.currency__btn {
  position: relative; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--color-text); border: 0; min-height: 44px;
  transition: color var(--dur) ease;
}
.currency__btn[aria-pressed="true"] { color: #fff; }
.cur { display: inline-block; }


/* --- Progress bar, toasts, dialog --------------------------------------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; }
.progress i {
  display: block; height: 100%; width: 0; opacity: 1;
  background: linear-gradient(90deg, var(--color-accent-sky), var(--color-primary));
  box-shadow: 0 0 8px rgba(74, 144, 226, 0.6);
  transition: width 8s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.3s ease;
}
.progress.is-on i { width: 85%; }

.toasts {
  position: fixed; top: calc(var(--space-md) + 64px); right: var(--space-md); z-index: 90;
  display: grid; gap: var(--space-sm); width: min(380px, calc(100vw - 2 * var(--space-md)));
  pointer-events: none;
}
.toast {
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 14px var(--space-md); border-radius: var(--radius-card);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-info); box-shadow: var(--elevation-3);
  color: var(--color-text);
}
.toast > .icon { color: var(--color-info); }
.toast--success { border-left-color: var(--color-success); }
.toast--success > .icon { color: var(--color-success); }
.toast--error { border-left-color: var(--color-error); }
.toast--error > .icon { color: var(--color-error); }
.toast__msg { flex: 1; }
.toast__close {
  display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--radius-button);
  background: transparent; color: var(--color-text-muted); cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.toast__close:hover { background: var(--color-background); color: var(--color-text); }
.toast__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: 0.18; transform-origin: left; }

.dialog {
  border: 0; border-radius: var(--radius-hero); padding: var(--space-xl);
  width: min(440px, calc(100vw - 2 * var(--space-md)));
  box-shadow: 0 24px 60px rgba(10, 61, 98, 0.35); color: var(--color-text);
}
.dialog::backdrop { background: rgba(10, 61, 98, 0.45); backdrop-filter: blur(3px); }
.dialog__icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-error-bg); color: #A5281B; margin-bottom: var(--space-md);
}
.dialog h2 { margin-bottom: var(--space-sm); font-size: 20px; }
.dialog p { color: var(--color-text-secondary); }
.dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-lg); }
/* #C0392B: white text at 5.4:1 (the brand error red is 3.8:1, too low for button text) */
.btn--danger-solid { background: #C0392B; color: #fff; }
.btn--danger-solid:hover { background: #A93226; box-shadow: var(--elevation-2); }

/* --- List toolbar: search, filter chips, sortable headers ---------------- */
html:not(.js) .js-only { display: none !important; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.search { position: relative; flex: 1 1 260px; max-width: 420px; display: block; }
.search > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; transition: color var(--dur) ease; }
.search:focus-within > .icon { color: var(--color-primary); }
.search .input { padding-left: 38px; padding-right: 38px; }
.search__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-button); background: transparent; color: var(--color-text-muted); cursor: pointer;
}
.search__clear:hover { background: var(--color-background); color: var(--color-text); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; min-height: 36px;
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  background: var(--color-surface); color: var(--color-text-secondary);
  border: 1px solid var(--color-border); border-radius: 999px;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: #CFD6DD; transform: translateY(-1px); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.chip:hover { text-decoration: none; }
.chip__count { font-variant-numeric: tabular-nums; opacity: 0.75; font-weight: 500; }

[hidden] { display: none !important; }
a.th-sort { text-decoration: none; }
.check-col { width: 44px; }
.check-col input[type="checkbox"] { width: 24px; height: 24px; margin: 0; accent-color: var(--color-primary); cursor: pointer; }
.table tbody tr.is-selected td { background: var(--color-info-bg); }
.bulkbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-md);
  background: var(--color-info-bg); border: 1px solid #C9E3F5; border-radius: 10px;
  font-weight: 600; color: #1A5E8A;
}
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--color-border);
}
.pager .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.stack-lg { margin-bottom: var(--space-lg); }
.activity { margin-top: var(--space-lg); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline__item { position: relative; display: flex; gap: var(--space-md); padding: 0 0 var(--space-md) 0; }
.timeline__item:not(:last-child)::before {
  content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--color-border);
}
.timeline__dot { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 3px var(--color-info-bg); }
.timeline__title { font-weight: 600; color: var(--color-text); }

.th-sort {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; margin: 0; min-height: 24px;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}
.th-sort .icon { opacity: 0.4; transition: opacity var(--dur) ease, transform var(--dur) var(--ease-spring), color var(--dur) ease; }
.th-sort:hover .icon { opacity: 0.85; }
th[aria-sort="ascending"] .icon, th[aria-sort="descending"] .icon { opacity: 1; color: var(--color-primary); }
th[aria-sort="descending"] .icon { transform: rotate(180deg); }
th.num .th-sort { flex-direction: row-reverse; }
.table [hidden] { display: none !important; }

.empty__art { width: 120px; height: 96px; margin: 0 auto var(--space-md); color: var(--color-primary); }
.empty--filter { padding: var(--space-xl) var(--space-lg); }
.empty--filter .icon { color: var(--color-text-muted); margin-bottom: var(--space-sm); }

/* --- Forms: validation, sticky action bar -------------------------------- */
.field-error { display: flex; align-items: center; gap: 6px; }
.input--error { box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15); }
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6672' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }

.form-bar {
  position: sticky; bottom: var(--space-md); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-xl);
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border: 1px solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--elevation-2);
}
.form-bar__state { display: inline-flex; align-items: center; gap: var(--space-sm); color: var(--color-text-muted); font-size: 13px; opacity: 0; transform: translateY(4px); transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out); }
.form-bar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-warning); }
.is-dirty .form-bar__state { opacity: 1; transform: none; }
.form-bar .actions { margin-left: auto; }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--color-border); border-bottom-width: 2px; border-radius: 4px; background: var(--color-surface); color: var(--color-text-muted); }

/* --- Client status ----------------------------------------------------- */
.badge--active { background: var(--color-success-bg); color: #1B7A43; }
.badge--inactive { background: var(--color-border); color: var(--color-text-secondary); }

/* --- Grid filters: search + selects, extras behind "Advanced filters" ---- */
.filters { align-items: flex-end; }
.filter { display: grid; gap: var(--space-xs); min-width: 160px; }
.filter__label { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.filters__more { flex-basis: 100%; order: 1; }
.filters__more > summary {
  display: inline-flex; align-items: center; gap: var(--space-sm); min-height: 36px; padding: 0 var(--space-sm);
  font-weight: 600; color: var(--color-primary); cursor: pointer; border-radius: var(--radius-button); list-style: none;
}
.filters__more > summary::-webkit-details-marker { display: none; }
.filters__more > summary::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform var(--dur) ease; }
.filters__more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.filters__panel {
  display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-sm);
  padding: var(--space-md); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card);
}
.filters__actions { display: flex; align-items: center; gap: var(--space-sm); }

/* --- Sectioned forms ------------------------------------------------------ */
.crumbs { font-size: 13px; margin-bottom: var(--space-xs); color: var(--color-text-muted); }
.crumbs a { text-decoration: underline; }
.form-section { margin-bottom: var(--space-lg); }
.form-section > h2 { margin-bottom: var(--space-md); }
.req { color: #A5281B; }
.hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-muted); margin: var(--space-xs) 0 0; }
.span-2 { grid-column: span 2; }
.radio-group { border: 0; padding: 0; margin: var(--space-lg) 0 0; min-width: 0; }
.radio-group legend { padding: 0; }
.radio-group__options { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.radio {
  display: inline-flex; align-items: center; gap: var(--space-sm); min-height: 44px; padding: 0 var(--space-md);
  border: 1px solid #CFD6DD; border-radius: var(--radius-interactive); background: var(--color-surface); cursor: pointer;
  transition: border-color var(--dur) ease, background-color var(--dur) ease;
}
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.radio input:focus-visible { outline: 3px solid var(--color-accent-sky); outline-offset: 2px; }
.radio:has(input:checked) { border-color: var(--color-primary); background: var(--color-info-bg); }
.radio-group[disabled] .radio { cursor: not-allowed; background: var(--color-background); color: var(--color-text-muted); }
#currency-group { margin: 0 0 var(--space-lg); }
.contact-row { border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: var(--space-md); margin: var(--space-md) 0 0; min-width: 0; }
.contact-row legend { padding: 0 var(--space-xs); font-weight: 600; color: var(--color-primary-dark); }
.contact-row__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-md); }
.input-affix { display: flex; align-items: stretch; }
.input-affix .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-affix__unit {
  display: inline-flex; align-items: center; padding: 0 14px; font-weight: 700; font-size: 16px; color: var(--color-text);
  background: var(--color-background); border: 1px solid var(--color-border); border-left: 0;
  border-radius: 0 var(--radius-interactive) var(--radius-interactive) 0;
}

/* Unsaved changes: a labelled warning, not just a dot */
.form-bar__state { padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; color: #8A4B11; background: var(--color-warning-bg); border: 1px solid var(--color-warning); }

/* --- Client details --------------------------------------------------------- */
.detail-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-lg); }
.detail-cols > .card { margin: 0; }
.detail-cols--notes { gap: var(--space-xl); }
.facts { margin: 0; display: grid; gap: var(--space-md); }
.facts dt { font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--color-text-muted); }
.facts dd { margin: 2px 0 0; font-size: 15px; }
.prewrap { white-space: pre-wrap; }

/* --- Scheduled sending ------------------------------------------------------ */
.badge--scheduled { background: var(--color-info-bg); color: #1A5E8A; }
.badge--approval { background: var(--color-warning-bg); color: #8A4B11; }
.badge--approved, .badge--completed { background: var(--color-success-bg); color: #1B7A43; }
.badge--failed { background: var(--color-error-bg); color: #A5281B; }

.schedule__choice { margin-top: 0; }
.schedule__group { margin-top: var(--space-lg); }
.schedule__heading { display: flex; align-items: center; gap: var(--space-sm); margin: var(--space-xl) 0 var(--space-md); font-size: 16px; color: var(--color-primary-dark); }
.schedule__group > .schedule__heading:first-child { margin-top: 0; }
.schedule__ends { align-items: center; }
.schedule__end-option { display: inline-flex; align-items: center; gap: var(--space-sm); }
.schedule__end-option .input { width: auto; }
.schedule__end-option .input:disabled { background: var(--color-background); color: var(--color-text-muted); }
.schedule__toggle { font-weight: 600; }
.schedule__approval { margin-top: var(--space-md); padding-left: var(--space-md); border-left: 3px solid var(--color-border); }
.schedule__approval .radio-group { margin-top: var(--space-md); }
.schedule__approval .detail-grid, .detail-grid--narrow { max-width: 360px; grid-template-columns: 1fr; }
.hint a { text-decoration: underline; }
.schedule__summary { margin: var(--space-lg) 0 0; padding: var(--space-md); border-radius: var(--radius-interactive); background: var(--color-info-bg); color: #1A5E8A; font-weight: 600; }
.schedule__summary:empty { display: none; }
.schedule__error { color: #A5281B; margin-top: var(--space-xs); max-width: 32ch; }
.notice--inline { margin: 0 0 var(--space-md); padding: var(--space-sm) var(--space-md); font-size: 14px; }
.notice--inline a, .notice a { color: inherit; text-decoration: underline; }

.sending__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-md); }
.sending__head h2 { margin: 0; }
.sending__intro { margin: 0 0 var(--space-lg); max-width: 70ch; }
.sending__actions { margin: var(--space-lg) 0; }
.sending .actions form, .actions--row form { display: inline; }
.sending__edit { border-top: 1px solid var(--color-border); padding-top: var(--space-md); }
.sending__edit > summary {
  display: inline-flex; align-items: center; gap: var(--space-sm); min-height: 44px; padding: 0 var(--space-sm);
  font-weight: 600; color: var(--color-primary); cursor: pointer; border-radius: var(--radius-button);
}
.sending__edit[open] > summary { margin-bottom: var(--space-md); }
.sending form > .actions { margin-top: var(--space-lg); }
.facts--grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-md) var(--space-lg); }
.actions--row { flex-wrap: nowrap; justify-content: flex-end; }
.code-block { margin: 0 0 var(--space-md); padding: var(--space-md); overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; background: var(--color-background); border: 1px solid var(--color-border); border-radius: var(--radius-interactive); }

/* Send / Schedule dialogs: a header, a scrolling body, and the buttons always in reach */
.sheet {
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 0; border-radius: var(--radius-card); box-shadow: var(--elevation-3); color: var(--color-text);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sheet::backdrop { background: rgba(10, 61, 98, 0.45); backdrop-filter: blur(3px); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-border); }
.sheet__head h2 { display: flex; align-items: center; gap: var(--space-sm); margin: 0; }
.sheet__close { width: 36px; height: 36px; }
.sheet__close:hover { background: var(--color-background); color: var(--color-text); border-color: var(--color-border); }
.sheet__body { padding: var(--space-lg); overflow-y: auto; flex: 1; min-height: 0; }
.sheet__lead { margin: 0 0 var(--space-lg); color: var(--color-text-secondary); }
.sheet__foot { display: flex; justify-content: flex-end; gap: var(--space-sm); flex-wrap: wrap; padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--color-border); background: #FAFBFC; border-radius: 0 0 var(--radius-card) var(--radius-card); }
.sheet .notice--inline { margin: var(--space-lg) 0 0; }
@media (max-width: 720px) {
  .sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .sheet__foot { border-radius: 0; }
  .sheet__foot .btn { flex: 1 1 auto; }
  /* new invoice: Schedule and Send get their own row so neither is pushed off screen */
  .form-bar .actions.actions--send { flex-wrap: wrap; }
  .actions--send #open-schedule, .actions--send #open-send { flex: 1 1 40%; }
}

/* --- Responsive ----------------------------------------------------------
   1024: tighten. 720: stacked-card tables, bottom tab bar, touch sizing.
   480: single column everything. */
@media (max-width: 1024px) {
  .masthead__inner, .main { padding-left: var(--space-md); padding-right: var(--space-md); }
  .pie { gap: var(--space-xl); }
}

@media (max-width: 720px) {
  .masthead__inner { padding: var(--space-sm) var(--space-md); }
  .brand__tagline { display: none; }
  .brand__mark { width: 40px; height: 40px; }

  /* nav becomes a bottom tab bar */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border); box-shadow: 0 -4px 16px rgba(10, 61, 98, 0.08);
  }
  .nav__link { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 4px; font-size: 11px; border-radius: 0; }
  .nav__link:hover { background: transparent; }
  .nav__link[aria-current="page"] { background: transparent; }
  .nav__link .icon { width: 22px; height: 22px; }
  .nav.is-ready .nav__indicator { top: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--color-primary); width: var(--w); transform: translateX(var(--x)); }

  .main { padding: var(--space-lg) var(--space-md) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-xl)); }
  .footer { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-md)); }
  .t-display { font-size: 32px; }

  .page-head { margin-bottom: var(--space-lg); }
  .page-head > .actions, .page-head > .btn { width: 100%; }
  .page-head > .actions .btn { flex: 1 1 auto; }
  .toolbar .search { max-width: none; }
  .chips { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  .input, select.input { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-icon { width: 40px; height: 40px; }

  .toasts { top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-md)); left: var(--space-md); right: var(--space-md); width: auto; }
  .form-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-sm)); }
  .form-bar { padding: var(--space-sm); }
  .form-bar .actions { width: 100%; flex-wrap: nowrap; gap: var(--space-sm); }
  .form-bar .actions .btn { flex: 1 1 auto; padding: 12px 12px; }
  .form-bar .actions .btn--shrink { flex: 0 0 auto; }
  .hide-sm { display: none; }
  .card--flush { overflow: visible; }

  .totals { max-width: none; }
  .pie__chart { width: 200px; height: 200px; }
  .pie__legend { min-width: 0; width: 100%; }

  /* tables -> stacked cards (data-label supplies the caption) */
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td, .table--stack tfoot { display: block; width: 100%; }
  .table--stack tbody tr { padding: var(--space-md); border-bottom: 1px solid var(--color-border); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding: 6px 0; border: 0; text-align: right !important; }
  .table--stack td::before { content: attr(data-label); font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--color-text-muted); text-align: left; flex: none; }
  .table--stack td[data-label=""]::before { display: none; }
  .table--stack tr.is-link:hover td:first-child { box-shadow: none; }

  /* invoice line editor: each line becomes a labelled card */
  .table--editable thead { display: none; }
  .table--editable, .table--editable tbody { display: block; width: 100%; }
  .table--editable tbody { padding: var(--space-md); display: grid; gap: var(--space-md); }
  .table--editable tr.item-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm) var(--space-md);
    padding: var(--space-md); border: 1px solid var(--color-border); border-radius: var(--radius-card); background: #FAFBFC;
  }
  .table--editable td { display: block; padding: 0; border: 0; }
  .table--editable td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 4px; }
  .table--editable td:nth-child(1), .table--editable td:nth-child(2) { grid-column: 1 / -1; }
  .table--editable td.line-total { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; }
  .table--editable td.line-total::before { margin: 0; }
  .table--editable td:last-child { grid-column: 1 / -1; justify-self: end; }
  .table--editable td:last-child::before { display: none; }
  .table--editable tbody tr:hover { background: #FAFBFC; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: var(--space-md); }
  .stat__icon { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .filter { min-width: 0; flex: 1 1 100%; }
  .currency__btn { padding: 10px 12px; }
  .dialog { padding: var(--space-lg); }
}

@media (max-width: 380px) {
  .form-bar .actions { flex-wrap: wrap; }
}

@media (max-width: 360px) {
  .stats { grid-template-columns: 1fr; }
}

/* --- Print: just the document ------------------------------------------- */
@media print {
  .masthead, .nav, .footer, .toasts, .progress, .form-bar, .currency, .page-head .actions, .btn-icon, #add-row, .skip-link { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card, .stat { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .input { border-color: transparent; padding-left: 0; appearance: none; background: none; }
}
