/* Showroom Platform, in the Tiru brand (tirudigitalservices.com/brand-kit).
   Contrast rules: white on Tiru Red and Tiru Red on white are large-text only,
   so buttons and links at app sizes use Deep Red (9.5:1). Tiru Red is the accent:
   logo, active marks, focus ring, graphics. Soft Red for small red text on black. */
:root {
  --red: #ED1C24;         /* Tiru Red: accents, graphics, large text */
  --red-deep: #8E0B12;    /* Deep Red: buttons, links, small red text */
  --red-dark: #5A060B;    /* hover/pressed on Deep Red */
  --red-soft: #FF6B70;    /* small red text on black */
  --red-mid: #C8141C;     /* header / hero gradient stops */
  --red-light: #F2484E;
  --red-rule: #FBD3D5;    /* line under the header */
  --tint-top: #FCEDEE;    /* page wash under the header */
  --accent-bg: #FBE7E8;   /* selected menu item */
  --wash: #FDFAFA;        /* table heads, board rows */
  --wash-hover: #FDF8F8;
  --wash-strong: #F1E6E6; /* segmented switch, pipeline columns */
  --wash-col: #F6ECEC;
  --ink: #111111;         /* Tiru Black */
  --text: #1B1B1F;
  --muted: #5E5E68;
  --tint: #FBF4F4;
  --line: #ECE3E3;
  --paper: #FFFFFF;
  --surface-dark: #18181C;

  /* Status (price health, stock) keeps green/amber meaning; "bad" uses Deep Red. */
  --ok: #166534;   --ok-bg: #E7F5EC;
  --warn: #8A5300; --warn-bg: #FDF3DC;
  --bad: #8E0B12; --bad-bg: #FBE7E8;   /* stays red whatever app colour the user picks */

  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;         /* cards */
  --radius-sm: 10px;      /* inputs, small elements */
  --shadow: 0 1px 2px rgb(17 17 17 / .05), 0 12px 32px -12px rgb(17 17 17 / .18);
  --glow: 0 8px 20px -8px color-mix(in srgb, var(--red) 55%, transparent);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gap: 1rem;
  font-family: var(--font-body);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg, var(--tint-top) 0, var(--tint) 220px) no-repeat, var(--tint); line-height: 1.5; font-size: 15px; }
