/* Figtree, served from this app (no Google request, works offline) */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Grasoft Business Suite UI
   Layout: icon-box sidebar on a pale blue ground, white 24px cards with soft shadows,
   big friendly headings. One file, no framework. Light by default, dark via OS or toggle. */

:root {
  /* brand + accents (from the style sheet) */
  --brand: #1479FF;
  --brand-ink: #FFFFFF;
  --brand-tint: rgba(20, 121, 255, .10);
  --brand-shadow: rgba(20, 121, 255, .30);
  --cyan: #14D2FF;   --cyan-tint: rgba(20, 210, 255, .12);
  --sky: #14A5FF;    --sky-tint: rgba(20, 165, 255, .12);
  --aqua: #14EBFF;   --aqua-tint: rgba(20, 235, 255, .14);

  /* neutrals, biased toward the navy text colour */
  --ground: #F2F7FF;
  --surface: #FFFFFF;
  --surface-2: #F7FAFF;
  --ink: #193B68;
  --ink-2: #4A6487;
  --muted: #8193AD;
  --line: rgba(25, 59, 104, .10);
  --line-2: rgba(25, 59, 104, .18);
  --ink-tint: rgba(25, 59, 104, .06);

  /* states */
  --ok: #0EA571;     --ok-tint: rgba(14, 165, 113, .12);
  --warn: #D98A00;   --warn-tint: rgba(245, 159, 0, .14);
  --bad: #E5484D;    --bad-tint: rgba(229, 72, 77, .11);

  --shadow: 0 9px 26px rgba(25, 59, 104, .07);
  --shadow-lg: 0 36px 53px rgba(25, 59, 104, .10);
  --shadow-btn: 0 15px 24px -10px var(--brand-shadow);

  --r: 24px; --r-lg: 40px; --r-ib: 16px; --r-ctl: 14px;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3D8EFF; --brand-tint: rgba(61, 142, 255, .16); --brand-shadow: rgba(61, 142, 255, .35);
    --cyan-tint: rgba(20, 210, 255, .14); --sky-tint: rgba(20, 165, 255, .16); --aqua-tint: rgba(20, 235, 255, .14);
    --ground: #0A1424; --surface: #111F36; --surface-2: #0E1A2E;
    --ink: #E4EDFB; --ink-2: #B4C4DD; --muted: #7F93B3;
    --line: rgba(180, 205, 240, .09); --line-2: rgba(180, 205, 240, .18); --ink-tint: rgba(180, 205, 240, .06);
    --ok: #34D399; --ok-tint: rgba(52, 211, 153, .14);
    --warn: #FBBF24; --warn-tint: rgba(251, 191, 36, .14);
    --bad: #FB7185; --bad-tint: rgba(251, 113, 133, .14);
    --shadow: 0 9px 26px rgba(0, 0, 0, .28); --shadow-lg: 0 36px 53px rgba(0, 0, 0, .40);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #3D8EFF; --brand-tint: rgba(61, 142, 255, .16); --brand-shadow: rgba(61, 142, 255, .35);
  --cyan-tint: rgba(20, 210, 255, .14); --sky-tint: rgba(20, 165, 255, .16); --aqua-tint: rgba(20, 235, 255, .14);
  --ground: #0A1424; --surface: #111F36; --surface-2: #0E1A2E;
  --ink: #E4EDFB; --ink-2: #B4C4DD; --muted: #7F93B3;
  --line: rgba(180, 205, 240, .09); --line-2: rgba(180, 205, 240, .18); --ink-tint: rgba(180, 205, 240, .06);
  --ok: #34D399; --ok-tint: rgba(52, 211, 153, .14);
  --warn: #FBBF24; --warn-tint: rgba(251, 191, 36, .14);
  --bad: #FB7185; --bad-tint: rgba(251, 113, 133, .14);
  --shadow: 0 9px 26px rgba(0, 0, 0, .28); --shadow-lg: 0 36px 53px rgba(0, 0, 0, .40);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground); color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; font-weight: 700; }
h1 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.01em; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand-shadow); outline-offset: 2px; border-radius: 8px; }
.num, td.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- icons ---------- */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }

/* icon box: 10% tint, 32p radius in the source scaled to our size */
.ib { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-ib); background: var(--brand-tint); color: var(--brand); flex: none; }
.ib.sm { width: 38px; height: 38px; border-radius: 12px; }
.ib.lg { width: 56px; height: 56px; border-radius: 18px; }
.ib.solid { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-btn); }
.ib.cyan { background: var(--cyan-tint); color: #0AA6CC; }
.ib.sky { background: var(--sky-tint); color: var(--sky); }
.ib.aqua { background: var(--aqua-tint); color: #0BB3C4; }
.ib.ok { background: var(--ok-tint); color: var(--ok); }
.ib.warn { background: var(--warn-tint); color: var(--warn); }
.ib.bad { background: var(--bad-tint); color: var(--bad); }
:root[data-theme="dark"] .ib.cyan, :root[data-theme="dark"] .ib.aqua { color: var(--cyan); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ib.cyan, :root:not([data-theme="light"]) .ib.aqua { color: var(--cyan); } }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 116px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); display: flex; flex-direction: column; align-items: center;
  padding: 22px 8px 18px; gap: 18px; border-right: 1px solid var(--line);
}
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; color: var(--brand); font-size: 17px; letter-spacing: -.01em; text-align: center; line-height: 1.05; }
.logo small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: var(--shadow-btn); }
.nav { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); font-size: 12.5px; font-weight: 500; text-align: center; text-decoration: none; padding: 2px 4px; line-height: 1.2; }
.nav a .ib { width: 42px; height: 42px; transition: transform .15s ease, box-shadow .15s ease; }
.nav a:hover .ib { transform: translateY(-2px); }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.nav a[aria-current="page"] .ib { background: var(--brand); color: #fff; box-shadow: var(--shadow-btn); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.me { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; text-align: center; }
.avatar { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, var(--sky), var(--cyan)); color: #fff; position: relative; flex: none; }
.avatar.sm { width: 36px; height: 36px; border-radius: 12px; font-size: 13px; }
.avatar.dot::after { content: ""; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.logout { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }

.main { padding: 32px clamp(16px, 3vw, 44px) 56px; display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.topbar .title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r-ctl); padding: 10px 14px; box-shadow: var(--shadow); color: var(--muted); min-width: 0; width: 280px; max-width: 100%; }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; width: 100%; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--r-ctl); padding: 10px 14px; box-shadow: var(--shadow); font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-ctl); border: 0; background: var(--surface); color: var(--ink); display: inline-grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; position: relative; }
.icon-btn:hover { color: var(--brand); }
.icon-btn .badge { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* ---------- cards & grids ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.card.sel { border: 2px solid var(--brand); box-shadow: 0 9px 26px var(--brand-tint); }
.card.lift { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.card.flat { box-shadow: none; background: var(--surface-2); border: 1px solid var(--line); }
.card.tight { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head .sub { font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.span-2 { grid-column: span 2; }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

/* KPI tiles */
.kpi { display: flex; gap: 16px; align-items: center; }
.kpi .val { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.1; }
.kpi .lbl { font-size: 13px; color: var(--muted); }
.kpi .delta { font-size: 12.5px; font-weight: 600; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* hero (like "Hello, Anne!") */
.hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.hero::after { content: ""; position: absolute; right: -60px; top: -40px; width: 300px; height: 300px; border-radius: 50%; background: var(--brand-tint); }
.hero::before { content: ""; position: absolute; right: 60px; bottom: -110px; width: 200px; height: 200px; border-radius: 50%; background: var(--cyan-tint); }
.hero > * { position: relative; z-index: 1; max-width: 46ch; }
.hero p { color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-ctl); padding: 12px 22px; font: 600 14.5px/1.2 var(--font); cursor: pointer; border: 2px solid transparent; text-decoration: none !important; white-space: nowrap; transition: transform .12s ease, box-shadow .12s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { box-shadow: 0 18px 28px -10px var(--brand-shadow); }
.btn-active { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn-inactive { background: transparent; color: var(--muted); border-color: var(--line-2); }
.btn-danger { background: var(--bad-tint); color: var(--bad); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--ink-tint); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-tint); color: var(--ok); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.brand { background: var(--brand-tint); color: var(--brand); }
.pill.sky { background: var(--sky-tint); color: var(--sky); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--brand-tint); color: var(--brand); }
.tag.gs { background: var(--brand-tint); color: var(--brand); }
.tag.gm { background: var(--cyan-tint); color: #0995B8; }
:root[data-theme="dark"] .tag.gm { color: var(--cyan); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.gm { color: var(--cyan); } }

/* ---------- tabs / segmented ---------- */
.seg { display: inline-flex; padding: 5px; gap: 4px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; font: 600 13.5px var(--font); color: var(--muted); padding: 9px 16px; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.seg .on { background: var(--brand); color: #fff; box-shadow: var(--shadow-btn); }
.seg .count { font-size: 11.5px; background: var(--ink-tint); padding: 1px 7px; border-radius: 999px; }
.seg .on .count { background: rgba(0, 0, 0, .2); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); background: transparent; }
.filter.on { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 14px; min-width: 640px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 14px 4px; white-space: nowrap; }
.tbl td { white-space: nowrap; padding: 14px; background: var(--surface-2); border-block: 1px solid var(--line); vertical-align: middle; }
.tbl td:first-child { border-left: 1px solid var(--line); border-radius: 16px 0 0 16px; }
.tbl td:last-child { border-right: 1px solid var(--line); border-radius: 0 16px 16px 0; }
.tbl tr.hl td { border-color: var(--brand); background: var(--surface); }
.tbl tr.hl td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.tbl .num, .tbl th.num { text-align: right; }
.tbl .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tbl .who b { display: block; font-weight: 600; }
.tbl .who span { font-size: 12.5px; color: var(--muted); }
.tbl .act { display: flex; gap: 6px; justify-content: flex-end; }
.mini-btn { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.mini-btn:hover { color: var(--brand); border-color: var(--brand); }

/* simple list rows (timeline style from the reference) */
.tl { display: flex; flex-direction: column; gap: 10px; }
.tl-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line-2); color: var(--ink-2); font-size: 14px; }
.tl-item .t { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.tl-item.done { background: var(--brand-tint); border-color: transparent; color: var(--muted); }
.tl-item.now { border: 2px solid var(--brand); color: var(--brand); font-weight: 600; }
.tl-item .grow { min-width: 0; flex: 1; }
.tl-item .grow b { display: block; color: var(--ink); font-weight: 600; }
.tl-item.now .grow b { color: var(--brand); }
.tl-item .grow span { font-size: 12.5px; color: var(--muted); }

/* person / item tiles (like "Today's appointments") */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); border: 2px solid transparent; }
.tile.sel { border-color: var(--brand); }
.tile b { font-size: 14px; line-height: 1.2; }
.tile span { font-size: 12.5px; color: var(--muted); }
.tile .when { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tile.sel .when { color: var(--brand); }

/* progress (like "Monthly reports") */
.prog { display: flex; align-items: center; gap: 12px; }
.prog .bar { flex: 1; height: 6px; border-radius: 6px; background: var(--brand-tint); overflow: hidden; }
.prog .bar i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.prog .bar.cyan { background: var(--cyan-tint); } .prog .bar.cyan i { background: var(--cyan); }
.prog .bar.sky { background: var(--sky-tint); } .prog .bar.sky i { background: var(--sky); }
.prog .pct { font-size: 12.5px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }

/* bar chart (rounded columns like the reference) */
.bars { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.bars .y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--muted); text-align: right; height: 200px; font-variant-numeric: tabular-nums; }
.bars .plot { position: relative; height: 200px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 50px); border-bottom: 1px solid var(--line-2); }
.bars .grp { display: flex; justify-content: center; align-items: flex-end; gap: 5px; height: 100%; }
.bars .col { width: 12px; border-radius: 12px 12px 4px 4px; background: var(--brand); position: relative; }
.bars .col.c2 { background: var(--cyan); }
.bars .col:hover::after { content: attr(data-v); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.bars .x { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: center; }
.bars .x .now { color: var(--brand); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; background: var(--brand); margin-right: 6px; vertical-align: -1px; }
.legend i.c2 { background: var(--cyan); }

/* month calendar (outlined day boxes like the reference) */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal .d { aspect-ratio: 1; max-width: 100%; border-radius: 10px; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); position: relative; }
.cal .d.blank { border-color: transparent; }
.cal .d.bk { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.cal .d.clash { border-color: var(--warn); color: var(--warn); font-weight: 700; }
.cal .d.today { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; box-shadow: var(--shadow-btn); }
.cal.big .d { aspect-ratio: auto; min-height: 92px; place-items: start; padding: 8px; align-content: start; gap: 4px; border-radius: 14px; }
.cal.big .d .ev { font-size: 11.5px; padding: 3px 7px; border-radius: 7px; background: var(--brand-tint); color: var(--brand); font-weight: 600; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal.big .d .ev.req { background: var(--warn-tint); color: var(--warn); }
.cal.big .d .ev.gm { background: var(--cyan-tint); color: #0995B8; }
.cal.big .d.today { background: var(--brand-tint); color: var(--brand); box-shadow: none; border-width: 2px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.form .g-2, .form .g-3 { gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; font: 400 14.5px/1.4 var(--font); color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 12px 14px; outline: 0; transition: border-color .15s ease, box-shadow .15s ease; min-width: 0;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); background: var(--surface); }
.field .with-icon { position: relative; }
.field .with-icon .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field .with-icon input { padding-left: 42px; }
.field .prefix { display: flex; }
.field .prefix span { display: grid; place-items: center; padding: 0 12px; border: 1.5px solid var(--line-2); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); background: var(--ink-tint); font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.field .prefix input { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.choice label { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 18px; border: 2px solid var(--line-2); cursor: pointer; font-weight: 600; font-size: 14px; background: var(--surface); }
.choice label span { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--brand); box-shadow: 0 9px 26px var(--brand-tint); }
.form-foot { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 4px; }

/* line items editor */
.lines { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 3fr) 80px 120px 110px 120px 36px; gap: 10px; align-items: center; }
.line.head { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.line .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.line .input { padding: 10px 12px; }
.lines-wrap { overflow-x: auto; }
.lines-wrap .lines { min-width: 660px; }

/* alert */
.alert { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 18px; background: var(--warn-tint); color: var(--ink); }
.alert .i { color: var(--warn); margin-top: 2px; }
.alert.info { background: var(--brand-tint); } .alert.info .i { color: var(--brand); }
.alert.ok { background: var(--ok-tint); } .alert.ok .i { color: var(--ok); }
.alert b { display: block; }
.alert p { font-size: 13.5px; color: var(--ink-2); }

/* key/value list */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* totals */
.totals { display: grid; gap: 10px; font-size: 14.5px; }
.totals .r { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.totals .r span:first-child { color: var(--ink-2); }
.totals .grand { padding-top: 12px; border-top: 1.5px dashed var(--line-2); font-size: 18px; font-weight: 700; }
.totals .due { color: var(--brand); font-weight: 700; font-size: 18px; }

/* invoice document */
.doc { background: #fff; color: #193B68; border-radius: var(--r); box-shadow: var(--shadow-lg); padding: clamp(20px, 4vw, 48px); display: grid; gap: 28px; }
.doc .muted { color: #8193AD; }
.doc-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.doc-brand { display: flex; gap: 14px; align-items: center; }
.doc-brand .logo-mark { background: #1479FF; }
.doc h1 { font-size: 34px; color: #1479FF; letter-spacing: .02em; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.doc th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #8193AD; padding: 10px 12px; border-bottom: 2px solid #1479FF; }
.doc td { padding: 14px 12px; border-bottom: 1px solid rgba(25,59,104,.10); vertical-align: top; }
.doc .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc .totals .r span:first-child { color: #4A6487; }
.doc .totals .grand { border-color: rgba(25,59,104,.18); }
.doc .totals .due { color: #1479FF; }
.doc .stamp { display: inline-block; border: 2.5px solid #D98A00; color: #D98A00; border-radius: 10px; padding: 4px 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; transform: rotate(-4deg); font-size: 14px; }
.doc .pay-box { background: #F2F7FF; border-radius: 18px; padding: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.doc-wrap { overflow-x: auto; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art { background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.auth-art::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(20, 210, 255, .35); right: -140px; bottom: -120px; }
.auth-art::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .10); right: 80px; top: 60px; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h2 { font-size: clamp(28px, 3vw, 40px); max-width: 14ch; }
.auth-art p { opacity: .85; max-width: 38ch; }
.auth-form { display: grid; place-items: center; padding: 40px 16px; }
.auth-form .card { width: 100%; max-width: 420px; }

/* client portal top nav */
.ptop { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 3vw, 44px); background: var(--surface); box-shadow: var(--shadow); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.ptop .logo { flex-direction: row; gap: 10px; text-align: left; }
.pnav { display: flex; gap: 4px; flex-wrap: wrap; }
.pnav a { padding: 9px 14px; border-radius: 12px; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.pnav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }
.pmain { max-width: 1160px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 44px) 56px; display: flex; flex-direction: column; gap: 24px; }

/* mockup gallery */
.gallery-wrap { max-width: 1180px; margin: 0 auto; padding: 40px 16px 64px; display: flex; flex-direction: column; gap: 32px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.shot { display: flex; flex-direction: column; gap: 14px; text-decoration: none !important; color: var(--ink); }
.shot:hover .ib { transform: translateY(-2px); }
.shot .ib { transition: transform .15s ease; }
.shot p { font-size: 13.5px; color: var(--ink-2); }
.shot .who { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.swatches { display: flex; gap: 14px; flex-wrap: wrap; }
.sw { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sw i { width: 64px; height: 64px; border-radius: 20px; display: block; }

/* package deliverables (assets/packages.js) */
.pkg-list { display: grid; gap: 12px; }
.pkg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.pkg-head .muted { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl.pkg-tbl { min-width: 520px; }
.tbl.pkg-tbl td { padding: 10px 14px; }
.tbl.pkg-tbl td .muted.small { white-space: normal; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { width: 30px; height: 32px; border: 0; background: transparent; color: var(--brand); font: 700 16px var(--font); cursor: pointer; }
.stepper button:hover { background: var(--brand-tint); }
.stepper input { width: 58px; height: 32px; border: 0; border-inline: 1.5px solid var(--line-2); text-align: center; font: 600 14px var(--font); color: var(--ink); background: transparent; outline: 0; }
.pkg-add .input { max-width: 340px; padding: 10px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: var(--ink-tint); color: var(--ink-2); white-space: nowrap; }
.pkg-card { display: grid; gap: 10px; text-decoration: none !important; color: inherit; border: 2px solid transparent; }
.pkg-card.sel { border-color: var(--brand); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; padding: 10px 16px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .logo small, .logo span.word { display: none; }
  .nav { flex-direction: row; gap: 4px; width: auto; }
  .nav a { min-width: 64px; font-size: 11px; }
  .nav a .ib { width: 38px; height: 38px; border-radius: 12px; }
  .side-foot { display: none; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 32px 20px; }
  .search { width: 100%; }
  .tools { width: 100%; }
}
@media (max-width: 520px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; }
  .cal.big { gap: 4px; }
  .cal.big .d { min-height: 56px; padding: 4px; font-size: 11px; }
  .cal.big .d .ev { font-size: 0; padding: 0; height: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* ======================================================================
   App additions (not in the mockups): states the live app needs.
   ====================================================================== */
.alert.bad { background: var(--bad-tint); } .alert.bad .i { color: var(--bad); }
.alert.info .i { color: var(--brand); }
.field .hint.error, .hint.error { color: var(--bad); font-weight: 600; }
[aria-invalid="true"] { border-color: var(--bad) !important; }
.with-icon:has([aria-invalid="true"]) .i { color: var(--bad); }
.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: -9999px; top: 8px; z-index: 50; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; }
.skip:focus { left: 12px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--ink-2); }
.empty .i { color: var(--muted); width: 30px; height: 30px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; }
.pager .pages { display: inline-flex; align-items: center; gap: 4px; padding: 4px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); flex-wrap: wrap; }
.pager .pg { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; font: 600 13px var(--font); color: var(--ink-2); text-decoration: none; font-variant-numeric: tabular-nums; }
.pager a.pg:hover { color: var(--brand); background: var(--brand-tint); }
.pager a.pg:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pager .pg.on { background: var(--brand); color: #fff; box-shadow: var(--shadow-btn); }
.pager .pg.off { color: var(--muted); opacity: .45; }
.pager .pg.gap { min-width: 18px; padding: 0 2px; color: var(--muted); }
.card > .pager:last-child { padding-bottom: 2px; }
@media (max-width: 560px) { .pager { justify-content: center; } .pager .pg-label { display: none; } .pager .pg { min-width: 32px; padding: 0 8px; } }
a.filter { text-decoration: none; }
a.filter:hover { border-color: var(--brand); color: var(--brand); }
a.kpi.link, a.tl-item.link, a.who { color: inherit; text-decoration: none; }
a.kpi.link { transition: transform .15s ease, box-shadow .15s ease; }
a.kpi.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
a.tl-item.link:hover { border-color: var(--brand); }
a.who:hover b { color: var(--brand); }
.tl-item .pill { flex: none; }
.push { margin-left: auto; }
.who.big { display: flex; align-items: center; gap: 14px; min-width: 0; }
.who.big h2, .who.big h3 { margin: 0; overflow-wrap: anywhere; }
.kv.left dd { text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.notes { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.logo-img { width: 38px; height: 38px; border-radius: 12px; object-fit: contain; background: #fff; }
.logo-img.lg { width: 46px; height: 46px; border-radius: 16px; }
.logo-full { display: block; height: 96px; width: auto; }
.print-bar .logo-img { width: 32px; height: 32px; border-radius: 10px; }
.art-logo { align-self: flex-start; background: #fff; border-radius: var(--r); padding: 16px 20px; box-shadow: 0 10px 30px rgba(8, 40, 100, .18); }
.art-logo .logo-full { height: 118px; }
@media print { .logo-full { height: 84px; } }
@media (max-width: 860px) { .art-logo { padding: 10px 14px; } .art-logo .logo-full { height: 76px; } }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.label-like { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
button.logout { border: 0; background: transparent; font: inherit; font-size: 13px; cursor: pointer; padding: 4px; }
button.logout:hover { color: var(--brand); }
a.me { color: var(--ink); text-decoration: none; }
a.me:hover { color: var(--brand); }
.warn-text { color: var(--warn); font-weight: 600; }
.nowrap { white-space: nowrap; }
.link-form { margin-top: 16px; }
.link-form select { width: auto; min-width: 200px; }
.chips-inline { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.g-1 { grid-template-columns: minmax(0, 1fr); }
.tbl .act form { display: inline; margin: 0; }
button.mini-btn { border: 0; cursor: pointer; font: inherit; }
.tools .search { width: 260px; }
.only-mobile, .only-mobile-block { display: none !important; }
.flash-secret { font-family: ui-monospace, Menlo, Consolas, monospace; }
@media (max-width: 1180px) { .search-results.g-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .only-mobile-block { display: block !important; }
  .tools .chip { display: none; }
  .tools .search { width: auto; flex: 1 1 160px; }
}
/* keep hidden table labels inside the scroll box, so wide tables never widen the page */
.tbl-wrap { position: relative; }
.sr-only { top: 0; left: 0; }
.who.big > div, .card-head > div { min-width: 0; }
.card-head h3, .card-head h2 { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.btn { max-width: 100%; }
.form-foot .btn { white-space: normal; text-align: center; }
/* Phase 2: invoices */
.tbl .who .avatar { color: #fff; font-size: 13px; }  /* the mockup's .who span rule greyed out the initials */
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--brand); }
select.input-sm, .input.input-sm { width: auto; max-width: 220px; padding: 8px 10px; font-size: 13px; }
.card-head .row { flex-wrap: wrap; }
.line .field { gap: 4px; min-width: 0; }
.line .field .hint { margin: 0; }
.lines .line.head span:empty { display: block; }
.pkg-rows { display: grid; gap: 10px; }
.pkg-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 140px; gap: 10px; align-items: start; }
.pkg-row.head { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 520px) { .pkg-row { grid-template-columns: minmax(0, 1fr) 70px 100px; } }
.pay-form { margin-top: 20px; padding-top: 18px; border-top: 1.5px dashed var(--line-2); }
.pay-form h3 { margin-bottom: 4px; }
.actions-stack { margin-top: 16px; gap: 10px; }
.actions-stack form { margin: 0; }
.tbl-scroll { overflow-x: auto; }
.doc .stamp.stamp-ok { border-color: #12A150; color: #12A150; }
.doc .stamp.stamp-bad { border-color: #E5484D; color: #E5484D; }
.doc .stamp.stamp-sky { border-color: #2F9BE8; color: #2F9BE8; }
.doc .stamp.stamp-plain { border-color: #8193AD; color: #8193AD; }
.doc .doc-notes { white-space: normal; overflow-wrap: anywhere; }
.doc b, .doc .eyebrow { overflow-wrap: break-word; }
.print-page { background: var(--ground); }
.print-main { max-width: 820px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 18px; }
.receipt-totals { max-width: 420px; margin-left: auto; width: 100%; }
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  .no-print, .side, .topbar, .skip { display: none !important; }
  .app, .main, .print-main { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .grid.g-side { display: block !important; }
  .doc { box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; }
  .doc-wrap, .tbl-scroll { overflow: visible !important; }
  .doc table { min-width: 0 !important; }
  .doc tr { break-inside: avoid; }
}
.pay-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 1500px) and (min-width: 1181px) { .pay-fields { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .pay-fields { grid-template-columns: minmax(0, 1fr); } }
/* On a phone the invoice table fits the screen instead of scrolling sideways */
@media (max-width: 600px) {
  .doc table { min-width: 0; font-size: 13px; }
  .doc th, .doc td { padding: 10px 5px; }
  .doc th { font-size: 10.5px; letter-spacing: .04em; }
  .doc h1 { font-size: 28px; }
  .doc .totals { min-width: 0 !important; width: 100%; }
}
/* ---------- Phase 3: SMS & email ---------- */
.block { display: block; }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more > summary, details.msg-body > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
details.more[open] > summary { margin-bottom: 12px; }
details.msg-body > summary { font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
details.msg-body p { margin-top: 8px; font-size: 13px; white-space: normal; overflow-wrap: anywhere; max-width: 52ch; }
.test-row { align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.test-row .field { min-width: 180px; margin: 0; }
.send-choices { margin: 0; display: grid; gap: 8px; }
.send-choices .check.muted { color: var(--muted); }
.send-form { margin-top: 14px; display: grid; gap: 10px; }
.msg-tbl td { vertical-align: top; }
.print-bar .logo-mark { width: 32px; height: 32px; font-size: 15px; }
@media (max-width: 600px) { .test-row .btn { width: 100%; } }
/* Readability: darker small text on light backgrounds (4.5:1 contrast). Dark mode keeps its bright colours. */
:root { --muted: #607392; --ok-ink: #077A51; --warn-ink: #8F5900; --bad-ink: #C42F36; --sky-ink: #136BA8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok-ink: var(--ok); --warn-ink: var(--warn); --bad-ink: var(--bad); --sky-ink: #7CC4FF; } }
:root[data-theme="dark"] { --ok-ink: var(--ok); --warn-ink: var(--warn); --bad-ink: var(--bad); --sky-ink: #7CC4FF; }
.pill.ok { color: var(--ok-ink); } .pill.warn { color: var(--warn-ink); } .pill.bad { color: var(--bad-ink); } .pill.sky { color: var(--sky-ink); }
.field .hint.error, .hint.error { color: var(--bad-ink); }
.doc .stamp { border-color: #8F5900; color: #8F5900; }
.doc .stamp.stamp-ok { border-color: #077A51; color: #077A51; }
.doc .stamp.stamp-bad { border-color: #C42F36; color: #C42F36; }
.doc .stamp.stamp-sky { border-color: #136BA8; color: #136BA8; }
.doc .stamp.stamp-plain { border-color: #5F7290; color: #5F7290; }
@media (max-width: 600px) { .doc .doc-meta { text-align: left !important; } }
@media (max-width: 600px) { .test-row .field { flex: 1 1 100%; } }
[data-sms-preview] { overflow-wrap: anywhere; }

/* ---------- Phase 4: bookings, packages, contracts ---------- */
.legend i.warn { background: var(--warn); }
.cal.big .d .dn { font-weight: 600; }
.cal.big .d.clash .dn { color: var(--warn-ink, var(--warn)); }
.cal.big .d a.ev { display: block; text-decoration: none; }
.cal.big .d a.ev:hover, .cal.big .d a.ev:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.cal.big .d .ev.done { opacity: .7; }
.cal.big .d .add { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); opacity: 0; text-decoration: none; }
.cal.big .d:hover .add, .cal.big .d .add:focus-visible { opacity: 1; }
.cal.big .d .add:hover { color: var(--brand); background: var(--brand-tint); }
.pkg-card.off { opacity: .6; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.kv dd.note { font-weight: 400; text-align: left; white-space: normal; overflow-wrap: anywhere; }
a.plain-link { color: inherit; text-decoration: none; }
a.plain-link:hover b { color: var(--brand); }
.pkg-tbl tr[hidden] { display: none; }
.doc .terms h2 { font-size: 16px; margin-bottom: 10px; color: #193B68; }
.doc .terms-body { font-size: 13.5px; line-height: 1.65; color: #34507A; overflow-wrap: anywhere; }
.doc .doc-totals { max-width: 360px; margin-left: auto; width: 100%; }
.doc .sign-box { border-top: 1px solid rgba(25,59,104,.12); padding-top: 18px; font-size: 13.5px; }
.doc .sign-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-top: 40px; }
.doc .sign-lines span { border-top: 1.5px solid #8193AD; padding-top: 8px; font-size: 12px; color: #4A6487; }
.accept-form h2 { font-size: 18px; }
@media (max-width: 520px) {
  .cal.big .d .ev { min-height: 6px; }
  .cal.big .d .add { display: none; }
  .doc .sign-lines { grid-template-columns: 1fr; gap: 28px; }
}
@media print {
  .doc.contract { box-shadow: none; padding: 0; }
  .doc .sign-lines { padding-top: 56px; }
}
/* Phase 4 review: readable request and clash colours (darker amber text in light mode) */
.cal .d.clash, .cal.big .d .ev.req { color: var(--warn-ink); }

/* Client portal (Phase 5) */
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--line-2); }
a.tile.sel:hover { border-color: var(--brand); }
.choice label:has(input:focus-visible) { outline: 3px solid var(--brand-shadow); outline-offset: 2px; }
@media (max-width: 760px) {
  .ptop { padding: 10px 16px; gap: 8px; }
  .ptop .pnav { order: 3; width: 100%; }
  .ptop .pnav a { padding: 8px 10px; white-space: nowrap; }
}

/* ---------- online payments ---------- */
.field .prefix input:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.field .prefix input + span { border: 1.5px solid var(--line-2); border-left: 0; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.pay-online .pay-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pay-online .pay-row .field { flex: 1 1 180px; }
@media (max-width: 760px) { .pay-online .pay-row .btn { width: 100%; justify-content: center; } }

/* ---------- reports ---------- */
.bars .plot { background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 33.333%; }
.bars .grp .col { max-width: calc(50% - 3px); min-width: 3px; }
.bars .plot, .bars .x { grid-auto-columns: minmax(0, 1fr); }
.bars .grp { min-width: 0; }
.bars .x span { overflow: hidden; text-overflow: clip; white-space: nowrap; }
@media (max-width: 760px) {
  .bars { grid-template-columns: 30px minmax(0, 1fr); gap: 6px; }
  .bars .plot, .bars .x { gap: 3px; }
  .bars .grp { gap: 2px; }
  .bars .x { font-size: 10.5px; }
  .bars.dense .x span:nth-child(even) { visibility: hidden; }
}
.share { height: 8px; border-radius: 8px; background: var(--ink-tint); overflow: hidden; min-width: 60px; }
.share i { display: block; height: 100%; background: var(--brand); border-radius: 8px; }
.share i.c2 { background: var(--cyan); }
.share i.warn { background: var(--warn); } .share i.bad { background: var(--bad); }
.period-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.period-form .field { margin: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media print { .report-tools, .period-form, .pager { display: none !important; } }
@media print { .print-only[hidden] { display: block !important; } }
.tbl .share-col { width: 22%; min-width: 50px; }
.share { min-width: 40px; }
@media (max-width: 760px) { .tbl .share-col { display: none; } }
.tbl.tbl-small { min-width: 0; }
@media (max-width: 760px) { .tbl.tbl-small th, .tbl.tbl-small td { padding-left: 8px; padding-right: 8px; } .tbl.tbl-small td:first-child { white-space: normal; overflow-wrap: anywhere; } }


/* ---------- Phase 8: utility classes (inline styles are blocked by the security policy) ---------- */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; } .mt-18 { margin-top: 18px; } .mt-12vh { margin-top: 12vh; }
.mb-0 { margin-bottom: 0 !important; } .mb-6 { margin-bottom: 6px; } .mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; } .mb-12 { margin-bottom: 12px; } .mb-14 { margin-bottom: 14px; } .mb-16 { margin-bottom: 16px; }
.my-18 { margin-top: 18px; margin-bottom: 18px; } .my-20 { margin-top: 20px; margin-bottom: 20px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.fs-18 { font-size: 18px; } .fw-700 { font-weight: 700; }
.pre-line { white-space: pre-line; }
.row.nowrap { flex-wrap: nowrap; white-space: normal; }
.row.wrap { flex-wrap: wrap; }
.gap-28 { gap: 28px; }
.basis-full { flex-basis: 100%; }
.self-center { align-self: center; }
.minw-260 { min-width: 260px; } .minw-380 { min-width: 380px; } .maxw-260 { max-width: 260px; }
.form-wide { max-width: 560px; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; width: 100%; }
details.bare { border: 0; padding: 0; }
.logo-mark.light { background: #fff; color: #1479FF; box-shadow: none; }
.art-foot { opacity: .8; }

/* Two-step sign-in */
.steps-list { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.qr-wrap { display: flex; justify-content: center; margin: 6px 0 12px; }
.qr { width: 220px; height: 220px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.secret-key { display: inline-block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--ink-tint); font-size: 14px; letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
.codes { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codes code { display: block; padding: 8px 10px; text-align: center; border-radius: 8px; background: var(--ink-tint); font-size: 15px; letter-spacing: .08em; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles-3 .tile b { font-size: 22px; }
@media (max-width: 560px) { .tiles-3 { grid-template-columns: minmax(0, 1fr); } }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 14px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list li.ok > .i { color: var(--ok, #16a34a); }
.check-list li.bad > .i { color: var(--bad, #dc2626); }
@media print { .codes code { background: none; border: 1px solid #999; } }

/* Bar widths and chart heights in steps of 1%: set by class, not inline style. */
.w-0{width:0%}.w-1{width:1%}.w-2{width:2%}.w-3{width:3%}.w-4{width:4%}.w-5{width:5%}.w-6{width:6%}.w-7{width:7%}.w-8{width:8%}.w-9{width:9%}
.w-10{width:10%}.w-11{width:11%}.w-12{width:12%}.w-13{width:13%}.w-14{width:14%}.w-15{width:15%}.w-16{width:16%}.w-17{width:17%}.w-18{width:18%}.w-19{width:19%}
.w-20{width:20%}.w-21{width:21%}.w-22{width:22%}.w-23{width:23%}.w-24{width:24%}.w-25{width:25%}.w-26{width:26%}.w-27{width:27%}.w-28{width:28%}.w-29{width:29%}
.w-30{width:30%}.w-31{width:31%}.w-32{width:32%}.w-33{width:33%}.w-34{width:34%}.w-35{width:35%}.w-36{width:36%}.w-37{width:37%}.w-38{width:38%}.w-39{width:39%}
.w-40{width:40%}.w-41{width:41%}.w-42{width:42%}.w-43{width:43%}.w-44{width:44%}.w-45{width:45%}.w-46{width:46%}.w-47{width:47%}.w-48{width:48%}.w-49{width:49%}
.w-50{width:50%}.w-51{width:51%}.w-52{width:52%}.w-53{width:53%}.w-54{width:54%}.w-55{width:55%}.w-56{width:56%}.w-57{width:57%}.w-58{width:58%}.w-59{width:59%}
.w-60{width:60%}.w-61{width:61%}.w-62{width:62%}.w-63{width:63%}.w-64{width:64%}.w-65{width:65%}.w-66{width:66%}.w-67{width:67%}.w-68{width:68%}.w-69{width:69%}
.w-70{width:70%}.w-71{width:71%}.w-72{width:72%}.w-73{width:73%}.w-74{width:74%}.w-75{width:75%}.w-76{width:76%}.w-77{width:77%}.w-78{width:78%}.w-79{width:79%}
.w-80{width:80%}.w-81{width:81%}.w-82{width:82%}.w-83{width:83%}.w-84{width:84%}.w-85{width:85%}.w-86{width:86%}.w-87{width:87%}.w-88{width:88%}.w-89{width:89%}
.w-90{width:90%}.w-91{width:91%}.w-92{width:92%}.w-93{width:93%}.w-94{width:94%}.w-95{width:95%}.w-96{width:96%}.w-97{width:97%}.w-98{width:98%}.w-99{width:99%}
.w-100{width:100%}
.h-0{height:0%}.h-1{height:1%}.h-2{height:2%}.h-3{height:3%}.h-4{height:4%}.h-5{height:5%}.h-6{height:6%}.h-7{height:7%}.h-8{height:8%}.h-9{height:9%}
.h-10{height:10%}.h-11{height:11%}.h-12{height:12%}.h-13{height:13%}.h-14{height:14%}.h-15{height:15%}.h-16{height:16%}.h-17{height:17%}.h-18{height:18%}.h-19{height:19%}
.h-20{height:20%}.h-21{height:21%}.h-22{height:22%}.h-23{height:23%}.h-24{height:24%}.h-25{height:25%}.h-26{height:26%}.h-27{height:27%}.h-28{height:28%}.h-29{height:29%}
.h-30{height:30%}.h-31{height:31%}.h-32{height:32%}.h-33{height:33%}.h-34{height:34%}.h-35{height:35%}.h-36{height:36%}.h-37{height:37%}.h-38{height:38%}.h-39{height:39%}
.h-40{height:40%}.h-41{height:41%}.h-42{height:42%}.h-43{height:43%}.h-44{height:44%}.h-45{height:45%}.h-46{height:46%}.h-47{height:47%}.h-48{height:48%}.h-49{height:49%}
.h-50{height:50%}.h-51{height:51%}.h-52{height:52%}.h-53{height:53%}.h-54{height:54%}.h-55{height:55%}.h-56{height:56%}.h-57{height:57%}.h-58{height:58%}.h-59{height:59%}
.h-60{height:60%}.h-61{height:61%}.h-62{height:62%}.h-63{height:63%}.h-64{height:64%}.h-65{height:65%}.h-66{height:66%}.h-67{height:67%}.h-68{height:68%}.h-69{height:69%}
.h-70{height:70%}.h-71{height:71%}.h-72{height:72%}.h-73{height:73%}.h-74{height:74%}.h-75{height:75%}.h-76{height:76%}.h-77{height:77%}.h-78{height:78%}.h-79{height:79%}
.h-80{height:80%}.h-81{height:81%}.h-82{height:82%}.h-83{height:83%}.h-84{height:84%}.h-85{height:85%}.h-86{height:86%}.h-87{height:87%}.h-88{height:88%}.h-89{height:89%}
.h-90{height:90%}.h-91{height:91%}.h-92{height:92%}.h-93{height:93%}.h-94{height:94%}.h-95{height:95%}.h-96{height:96%}.h-97{height:97%}.h-98{height:98%}.h-99{height:99%}
.h-100{height:100%}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Record a payment: method chips; Media follow-up lists */
.method-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.method-pick .check { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.method-pick .check:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--ink); }
.method-pick .check:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.method-pick .check input { width: 16px; height: 16px; }
.fu-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fu-actions form { margin: 0; }
.price-form .prefix { max-width: 220px; }