a { color: var(--red-deep); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 var(--gap); }
h2 { font-size: 1.1rem; font-weight: 600; margin: 2rem 0 .75rem; }
.muted { color: var(--muted); }
::selection { background: var(--red); color: #fff; }

/* Top bar: Tiru Black with a Tiru Red rule */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .75rem;
  height: 56px; padding: 0 16px; color: #fff;
  background: linear-gradient(90deg, var(--red-deep) 0%, var(--red-mid) 45%, var(--red) 80%, var(--red-light) 100%);
  border-bottom: 3px solid var(--red-rule);
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--red-deep) 60%, transparent);
}
.top .brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
.top .brand img { width: 30px; height: auto; }
.nav-toggle { color: #fff !important; }
.nav-toggle:hover { background: rgb(255 255 255 / .15) !important; }
/* Account menu, top right */
.who { margin-left: auto; position: relative; }
.who > summary { list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .3rem .55rem .3rem .3rem;
  border-radius: 999px; color: #fff; }
.who > summary::-webkit-details-marker { display: none; }
.who > summary:hover, .who[open] > summary { background: rgb(255 255 255 / .16); }
.who-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.who-text strong { font-size: .9rem; }
.who-text small { font-size: .74rem; color: rgb(255 255 255 / .85); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--red-deep);
  font-family: var(--font-display); font-weight: 700; font-size: .85rem; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; background: linear-gradient(135deg, var(--red-deep), var(--red)); color: #fff; }
.who-menu { position: absolute; right: 0; top: 2.9rem; min-width: 15rem; display: grid; padding: .4rem; z-index: 40;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--text); }
.who-head { margin: 0; padding: .55rem .7rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; font-size: .9rem; }
.who-menu a, .who-out { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: 9px; color: var(--text);
  text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.who-menu a:hover, .who-out:hover { background: var(--tint); color: var(--red-deep); }
.who-menu form { margin: 0; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.who-out { color: var(--red-deep); font-weight: 600; }
.who-att .who-out { color: var(--ok); }
.profile-hero { display: flex; gap: 1rem; align-items: center; margin: 0 0 1.25rem; }
.profile-hero h1 { margin: 0; }
.profile-hero p { margin: .2rem 0 0; }

.page { min-width: 0; width: 100%; padding: 1.75rem 24px 3rem; } /* full width, like Odoo: lists use the whole screen */

/* Sidebar: sections that fold, ☰ hides it (desktop) or slides it in (phone). */
.nav-toggle { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: #D6D6DC; cursor: pointer; }
.nav-toggle:hover { background: rgb(255 255 255 / .08); color: #fff; }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 59px); }
.side { position: sticky; top: 59px; align-self: start; height: calc(100vh - 59px); overflow-y: auto;
  background: var(--paper); border-right: 1px solid var(--line); padding: 1rem .75rem 2rem; }
.side nav { display: grid; gap: .35rem; }
.side-group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding: .7rem .75rem .35rem; font-family: var(--font-display); font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s var(--ease); }
.side-group[open] > summary::after { transform: rotate(45deg); }
.side-group > summary:hover { color: var(--ink); }
.side-link { position: relative; display: block; padding: .5rem .75rem; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.side-link:hover { background: var(--tint); color: var(--ink); }
.side-link[aria-current] { background: var(--accent-bg); color: var(--red-deep); font-weight: 700; }
.side-link[aria-current]::before { content: ""; position: absolute; left: -.75rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.side-menu > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.side-menu > summary::-webkit-details-marker { display: none; }
.side-menu > summary::after { content: "+"; font-weight: 400; color: var(--muted); font-size: 1.05rem; line-height: 1; }
.side-menu[open] > summary::after { content: "−"; }
.side-menu.is-here > summary { color: var(--red-deep); font-weight: 700; }
.side-subs { display: grid; gap: .1rem; margin: .15rem 0 .4rem .9rem; padding-left: .6rem; border-left: 1px solid var(--line); }
.side-sub { display: block; padding: .35rem .6rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.side-sub:hover { background: var(--tint); color: var(--ink); }
.side-sub[aria-current] { background: var(--accent-bg); color: var(--red-deep); font-weight: 700; }
.side-scrim { position: fixed; inset: 59px 0 0; background: rgb(17 17 17 / .4); z-index: 19; }
body.nav-closed .shell { grid-template-columns: minmax(0, 1fr); }
body.nav-closed .side { display: none; }
@media (max-width: 900px) {
  .shell, body.nav-closed .shell { grid-template-columns: minmax(0, 1fr); }
  .side, body.nav-closed .side { display: block; position: fixed; top: 59px; left: 0; z-index: 20; width: min(280px, 85vw);
    transform: translateX(-105%); transition: transform .25s var(--ease); box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  .page { padding: 1.25rem 16px 3rem; }
}

/* Sign-in pages: white card on Tiru Black with a faint grid and red glow */
.signed-out {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(600px 300px at 50% 0%, rgb(237 28 36 / .22), transparent 70%),
    linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--ink);
}
.narrow { width: min(420px, calc(100% - 32px)); margin: 6vh auto; padding: 2rem 1.75rem; background: var(--paper);
  border-radius: var(--radius); box-shadow: 0 30px 60px -20px rgb(0 0 0 / .6); }
.auth-logo { display: block; width: 56px; height: auto; margin: 0 0 1.25rem; }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--gap); margin-bottom: 1.25rem; }
.head h1 { margin: 0; }

label { display: block; font-weight: 600; font-size: .88rem; color: var(--ink); }
input, select, textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .55rem .7rem;
  font: inherit; font-weight: 400; color: var(--text);
  border: 1px solid #DCD2D2; border-radius: var(--radius-sm); background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #C9BDBD; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent); outline: none; }
input[type=checkbox] { display: inline; width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--red-deep); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .75; }
.stack { display: grid; gap: var(--gap); }
.wide { max-width: 640px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
label.check { display: flex; gap: .55rem; align-items: center; font-weight: 400; margin: .4rem 0; }
code { font-size: .78rem; color: var(--muted); background: var(--tint); padding: .05rem .35rem; border-radius: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--gap); }
.filters select, .filters input { width: auto; margin: 0; }
.filters label { display: flex; align-items: center; gap: .4rem; font-weight: 500; }
[hidden] { display: none !important; }

/* Buttons: pills. Deep Red = the one main action; outline for the second. */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.25rem; border-radius: 999px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background-color .2s var(--ease), border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.btn { background: var(--red-deep); color: #fff; border: 1px solid var(--red-deep); box-shadow: var(--glow); }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid #D9CECE; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.row-actions form { margin: 0; }

.flash { padding: .7rem .9rem; border-radius: var(--radius-sm); margin: 0 0 var(--gap); border-left: 4px solid; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-flag { background: #FFF3E6; color: #9A4A00; border-left-color: #F28C28; }
.flash-info { background: var(--paper); color: var(--ink); border-left-color: var(--red); }

/* Tables sit on white cards */
/* Lists scroll inside their own box, so the sideways scrollbar is always on screen and the header row stays put. */
.table-wrap { overflow: auto; max-height: calc(100vh - 190px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-display); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; background: var(--wash); }
tbody tr:hover td { background: var(--wash-hover); }
tbody tr:last-child td { border-bottom: 0; }
tr.dim td { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.perm-grid td:not(:first-child), .perm-grid th:not(:first-child) { text-align: center; }
.perm-grid select { width: auto; margin: 0 auto; padding: .25rem .5rem; }
pre { white-space: pre-wrap; word-break: break-word; font-size: .8rem; margin: .3rem 0 0; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; }
form .table-wrap { max-height: none; } /* item tables inside forms grow with their rows */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin: .8rem 0; }
.pager-per { margin-left: auto; }
.pager-per label { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); }
.pager-per select { width: auto; padding: .3rem .5rem; }
/* Column picker: a settings icon at the right end of the list's header row (like Odoo) */
th.col-pick-th { width: 2.5rem; padding: 0 .4rem; text-align: right; }
.col-pick > summary { list-style: none; cursor: pointer; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; color: var(--muted); }
.col-pick > summary::-webkit-details-marker { display: none; }
.col-pick > summary:hover, .col-pick[open] > summary { background: var(--accent-bg); color: var(--red-deep); }
.col-pick .col-menu { position: fixed; z-index: 50; display: grid; gap: .15rem; min-width: 14rem; max-height: 60vh; overflow: auto; text-transform: none; letter-spacing: 0;
  padding: .6rem .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-family: var(--font-body); }
.col-pick .col-menu label { display: flex; align-items: center; gap: .5rem; font-weight: 400; font-size: .9rem; white-space: nowrap; color: var(--text); }
.col-pick .col-menu button { margin-top: .4rem; justify-self: start; }
details summary { cursor: pointer; color: var(--red-deep); font-weight: 500; }

.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--line); color: var(--muted); vertical-align: middle; font-family: var(--font-body); letter-spacing: .01em; }
.badge-active, .badge-green { background: var(--ok-bg); color: var(--ok); }
.badge-invited, .badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-blue { background: #E6EEFB; color: #1E3A8A; }
.badge-inactive, .badge-red { background: var(--bad-bg); color: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Phones */
@media (max-width: 760px) {
  .who-text { display: none; }
  h1 { font-size: 1.35rem; }
}

/* Tax invoice: laid out like the owner's invoice TIRU/26-27/003. Colours print (print-color-adjust). */
.invoice-doc { --inv-red: #8E0B12; --inv-line: #E7C9CB; --inv-soft: #FBEEEF;
  position: relative; background: #fff; color: #1b1b1f; border: 1px solid var(--line); border-radius: 6px;
  margin-top: 1.25rem; font-size: 12.5px; line-height: 1.45; overflow: hidden;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.invoice-doc h3 { font-family: var(--font-body); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--inv-red); margin: 0 0 .45rem; }
.invoice-doc p { margin: 0 0 .2rem; }
.inv-band { background: linear-gradient(90deg, #8E0B12, #ED1C24 70%, #F2343B); color: #fff; padding: 26px 40px 22px; }
.inv-band p { color: rgb(255 255 255 / .9); font-size: 11.5px; }
.inv-co { font-family: var(--font-body); font-weight: 300; font-size: 1.9rem; letter-spacing: .01em; color: #fff; margin: 0 0 .5rem; text-transform: uppercase; }
.inv-co strong { font-weight: 800; }
.inv-gst { font-weight: 700; color: #fff !important; margin-top: .6rem !important; }
.inv-title { font-family: var(--font-body); text-align: center; font-size: 1rem; font-weight: 700; letter-spacing: .35em; color: var(--inv-red);
  text-transform: uppercase; margin: 0; padding: 14px 0 12px; border-bottom: 2px solid #ED1C24; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; margin: 0 40px; border-bottom: 1px solid var(--inv-line); }
.inv-parties > div { padding: 16px 14px 14px; }
.inv-parties > div + div { border-left: 1px solid var(--inv-line); }
.inv-cust { font-weight: 700; font-size: 13.5px; }
.inv-parties dl { display: grid; grid-template-columns: 8.5rem 1fr; gap: .25rem .5rem; margin: 0; }
.inv-parties dt { color: #555; }
.inv-parties dd { margin: 0; font-weight: 700; }
.invoice-doc table { width: auto; font-size: 12px; border-collapse: collapse; }
.invoice-doc th, .invoice-doc td { padding: .45rem .6rem; border: 0; vertical-align: top; }
.invoice-doc tbody tr:hover td { background: none; }
.inv-lines { margin: 18px 40px 0; width: calc(100% - 80px) !important; border: 1px solid var(--inv-line); }
.inv-lines th { background: var(--inv-red); color: #fff; font-family: var(--font-body); font-size: .68rem; font-weight: 700;
  text-transform: none; letter-spacing: .02em; text-align: center; padding: .75rem .6rem; border-left: 1px solid rgb(255 255 255 / .25); }
.inv-lines th.num, .inv-lines td.num { text-align: right; }
.inv-lines td { border-left: 1px solid var(--inv-line); padding-top: .9rem; }
.inv-lines td.inv-desc small { color: #666; font-weight: 400; }
.inv-lines .inv-fill td { height: 3.2rem; padding: 0; }
.inv-sums { display: grid; grid-template-columns: 1fr 17rem; margin: 0 40px; }
.inv-words { padding: 16px 0 0; }
.inv-note { margin-top: .6rem !important; }
.inv-pay { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 1rem; }
.inv-qr { text-align: center; font-size: 10.5px; color: #444; }
.inv-qr img { display: block; width: 96px; height: 96px; object-fit: contain; margin: 0 auto .2rem; }
.qr-setting { display: grid; gap: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ⋯ row menu */
.row-menu { position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; width: 2rem; height: 2rem; display: grid; place-items: center;
  border-radius: 8px; font-size: 1.2rem; line-height: 1; color: var(--ink); }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover, .row-menu[open] > summary { background: var(--tint); }
.row-menu .menu { position: absolute; right: 0; top: 2.2rem; z-index: 10; min-width: 13rem; display: grid; padding: .35rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.table-wrap .row-menu .menu { position: static; margin-top: .3rem; box-shadow: none; } /* tables scroll sideways: an absolute menu would be cut off */
.row-menu .menu a { padding: .5rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; white-space: nowrap; }
.row-menu .menu a:hover { background: var(--tint); color: var(--red-deep); }
/* tabs */
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 1.25rem; border-bottom: 1px solid var(--line); }
.tabs > a { padding: .55rem .9rem; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs > a[aria-current] { color: var(--red-deep); border-bottom-color: var(--red); }
.tabs-filter { margin-left: auto; }
.tabs-filter select { width: auto; margin: 0 0 .3rem; }
/* reminder list */
.rem-day { margin: 1.5rem 0 .6rem; font-size: 1rem; }
.rem-day.is-late { color: var(--red-deep); }
.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.rem { display: grid; grid-template-columns: 4rem 1fr auto; gap: 1rem; align-items: start; background: var(--paper);
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.rem.is-late { border-left-color: var(--red); }
.rem-when { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.rem-when small { display: block; color: var(--red-deep); font-family: var(--font-body); }
.rem-what p { margin: 0 0 .2rem; }
.rem-type { display: inline-block; font-size: .8rem; font-weight: 700; background: var(--tint); border-radius: 999px; padding: .1rem .55rem; margin-right: .3rem; }
.rem-outcome { color: var(--ok); }
.rem-meta { font-size: .85rem; }
.rem-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; justify-content: flex-end; }
.rem-actions .btn, .rem-actions .btn-ghost { padding: .45rem .9rem; font-size: .88rem; }
.rem-pop { position: relative; }
.rem-pop > summary { list-style: none; }
.rem-pop > summary::-webkit-details-marker { display: none; }
.rem-pop form { position: absolute; right: 0; top: 2.6rem; z-index: 10; width: 280px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px; padding: 1rem; box-shadow: var(--shadow); }
@media (max-width: 700px) {
  .rem { grid-template-columns: 1fr; }
  .rem-actions { justify-content: flex-start; }
  .rem-pop form { left: 0; right: auto; }
}
/* segmented switch (Board / List) */
.seg { display: inline-flex; padding: .2rem; background: var(--wash-strong); border-radius: 999px; }
.seg a { padding: .45rem .9rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.seg a[aria-current] { background: var(--paper); color: var(--red-deep); box-shadow: 0 1px 3px rgb(17 17 17 / .12); }
/* enquiry pipeline */
.pipe-closed { margin-left: auto; align-self: center; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; }
.pipe-col { background: var(--wash-col); border-radius: 16px; padding: .8rem; min-height: 8rem; }
.pipe-col h2 { margin: 0 0 .7rem; font-size: .95rem; }
.pipe-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .6rem; box-shadow: 0 1px 2px rgb(17 17 17 / .05); }
.pipe-card.needs-action { border-left: 4px solid var(--red); }
.pipe-card p { margin: 0 0 .35rem; font-size: .9rem; }
.pipe-card .muted { font-size: .85rem; }
.pipe-products { color: var(--ink); }
.pipe-meta { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.pipe-move { display: flex; gap: .5rem; align-items: center; margin-top: .4rem; font-size: .85rem; }
.pipe-move select { width: auto; margin: 0; padding: .25rem .4rem; font-size: .85rem; }
.pipe-empty { font-size: .85rem; }
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(4, 80vw); } }
/* Forms: numbered section cards, two columns, actions bar */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem 1.25rem; margin: 0 0 1rem; }
.form-card > header { display: flex; gap: .8rem; align-items: flex-start; margin: 0 0 1rem; }
.form-card > header .num { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--red-deep); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.form-card > header h2 { margin: .15rem 0 .1rem; font-size: 1.02rem; }
.form-card > header p { margin: 0; color: var(--muted); font-size: .88rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.1rem; }
.fields > .span-2 { grid-column: 1 / -1; }
.fields label small, .fields .hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.fields label.check { align-self: end; }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  padding: .8rem 1.25rem; margin: 1rem 0 0; background: rgb(255 255 255 / .92); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -8px 24px -18px rgb(17 17 17 / .35); }
.form-actions .spacer { flex: 1; }
.form-actions a:not(.btn):not(.btn-ghost) { color: var(--muted); }
@media (max-width: 700px) { .fields, .fields-3 { grid-template-columns: 1fr; } .form-card { padding: 1rem; } }

/* Stage tracker */
.stages { list-style: none; display: flex; margin: 0 0 1.25rem; padding: .9rem 1rem; gap: 0; overflow-x: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.stages li { flex: 1; min-width: 6.5rem; position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem;
  color: var(--muted); font-size: .82rem; font-weight: 600; text-align: center; }
.stages li::before { content: ""; position: absolute; top: .9rem; left: calc(-50% + 1.1rem); right: calc(50% + 1.1rem); height: 2px; background: var(--line); }
.stages li:first-child::before { display: none; }
.stages .dot { position: relative; z-index: 1; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); border: 2px solid #D9CECE; font-size: .8rem; color: var(--muted); }
.stages li.done { color: var(--ink); }
.stages li.done .dot { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.stages li.done + li::before, .stages li.done::before { background: var(--red-deep); }
.stages li.current { color: var(--red-deep); }
.stages li.current .dot { border-color: var(--red); color: var(--red-deep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 15%, transparent); font-weight: 700; }
.stages li.failed { color: var(--bad); }
.stages li.failed .dot { background: var(--bad); border-color: var(--bad); color: #fff; }

.profit-box { margin-top: 1.5rem; }
.profit-box tfoot th { background: var(--wash); font-family: var(--font-body); font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.loss { color: var(--bad); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin: 0 0 1.25rem; }
.kpis > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.kpis span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpis strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); }
.kpis small { display: block; color: var(--muted); }
.kpis .good strong { color: var(--ok); }
.kpis.dash > a { display: block; text-decoration: none; color: inherit; transition: transform .15s var(--ease), box-shadow .15s; }
.kpis.dash > a:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #E9CACC; }
.kpis .bad strong { color: var(--bad); }
.kpis small a { color: inherit; }
.dnote { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 0 0 1.25rem; }
.dnote > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; }
.dnote h2 { margin: 0; }
.dnote dl { display: grid; grid-template-columns: auto auto; gap: .2rem .8rem; margin: 0; font-size: .92rem; }
.dnote dt { color: var(--muted); }
.dnote dd { margin: 0; font-weight: 600; }
@media print { .dnote { border: 0; padding: 0; } }
.price-check { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0 0 1.25rem; box-shadow: var(--shadow); }
.price-check label { font-family: var(--font-display); font-size: 1rem; }
.price-check input { flex: 1; min-width: 14rem; margin: 0; }
.pc-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; gap: .7rem; align-items: end; margin: 0 0 1.25rem; }
.pc-pick label { margin: 0; }
.pc-table th[scope=row] { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); background: var(--wash); white-space: nowrap; }
.pc-table td { font-size: 1rem; text-align: right; }
.pc-head { vertical-align: bottom; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .92rem; color: var(--ink); white-space: normal; min-width: 14rem; text-align: right; }
.pc-head img { display: block; margin: 0 0 .5rem auto; object-fit: contain; border-radius: 10px; background: #fff; }
.pc-head small { display: block; color: var(--muted); font-weight: 400; margin-top: .2rem; }
.pc-q1 td { font-weight: 700; }
.pc-floor td { color: var(--red-deep); font-weight: 700; }
.pc-best { background: var(--ok-bg) !important; color: var(--ok) !important; }
@media (max-width: 760px) { .pc-pick { grid-template-columns: 1fr; } }
.rm-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin: 0 0 1.5rem; }
.rm-area { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; }
.rm-area p { margin: 0 0 .4rem; font-size: .92rem; }
.rm-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rm-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--red)); border-radius: 99px; }
.rm-area small { color: var(--muted); }
.rm-head { margin: 1.5rem 0 .6rem; }
.rm-head.rm-done { color: var(--ok); }
.rm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.rm-item { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--line); border-radius: 12px; padding: .55rem .8rem; }
.rm-item.rm-next, .rm-item.rm-doing { border-left-color: var(--red); }
.rm-item.rm-done { border-left-color: var(--ok); }
.rm-item.rm-done .rm-title { color: var(--muted); }
.rm-title { flex: 1; min-width: 14rem; font-weight: 600; }
.rm-area-tag { font-size: .85rem; }
.rm-edit { display: flex; gap: .4rem; }
.rm-edit select { width: auto; margin: 0; padding: .25rem .45rem; font-size: .85rem; }
.rm-prio-1 { background: var(--bad-bg); color: var(--bad); }
.rm-prio-2 { background: var(--warn-bg); color: var(--warn); }
.rm-add { margin-top: 1.5rem; padding: 1rem; background: var(--paper); border: 1px dashed #D9CECE; border-radius: 14px; }
.job-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.job-actions .rem-pop form { left: 0; right: auto; }
/* Schedule board */
.board-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1rem; align-items: start; }
.board-main { min-width: 0; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; }
.board { display: grid; grid-template-columns: 9.5rem repeat(var(--slots), minmax(26px, 1fr)); min-width: 980px; row-gap: .35rem; }
.board-corner { grid-column: 1; }
.board-hour { font-size: .72rem; color: var(--muted); border-left: 1px solid var(--line); padding: .2rem .3rem; }
.board-tech { grid-column: 1; display: flex; flex-direction: column; justify-content: center; padding: .4rem .6rem; background: var(--wash); border-radius: 10px 0 0 10px; font-size: .9rem; }
.board-tech small { color: var(--muted); font-size: .75rem; }
.board-row { display: grid; grid-template-columns: repeat(var(--slots), 1fr); min-height: 3.6rem; background: var(--wash); border-radius: 0 10px 10px 0; }
.board-free { grid-row: 1; border-left: 1px dashed #EADCDC; }
a.board-free:hover { background: var(--bad-bg); }
.board-job { grid-row: 1; z-index: 1; margin: .25rem 1px; padding: .3rem .45rem; border-radius: 8px; overflow: hidden; text-decoration: none;
  font-size: .76rem; line-height: 1.25; color: var(--ink); background: var(--warn-bg); border: 1px solid #F0D9A8; display: flex; flex-direction: column; }
.board-job strong { font-size: .76rem; }
.board-job small { color: var(--muted); }
.board-job.job-in-progress { background: var(--bad-bg); border-color: #F2B8BB; }
.board-job.job-completed { background: var(--ok-bg); border-color: #BFE3CB; }
.board-job.job-on-hold { background: #EEE; border-color: #DDD; }
.board-todo { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.board-todo h2 { margin: 0 0 .6rem; font-size: .95rem; }
.todo-job { display: block; padding: .5rem .6rem; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 10px; margin-bottom: .45rem;
  text-decoration: none; color: var(--ink); font-size: .88rem; }
.todo-job small { display: block; color: var(--muted); }
.week th.is-today { color: var(--red-deep); }
.week-cell a { display: block; font-size: .8rem; text-decoration: none; padding: .15rem .3rem; border-radius: 6px; background: var(--warn-bg); color: var(--ink); margin-bottom: .2rem; }
.week-cell small { color: var(--muted); font-size: .75rem; }
.week-cell.load-full { background: var(--bad-bg); }
.week-cell.load-busy { background: #FFF7E8; }
.week-cell.load-free small { color: var(--ok); }
@media (max-width: 1000px) { .board-wrap { grid-template-columns: 1fr; } }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .9rem; margin: 0 0 1.5rem; }
.app-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; padding: 1rem; min-height: 9rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .15s var(--ease), box-shadow .15s; }
.app-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--red-deep) 45%, transparent); color: var(--ink); }
.app-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 14px; font-size: 1.6rem; margin-bottom: .35rem;
  background: linear-gradient(135deg, var(--red-deep), var(--red)); box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--red-deep) 80%, transparent); }
.app-invoicing .app-icon { background: linear-gradient(135deg, #5A060B, #B4121A); }
.app-stock .app-icon { background: linear-gradient(135deg, #B4121A, #F2484E); }
.app-dealer .app-icon { background: linear-gradient(135deg, #3A3A44, #6C6C78); }
.app-retailers .app-icon { background: linear-gradient(135deg, #134E4A, #0D9488); }
.app-service .app-icon { background: linear-gradient(135deg, #8A5300, #D18A1B); }
.app-hr .app-icon { background: linear-gradient(135deg, #166534, #2E9B57); }
.app-settings .app-icon { background: linear-gradient(135deg, #2B2B33, #55555F); }
.app-tile strong { font-family: var(--font-display); font-size: 1rem; }
.app-tile small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.app-count { position: absolute; top: .8rem; right: .8rem; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.side-home { color: var(--muted) !important; font-size: .88rem; }
.side-app { margin: .6rem .75rem .3rem; font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.demo-flag { order: 3; margin-left: auto; background: #fff; color: var(--red-deep); font-weight: 800; font-size: .72rem; letter-spacing: .08em;
  padding: .3rem .7rem; border-radius: 999px; text-decoration: none; box-shadow: 0 0 0 2px rgb(255 255 255 / .5); animation: demoPulse 2s ease-in-out infinite; }
.demo-flag + .brand { order: 1; }
.demo-flag ~ .who { order: 4; margin-left: .6rem; }
@keyframes demoPulse { 50% { box-shadow: 0 0 0 5px rgb(255 255 255 / .25); } }
@media (prefers-reduced-motion: reduce) { .demo-flag { animation: none; } }
.pin-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .35rem; }
.pin-row input { flex: 1; min-width: 14rem; margin: 0; }
.geo-form { margin: 0; }
.flag { white-space: nowrap; }
.badge-orange { background: #FFE8D1; color: #9A4A00; border: 1px solid #F6B97A; }
.price-box .span-all { grid-column: 1 / -1; margin: 0; }
.page-back { float: left; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; margin: -.1rem .7rem 0 -.2rem;
  border-radius: 50%; color: var(--red); font-size: 2.1rem; line-height: 1; font-weight: 300; text-decoration: none; }
.page-back:hover { background: var(--bad-bg); color: var(--red-deep); }
.page-back + * { overflow: hidden; } /* heading row sits beside the arrow */
@media print { .page-back { display: none; } }
/* Home */
.hero { display: grid; grid-template-columns: 1fr minmax(280px, 420px); gap: 1.5rem; align-items: center; margin: 0 0 1.5rem;
  padding: 1.4rem 1.6rem; border-radius: 22px; color: #fff;
  background: radial-gradient(500px 220px at 100% 0%, rgb(255 255 255 / .18), transparent 60%), linear-gradient(120deg, var(--red-deep) 0%, var(--red-mid) 55%, var(--red) 100%);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--red-deep) 90%, transparent); }
.hero h1 { color: #fff; margin: .1rem 0 .7rem; font-size: 1.7rem; }
.hero-date { margin: 0; font-size: .85rem; letter-spacing: .04em; color: rgb(255 255 255 / .85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.hero .btn { background: #fff; color: var(--red-deep); border-color: #fff; box-shadow: none; }
.hero .btn:hover { background: var(--accent-bg); color: var(--red-dark); }
.hero .btn-ghost { background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .45); }
.hero .btn-ghost:hover { background: rgb(255 255 255 / .22); color: #fff; border-color: #fff; }
.hero-search { background: rgb(255 255 255 / .14); border: 1px solid rgb(255 255 255 / .3); border-radius: 16px; padding: .9rem 1rem; }
.hero-search label { color: #fff; font-family: var(--font-display); font-size: .95rem; }
.hero-search span { display: flex; gap: .5rem; margin: .45rem 0 .4rem; }
.hero-search input { margin: 0; border: 0; }
.hero-search a { color: #fff; font-size: .85rem; }
.dash-title { margin: 1.8rem 0 .8rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.kpi { --c: #555; --bg: #F3F3F5; position: relative; display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s var(--ease), box-shadow .15s; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -16px rgb(17 17 17 / .3); color: var(--ink); }
.kpi-icon { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 14px; background: var(--bg); color: var(--c);
  font-size: 1.4rem; font-weight: 800; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kpi-body strong { font-family: var(--font-display); font-size: 1.45rem; color: var(--c); line-height: 1.2; }
.kpi-body small { color: var(--muted); font-size: .8rem; }
.kpi-go { margin-left: auto; color: var(--muted); font-size: 1.1rem; transition: transform .15s; }
.kpi:hover .kpi-go { transform: translateX(3px); color: var(--c); }
.kpi-green { --c: #15803D; --bg: #E7F6EC; }
.kpi-teal { --c: #0F766E; --bg: #E2F5F3; }
.kpi-orange { --c: #C2570C; --bg: #FFF0E3; }
.kpi-red { --c: #B4121A; --bg: #FDE8E9; }
.kpi-blue { --c: #1D4ED8; --bg: #E8EEFE; }
.kpi-purple { --c: #7E22CE; --bg: #F3E8FF; }
.kpi-amber { --c: #A16207; --bg: #FEF6DD; }
.kpi-slate { --c: #475569; --bg: #EEF1F5; }
.day-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.day-grid.one { grid-template-columns: 1fr; }
.day-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: .4rem 0 .6rem; }
.day-panel header { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.1rem .5rem; border-bottom: 1px solid var(--line); }
.day-panel h3 { margin: 0; font-size: 1rem; }
.day-row { display: flex; align-items: center; gap: .8rem; padding: .6rem 1.1rem; border-bottom: 1px solid var(--line); }
.day-row:last-child { border-bottom: 0; }
.day-row.late .day-time { color: var(--bad); }
.day-time { flex: none; width: 3.4rem; font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--ink); }
.day-what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.day-what small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-acts { display: flex; gap: .3rem; }
.day-acts a { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--tint); text-decoration: none; }
.day-acts a:hover { background: var(--bad-bg); }
.day-empty { margin: 0; padding: 1rem 1.1rem; color: var(--muted); }
@media (max-width: 900px) { .hero, .day-grid { grid-template-columns: 1fr; } }
.price-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; align-content: start; }
.price-box > div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; }
.price-box span { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.price-box strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.price-box .floor { border-color: var(--red); }
.price-box .floor strong { color: var(--red-deep); }
.price-box .dealer { background: var(--tint); }
.price-box small { display: block; color: var(--muted); }
.price-table .floor { color: var(--red-deep); font-weight: 700; }
.price-table .q1 { font-weight: 700; }
.terms-edit { display: grid; gap: .45rem; padding-left: 1.4rem; margin: 0 0 1rem; }
.terms-edit li > * { vertical-align: middle; }
.terms-edit input[type=checkbox] { margin-right: .5rem; }
.terms-edit input:not([type]) { display: inline-block; width: calc(100% - 2rem); margin: 0; }
tr.cat-main td { background: var(--wash); font-weight: 700; }
tr.cat-sub td:first-child { padding-left: 2rem; }
.qr-setting img { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.inv-total { width: 100% !important; border: 1px solid var(--inv-line); border-top: 0; }
.inv-total td { padding: .6rem .7rem; border-bottom: 1px solid var(--inv-line); }
.inv-total td.num { text-align: right; }
.inv-total .grand td { background: var(--inv-red); color: #fff; font-weight: 700; font-size: 14px; border-bottom: 0; }
.inv-hsn { margin: 18px 40px 0; width: calc(100% - 80px) !important; border: 1px solid var(--inv-line); }
.inv-hsn th { background: var(--inv-soft); color: var(--inv-red); font-family: var(--font-body); font-size: .66rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.inv-hsn th, .inv-hsn td { text-align: center; border-bottom: 1px solid var(--inv-line); }
.inv-foot { display: grid; grid-template-columns: 1fr 15rem; gap: 2rem; margin: 20px 40px 28px; }
.inv-foot ol { margin: 0; padding-left: 1.2rem; font-size: 11px; color: #333; }
.inv-foot li { margin-bottom: .25rem; }
.inv-sign { text-align: right; }
.inv-sign-line { margin-top: 4.5rem !important; border-top: 1px solid #888; padding-top: .4rem; }
.inv-bottom { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .35em; padding: 10px; text-transform: uppercase; }
.invoice-doc.is-draft::before { content: "DRAFT"; position: absolute; inset: 40% 0 auto; text-align: center; font: 700 7rem var(--font-display);
  color: rgb(237 28 36 / .08); transform: rotate(-18deg); pointer-events: none; }
.pay-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.pay-sums { font-size: 1.02rem; margin: 0 0 .75rem; }
.pay-sums .due { color: var(--bad); }
.print-page { background: #eee; padding: 16px; }
.print-page .invoice-doc { max-width: 210mm; margin: 0 auto; }
.print-bar { max-width: 210mm; margin: 0 auto 12px; text-align: right; }
@media (max-width: 640px) {
  .inv-parties, .inv-sums, .inv-foot { display: block; margin-left: 16px; margin-right: 16px; }
  .inv-parties > div + div { border-left: 0; border-top: 1px solid var(--inv-line); }
  .inv-band { padding: 20px 16px; }
  .inv-lines, .inv-hsn { margin-left: 16px; margin-right: 16px; width: calc(100% - 32px) !important; display: block; overflow-x: auto; }
  .inv-sign { text-align: left; margin-top: 1rem; }
}
@page { size: A4; margin: 0; }
@media print {
  body, .print-page { background: #fff; padding: 0; }
  .top, .side, .side-scrim, .no-print, .flash, .pay-box { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .invoice-doc { border: 0; border-radius: 0; margin: 0; max-width: none; }
}

/* App colour (My profile, owner 1 Oct 2026): each theme swaps the accent tokens; "bad" status and invoices stay red.
   Deep shades keep white text and links at 7:1 or better, like Tiru Deep Red. */
/* tints follow the accent */
[data-theme]:not([data-theme="red"]) { --glow: 0 8px 20px -8px color-mix(in srgb, var(--red) 55%, transparent); --accent-bg: color-mix(in srgb, var(--red) 11%, #fff); --wash: color-mix(in srgb, var(--red) 2%, #fff);
  --wash-hover: color-mix(in srgb, var(--red) 4%, #fff); --wash-strong: color-mix(in srgb, var(--red) 12%, #fff); --wash-col: color-mix(in srgb, var(--red) 7%, #fff); }
[data-theme="blue"]     { --red: #2563EB; --red-deep: #1E3A8A; --red-dark: #172554; --red-soft: #7FA6F5; --red-mid: #1D4ED8; --red-light: #4F86F0; --red-rule: #CFDDFB; --tint-top: #EAF0FD; --tint: #F4F7FC; --line: #E0E6F0; }
[data-theme="green"]    { --red: #16A34A; --red-deep: #14532D; --red-dark: #0B3B1F; --red-soft: #6FD39A; --red-mid: #15803D; --red-light: #34C26A; --red-rule: #C9EED6; --tint-top: #E8F6EC; --tint: #F3F9F5; --line: #DDEBE1; }
[data-theme="purple"]   { --red: #9333EA; --red-deep: #4C1D95; --red-dark: #2E1065; --red-soft: #C49BF5; --red-mid: #7E22CE; --red-light: #A95EF0; --red-rule: #E6D5FB; --tint-top: #F3ECFD; --tint: #F8F5FC; --line: #E8E1F1; }
[data-theme="teal"]     { --red: #0D9488; --red-deep: #134E4A; --red-dark: #0A332F; --red-soft: #5FD3C6; --red-mid: #0F766E; --red-light: #2BB3A6; --red-rule: #C6EEE9; --tint-top: #E6F6F4; --tint: #F2F9F8; --line: #DCEBE9; }
[data-theme="charcoal"] { --red: #52525B; --red-deep: #27272A; --red-dark: #18181B; --red-soft: #A1A1AA; --red-mid: #3F3F46; --red-light: #71717A; --red-rule: #D4D4D8; --tint-top: #EFEFF1; --tint: #F6F6F7; --line: #E4E4E7; }
.theme-pick { display: flex; flex-wrap: wrap; gap: .6rem; }
.theme-opt { position: relative; display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem .45rem .45rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); cursor: pointer; font-weight: 500; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt:has(input:checked) { border-color: var(--red-deep); box-shadow: 0 0 0 2px var(--red-deep); }
.theme-opt:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.theme-swatch { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--red-deep), var(--red)); }
.theme-swatch:not([data-theme]), .theme-swatch[data-theme="red"] { --red: #ED1C24; --red-deep: #8E0B12; }

/* Attendance */
.att-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.4rem; margin: 0 0 1.5rem; max-width: 560px; }
.att-date { margin: 0; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.att-state { font-size: 1.1rem; margin: .3rem 0 1rem; }
.att-form { display: grid; gap: .7rem; }
.att-btn { font-size: 1.15rem; padding: .9rem 1.4rem; justify-self: start; min-width: 12rem; }
.att-out { background: var(--ink); }

.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ---- Phone app (v1.2.0): tab bar, scanner, photos ---- */
.tabbar { display: none; }
@media (max-width: 700px) {
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--paper);
    border-top: 1px solid #E6DADA; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11px;
    color: var(--ink); text-decoration: none; border-radius: 10px; min-height: 44px; }
  .tabbar a span { font-size: 20px; line-height: 1; }
  .tabbar a[aria-current="page"] { color: var(--red-deep); background: #FBEDED; font-weight: 700; }
  body.signed-in { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
.scan-btn { margin-left: 4px; padding: 6px 8px; border: 1px solid #D9CECE; border-radius: 8px; background: var(--paper); color: var(--ink); cursor: pointer; vertical-align: middle; }
.scan-btn:hover, .scan-btn:focus-visible { border-color: var(--ink); }
.scan-box { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; padding: 16px; }
.scan-box video { width: 100%; max-width: 520px; border-radius: 12px; outline: 3px solid rgba(255,255,255,.5); outline-offset: -40px; }
.photos { margin-top: 1.5rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: .5rem 0 1rem; }
.photo-grid figure { margin: 0; background: var(--paper); border: 1px solid #EEE4E4; border-radius: 10px; overflow: hidden; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-grid figcaption { padding: 6px 8px; font-size: 12px; }
.photo-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-add input[name="caption"] { flex: 1; min-width: 180px; }
.photo-pick { cursor: pointer; }
.photo-pick[data-count]::after { content: " · " attr(data-count); font-weight: 700; }
.link-btn { background: none; border: 0; padding: 0; color: var(--red-deep); text-decoration: underline; cursor: pointer; font: inherit; }

/* Notes box on a service job and an enquiry (owner, 15 Oct 2026) */
.note-add { display: flex; gap: var(--gap); align-items: end; flex-wrap: wrap; margin: 0 0 1rem; }
.note-add label { flex: 1 1 22rem; }
