/* RF Lighting ERP: one stylesheet, no frameworks, no web fonts (works offline and under a strict CSP). */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e5e9f0;
  --line-2: #d5dbe5;
  --brand: #0d7a63;
  --brand-600: #0b6853;
  --brand-50: #e7f5f1;
  --brand-100: #cdebe2;
  --brand-ink: #ffffff;
  --amber: #f5a524;
  --amber-50: #fff6e5;
  --side: #0b1422;
  --side-2: #121e31;
  --side-text: #c4cddb;
  --side-muted: #6f7d93;
  --good: #117a3c; --good-bg: #e6f6ec;
  --bad: #b42318;  --bad-bg: #fdecea;
  --warn: #93600a; --warn-bg: #fff4dc;
  --info: #1d4ed8; --info-bg: #e8efff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, .18), 0 4px 8px -4px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px rgba(13, 122, 99, .18);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --side-w: 248px;
  --top-h: 60px;
  --hdr-bg: #ffffff; --hdr-line: #e1e5ea; --hdr-text: #1f2733; --hdr-muted: #5b6573;
  --nav-bg: #ffffff; --nav-text: #39414d; --nav-muted: #6b7380; --nav-hover: #f1f3f5;
  --nav-active-bg: #e7f5f1; --nav-active-text: #0a5c4a;
  font-size: 14.5px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 6px; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1.02rem; margin: 0 0 12px; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: .95rem; margin: 18px 0 8px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.r { text-align: right; } .c { text-align: center; }
.bad-text { color: var(--bad); font-weight: 600; }
.good-text { color: var(--good); font-weight: 600; }
.danger-text { color: var(--bad); }
.num, td.r, th.r { font-variant-numeric: tabular-nums; }
pre { white-space: pre-wrap; word-break: break-word; font-size: .8rem; background: var(--panel-2); border: 1px solid var(--line); padding: 12px; border-radius: var(--radius-sm); max-height: 480px; overflow: auto; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: calc(100vh - var(--top-h)); background: linear-gradient(to right, var(--nav-bg) var(--side-w), transparent 0); }
.sidebar { width: var(--side-w); flex: none; background: var(--nav-bg); border-right: 1px solid var(--hdr-line); position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); display: flex; flex-direction: column; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 16px; color: #fff; }
.side-brand:hover { text-decoration: none; color: #fff; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, #12a383, #0a5c4a); display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 6px 16px -6px rgba(18, 163, 131, .7); flex: none; }
.logo svg { width: 22px; height: 22px; }
.side-brand .name, .side-brand .sub { display: block; }
.side-brand .name { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; line-height: 1.1; }
.side-brand .sub { font-size: .72rem; color: var(--side-muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 20px; scrollbar-width: thin; scrollbar-color: #cfd5dc transparent; }
.nav-group { margin-top: 16px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--nav-muted); padding: 0 10px 6px; font-weight: 700; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: var(--nav-text); font-size: .92rem; font-weight: 500; margin: 1px 0; transition: background .12s, color .12s; }
.side-nav a:hover { background: var(--nav-hover); color: var(--hdr-text); text-decoration: none; }
.side-nav a svg.i { width: 18px; height: 18px; color: var(--nav-muted); }
.side-nav a.active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.side-nav a.active svg.i { color: var(--brand); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(145deg, var(--amber), #e07b0c); color: #1b1300; font-weight: 700; display: grid; place-items: center; font-size: .82rem; flex: none; }
.icon-btn { background: transparent; border: 0; color: var(--side-muted); padding: 6px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--side-2); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* Header (redesigned 29 Nov 2026): white, full width, QuickBooks-style. Company name on the left,
   "+ New" quick-create menu, print, date and the account menu on the right. Dark text on white only. */
.topbar { height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 20px 0 14px; background: var(--hdr-bg); border-bottom: 1px solid var(--hdr-line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); position: sticky; top: 0; z-index: 40; color: var(--hdr-text); }
.hdr-brand { display: flex; align-items: center; gap: 11px; width: calc(var(--side-w) - 30px); flex: none; color: var(--hdr-text); min-width: 0; }
.hdr-brand:hover { text-decoration: none; color: var(--hdr-text); }
.hdr-logo { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(145deg, #12a383, #0a5c4a); display: grid; place-items: center; flex: none; }
.hdr-logo svg { width: 22px; height: 22px; }
.hdr-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.hdr-name b { font-size: 1.12rem; font-weight: 750; letter-spacing: -.015em; white-space: nowrap; }
.hdr-name small { font-size: .74rem; color: var(--hdr-muted); font-weight: 500; white-space: nowrap; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--hdr-muted); min-width: 0; padding-left: 18px; border-left: 1px solid var(--hdr-line); height: 28px; }
.crumbs .sep { color: #b4bcc6; }
.crumbs b { color: var(--hdr-text); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.hdr-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--hdr-line); background: #fff; color: var(--hdr-text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.hdr-btn:hover { background: var(--nav-hover); }
.hdr-btn svg.i { width: 17px; height: 17px; }
.top-date { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; color: var(--hdr-muted); padding: 0 4px; white-space: nowrap; }
.top-date svg.i { width: 16px; height: 16px; }
.menu-btn { display: none; width: 38px; height: 38px; place-items: center; background: #fff; border: 1px solid var(--hdr-line); border-radius: 8px; cursor: pointer; color: var(--hdr-text); flex: none; }
.menu-btn .mb-close { display: none; }
.nav-open .menu-btn .mb-open { display: none; }
.nav-open .menu-btn .mb-close { display: grid; }
.menu-btn span { display: grid; place-items: center; }

/* Drop-down menus in the header (<details>, so they work without scripts) */
.hdr-menu { position: relative; }
.hdr-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.hdr-menu > summary::-webkit-details-marker { display: none; }
.hdr-menu > summary:focus-visible, .hdr-btn:focus-visible, .menu-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; color: var(--hdr-text); border: 1px solid var(--hdr-line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; }
.new-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px 0 12px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 650; font-size: .92rem; }
.new-btn:hover, .new-menu[open] > .new-btn { background: var(--brand-600); }
.new-btn svg.i { width: 18px; height: 18px; stroke-width: 2.4; }
.new-pop { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 4px 10px; padding: 16px 14px; width: max-content; max-width: min(760px, calc(100vw - 32px)); }
.np-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hdr-muted); font-weight: 700; padding: 0 10px 6px; }
.np-col a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--hdr-text); font-size: .9rem; white-space: nowrap; }
.np-col a:hover { background: var(--nav-active-bg); color: var(--nav-active-text); text-decoration: none; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--hdr-line); background: #fff; }
.user-btn:hover, .user-menu[open] > .user-btn { background: var(--nav-hover); }
.user-btn .avatar { width: 30px; height: 30px; font-size: .76rem; }
.user-name { font-size: .88rem; font-weight: 600; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--hdr-muted); border-bottom: 2px solid var(--hdr-muted); transform: rotate(45deg) translate(-2px, -2px); margin-left: 2px; }
.user-pop { width: 260px; padding: 6px; }
.up-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; border-bottom: 1px solid var(--hdr-line); margin-bottom: 6px; }
.up-head b { display: block; font-size: .92rem; }
.up-head small { display: block; color: var(--hdr-muted); font-size: .78rem; }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--hdr-text); font: inherit; font-size: .9rem; background: none; border: 0; cursor: pointer; text-align: left; }
.user-pop a:hover, .user-pop button:hover { background: var(--nav-hover); text-decoration: none; }
.user-pop svg.i { width: 17px; height: 17px; color: var(--hdr-muted); }
.user-pop form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--hdr-line); }
.content { flex: 1; width: 100%; max-width: 1440px; padding: 26px 28px 64px; }
.foot-note { padding: 0 28px 24px; color: var(--muted); font-size: .78rem; }
.scrim { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head > div:first-child, .page-head h1 { flex: 1; min-width: 220px; }
.page-head h1 { margin: 0; }
.page-head .lead { color: var(--muted); margin: 4px 0 0; font-size: .92rem; }
.count-badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; background: #eef1f6; color: var(--text-2); font-size: .78rem; font-weight: 600; vertical-align: middle; margin-left: 6px; letter-spacing: 0; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.help { color: var(--muted); font-size: .9rem; margin: -6px 0 16px; max-width: 920px; }
ol.help, ul.help { margin: 0 0 14px; padding-left: 20px; }

/* ---------- Cards and grids ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; flex: 1; }
.card-head .link { font-size: .85rem; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; margin-bottom: 18px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid3 > .card { margin-bottom: 0; }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; display: block; overflow: hidden; }
a.tile:hover { text-decoration: none; color: var(--text); border-color: var(--brand-100); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.tile .top { display: flex; align-items: center; gap: 10px; }
.tile .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.tile .ico.amber { background: var(--amber-50); color: #b26a00; }
.tile .ico.blue { background: var(--info-bg); color: var(--info); }
.tile .ico.red { background: var(--bad-bg); color: var(--bad); }
.tile .ico.slate { background: #eef1f6; color: var(--text-2); }
.tile .label { color: var(--muted); font-size: .84rem; font-weight: 500; }
.tile .value { font-size: 1.5rem; font-weight: 700; margin-top: 12px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value small { font-size: .8rem; color: var(--muted); font-weight: 600; margin-right: 3px; letter-spacing: 0; }
.tile .foot { margin-top: 6px; font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tile .spark { position: absolute; right: 14px; bottom: 14px; width: 92px; height: 30px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-weight: 550; font-size: .9rem; cursor: pointer; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; }
.btn:hover { text-decoration: none; color: var(--text); background: var(--panel-2); border-color: #c3cbd8; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(13,122,99,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #962018; color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: #eef1f6; }
.btn.small { height: 30px; padding: 0 10px; font-size: .82rem; }
.btn.large { height: 44px; padding: 0 22px; font-size: .95rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--brand); }
form.inline { display: inline; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; margin-bottom: 14px; color: var(--text-2); }
label > span { font-weight: 600; color: var(--text); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: .9rem; }
label.check input { margin-top: 3px; }
input, select, textarea { font: inherit; font-size: .92rem; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s; box-shadow: var(--shadow-sm); }
textarea { height: auto; padding: 9px 11px; min-height: 64px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; padding: 0; box-shadow: none; accent-color: var(--brand); flex: none; }
input[type=file] { height: auto; padding: 8px; }
input:hover, select:hover, textarea:hover { border-color: #b9c2d0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder { color: #94a3b8; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 18px; }
.fields .span2 { grid-column: span 2; }
.fields label .btn { align-self: flex-start; margin-top: 2px; }
.form-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin: 8px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.filters.inset { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; box-shadow: none; padding: 14px 16px; }
.filters input, .filters select { width: auto; }
.filters label { flex-direction: row; align-items: center; margin: 0; gap: 8px; color: var(--muted); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; width: 16px; height: 16px; }
.search input { width: 100%; padding-left: 35px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; white-space: nowrap; background: var(--panel-2); position: sticky; top: 0; }
thead th:first-child { border-top-left-radius: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: #f7f9fc; }
tbody tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; } th.c, td.c { text-align: center; }
td a { font-weight: 550; }
tfoot td { border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 650; background: var(--panel-2); }
.card > table, .card > .table-wrap > table { margin: 0; }
.card.table-wrap, .card.flush { padding: 0; }
.card.table-wrap > h2, .card.table-wrap > p, .card.table-wrap > .card-head { padding: 16px 20px 0; margin-bottom: 12px; }
.card.table-wrap > p { padding-bottom: 12px; }
table.dense td, table.dense th { padding: 7px 10px; font-size: .84rem; }
table.lines td { padding: 6px; border-bottom: 1px solid var(--line); }
table.lines th { position: static; }
table.lines select { min-width: 160px; }
table.lines td[data-col="item_id"] select, table.lines td[data-col="account_id"] select, table.lines td[data-col="party"] select { min-width: 300px; }
table.lines input[type=number] { min-width: 90px; }
table.lines td.idx { color: var(--muted); font-size: .8rem; width: 34px; text-align: center; }
table.perm tr.group td { background: var(--panel-2); font-weight: 700; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
tr.muted td { color: var(--muted); }
.empty { text-align: center; padding: 44px 20px !important; color: var(--muted); }
.empty svg.i { width: 34px; height: 34px; color: #b5bfcd; display: block; margin: 0 auto 10px; stroke-width: 1.4; }
.empty b { display: block; color: var(--text); font-size: .98rem; margin-bottom: 4px; }

/* ---------- Pills, flashes, misc ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #eef1f6; color: var(--text-2); white-space: nowrap; line-height: 1.6; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.plain::before { display: none; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: .9rem; }
.flash.success { background: var(--good-bg); color: #0c5c2d; border-color: #b6e3c6; }
.flash.error { background: var(--bad-bg); color: #8c1c13; border-color: #f6c5bf; }
.flash.warning { background: var(--warn-bg); color: #6f4806; border-color: #f2d798; }
.flash.info { background: var(--info-bg); color: #1e3a8a; border-color: #c4d4fb; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .86rem; }
dl.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
dl.kv.cols { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 24px; }
dl.kv.cols > div { min-width: 0; }
dl.kv.cols dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 4px; }
.summary { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.summary strong { font-size: 1.05rem; }
.danger-zone { margin-top: 26px; padding: 16px 20px; border: 1px solid #f6c5bf; background: #fffafa; border-radius: var(--radius); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.danger-zone p { margin: 0; flex: 1; color: var(--text-2); font-size: .88rem; }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); background: var(--panel); }
.pager .sp { flex: 1; }
ul.links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
ul.links li a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font-weight: 550; background: var(--panel); }
ul.links li a:hover { border-color: var(--brand-100); background: var(--brand-50); text-decoration: none; }
ul.warnings { font-size: .88rem; color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.statement { max-width: 680px; }
.statement .line { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.statement .line.total { font-weight: 700; border-bottom: 1px solid var(--text-2); }
.statement .line.grand { font-weight: 800; font-size: 1.05rem; margin-top: 12px; background: var(--brand-50); color: #0a4d3e; padding: 10px 12px; border: 0; border-radius: var(--radius-sm); }

/* ---------- Charts (server-rendered SVG) ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: #edf0f5; stroke-width: 1; }
.chart .axis text, .chart text.axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--brand); transition: fill .12s; }
.chart .bar.dim { fill: #9fd6c6; }
.chart g.mark:hover .bar { fill: #0a5c4a; }
.chart g.mark .hit { fill: transparent; }
.chart g.mark:hover .hit { fill: rgba(13, 122, 99, .06); }
.chart .val { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--text); font-size: 12.5px; font-family: var(--font); }
.chart .baseline { stroke: #cbd3df; stroke-width: 1; }
.chart-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.chart-note { font-size: .8rem; color: var(--muted); margin: -6px 0 10px; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar .meta { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 5px; }
.hbar .meta span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 550; }
.hbar .meta span:last-child { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.hbar .track { height: 8px; background: #eef1f6; border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand); border-radius: 99px; }
.hbar.amber .fill { background: var(--amber); }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .87rem; }
.activity li:last-child { border-bottom: 0; }
.activity .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: none; }
.activity .dot.delete { background: var(--bad); } .activity .dot.update { background: var(--amber); } .activity .dot.import { background: var(--info); }
.activity time { color: var(--muted); font-size: .78rem; white-space: nowrap; margin-left: auto; padding-left: 8px; }

/* ---------- Import ---------- */
.steps { display: flex; gap: 0; margin: 4px 0 22px; padding: 0; counter-reset: step; flex-wrap: wrap; }
.steps li { list-style: none; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; font-weight: 550; padding-right: 18px; margin-right: 18px; position: relative; }
.steps li:not(:last-child)::after { content: ""; width: 34px; height: 2px; background: var(--line-2); margin-left: 8px; border-radius: 2px; }
.steps li b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e9edf3; color: var(--muted); font-size: .8rem; }
.steps li.on { color: var(--text); }
.steps li.on b { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.steps li.done b { background: var(--brand-50); color: var(--brand); }
.dropzone { position: relative; border: 2px dashed #c9d2df; border-radius: var(--radius); background: var(--panel-2); padding: 34px 20px; text-align: center; transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone .big { width: 52px; height: 52px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 12px; color: var(--brand); box-shadow: var(--shadow); }
.dropzone .big svg.i { width: 24px; height: 24px; }
.dropzone b { display: block; font-size: 1rem; margin-bottom: 4px; }
.dropzone .muted { font-size: .86rem; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: .88rem; }
.file-list li .muted { margin-left: auto; font-size: .8rem; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 18px; }
.option { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: #fff; margin: 0; }
.option.danger { border-color: #f6c5bf; background: #fffafa; }
.option small { display: block; color: var(--muted); margin-top: 3px; font-weight: 400; }
.confirm-box { margin-top: 10px; display: none; }
.option.danger input[type=checkbox]:checked ~ span .confirm-box, .confirm-box.show { display: block; }
.big-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.big-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.big-stats b { display: block; font-size: 1.6rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-stats span { font-size: .8rem; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .06em; }
.big-stats .good b { color: var(--good); } .big-stats .bad b { color: var(--bad); } .big-stats .info b { color: var(--info); }
.samples { color: var(--muted); font-size: .8rem; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issues { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.issues li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 20px; border-top: 1px solid var(--line); font-size: .86rem; }
.issues li .where { color: var(--muted); white-space: nowrap; min-width: 150px; font-variant-numeric: tabular-nums; }
.sticky-bar { position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow-lg); margin-top: 18px; }
.sticky-bar p { margin: 0; flex: 1; font-size: .9rem; color: var(--text-2); min-width: 220px; }

/* ---------- Sign-in ---------- */
body.auth { background: #0b1422; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; overflow: hidden; color: #e6edf6; padding: 48px 56px; display: flex; flex-direction: column; background: radial-gradient(900px 500px at 15% 10%, rgba(25, 184, 146, .28), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(245, 165, 36, .2), transparent 60%), linear-gradient(160deg, #0b1422 0%, #0e1b2e 60%, #0b1422 100%); }
.auth-hero .side-brand { padding: 0; }
.auth-hero h2 { font-size: 2.3rem; line-height: 1.15; letter-spacing: -.03em; margin: auto 0 16px; color: #fff; max-width: 520px; font-weight: 750; }
.auth-hero h2 em { font-style: normal; background: linear-gradient(90deg, #3fd3ad, var(--amber)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #9fb0c6; max-width: 460px; font-size: 1rem; margin: 0 0 28px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 12px; max-width: 460px; }
.auth-hero li { display: flex; gap: 12px; align-items: center; color: #c9d5e4; font-size: .93rem; }
.auth-hero li .ico { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); display: grid; place-items: center; color: #3fd3ad; flex: none; }
.auth-hero .glow { position: absolute; right: -120px; top: 50%; width: 420px; height: 420px; transform: translateY(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(245,165,36,.18), transparent 65%); pointer-events: none; }
.auth-hero .copy { color: #5d6f88; font-size: .8rem; margin-top: 28px; }
.auth-panel { background: #fff; display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 26px; }
.auth-card label { margin-bottom: 16px; }
.auth-card input { height: 44px; }
.auth-card .btn { height: 46px; font-size: .98rem; margin-top: 6px; }
.auth-card .fine { margin-top: 22px; color: var(--muted); font-size: .8rem; text-align: center; }
.auth-mobile-brand { display: none; }

.solo-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr; }
  .big-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .app { background: none; }
  .sidebar { position: fixed; left: 0; top: var(--top-h); bottom: 0; height: auto; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .nav-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(16, 24, 40, .4); z-index: 25; }
  .nav-open { overflow: hidden; }
  .side-nav a { padding: 10px 12px; font-size: .96rem; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 12px; gap: 10px; }
  .hdr-brand { width: auto; flex: 1; }
  .crumbs, .top-date, .user-name { display: none; }
  .user-btn { padding: 3px; } .user-btn::after { display: none; }
  .content { padding: 18px 16px 48px; }
  .foot-note { padding: 0 16px 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .fields .span2 { grid-column: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 700; color: var(--text); }
  h1 { font-size: 1.35rem; }
  .tile .value { font-size: 1.3rem; }
  .issues li { flex-wrap: wrap; } .issues li .where { min-width: 0; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 14px; }
  .tile .spark { display: none; }
  .tile .value { font-size: 1.1rem; }
  .big-stats b { font-size: 1.25rem; }
  .search { max-width: none; }
  .steps li { margin-right: 8px; padding-right: 8px; } .steps li:not(:last-child)::after { width: 14px; }
}
/* Printing (29 Nov 2026): every report, list and record prints on A4 with the company letterhead,
   the page title and the print date; buttons, menus and filters are left off. */
.print-head { display: none; }
.top-print { margin-right: 10px; }
.warn-text { color: var(--warn); font-weight: 600; }
.plan-card.over { border-color: #f1c0bb; background: var(--bad-bg); }
table.tight td, table.tight th { padding: 6px 9px; }
.breakdown { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; margin-top: 8px; }
.breakdown-row > td { background: var(--panel-2); }
.breakdown-row summary { cursor: pointer; color: var(--text-2); font-size: .86rem; }
@media (max-width: 1100px) { .breakdown { grid-template-columns: 1fr; } }
@media print {
  .sidebar, .topbar, .filters, .btn, .btns, .danger-zone, .flash, .pager, .foot-note, .sticky-bar, .no-print, .seg, .scrim { display: none !important; }
  html, body { background: #fff !important; }
  body { font-size: 11px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .app, .main { display: block !important; background: #fff !important; }
  .content { padding: 0 !important; max-width: none !important; margin: 0 !important; }
  .card { border: 0 !important; padding: 0 !important; box-shadow: none !important; margin: 0 0 14px !important; background: none !important; }
  .table-wrap { overflow: visible !important; }
  .page-head { margin-bottom: 8px; }
  .page-head h1, h1 { font-size: 16px; margin: 0 0 6px; }
  h2 { font-size: 12.5px; margin: 10px 0 6px; }
  .lead, .help, .hint { display: none !important; } /* printed pages show no comments or instructions (Ali, 30 Nov 2026) */
  table { width: 100%; border-collapse: collapse; }
  thead { display: table-header-group; }
  tfoot { display: table-row-group; }
  tr { page-break-inside: avoid; }
  th { position: static !important; background: #0f172a !important; color: #fff !important; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; padding: 5px 6px !important; }
  td { padding: 4px 6px !important; border-bottom: 1px solid #dfe4ec !important; }
  tfoot td { font-weight: 700; border-top: 2px solid #0f172a !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .grid2, .tiles { display: block !important; }
  .tile { display: inline-block; width: 31%; margin: 0 1% 8px 0; border: 1px solid #dfe4ec !important; box-shadow: none !important; padding: 8px !important; }
  .tile .spark { display: none !important; }
  .pill { border: 1px solid currentColor; background: none !important; }
  details > summary { list-style: none; font-weight: 600; }
  .breakdown { grid-template-columns: 1fr 1fr; }
  .print-head { display: flex !important; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid #0d7a63; }
  .ph-brand { display: flex; gap: 10px; align-items: center; }
  .ph-mark { width: 34px; height: 34px; border-radius: 9px; background: #0d7a63 !important; display: grid; place-items: center; }
  .ph-mark svg { width: 20px; height: 20px; }
  .ph-co { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
  .ph-sub { color: #64748b; font-size: 10px; }
  .ph-title { text-align: right; }
  .ph-title b { display: block; font-size: 14px; color: #0d7a63; letter-spacing: .03em; text-transform: uppercase; }
  .ph-title span { color: #64748b; font-size: 10px; }
  .kv.cols { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 4px 12px; }
}

/* ---------- Customer portal ---------- */
.portal-body { background: var(--bg); }
.portal-top { background: var(--hdr-bg); color: var(--hdr-text); border-bottom: 1px solid var(--hdr-line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); position: sticky; top: 0; z-index: 20; }
.portal-bar { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 24px; }
.portal-bar .hdr-brand { width: auto; }
.portal-who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.portal-who .who { line-height: 1.2; }
.portal-who .who b { display: block; color: var(--hdr-text); font-size: .88rem; font-weight: 600; }
.portal-who .who span { font-size: .75rem; color: var(--hdr-muted); }
.portal-who .icon-btn { color: var(--hdr-muted); border: 1px solid var(--hdr-line); width: 36px; height: 36px; }
.portal-who .icon-btn:hover { background: var(--nav-hover); color: var(--hdr-text); }
.portal-tabs { max-width: 1180px; margin: 0 auto; display: flex; gap: 4px; padding: 0 16px; overflow-x: auto; }
.portal-tabs a { display: flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--nav-text); font-size: .9rem; font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.portal-tabs a:hover { color: var(--hdr-text); text-decoration: none; }
.portal-tabs a.active { color: var(--nav-active-text); font-weight: 650; border-bottom-color: var(--brand); }
.portal-tabs a svg.i { width: 16px; height: 16px; opacity: .8; }
.portal-main { max-width: 1180px; margin: 0 auto; padding: 26px 24px 48px; }
.portal-foot { max-width: 1180px; margin: 0 auto; padding: 0 24px 28px; color: var(--muted); font-size: .8rem; }
.portal-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 24px 26px; border-radius: var(--radius); margin-bottom: 18px; color: #fff; background: radial-gradient(600px 240px at 0% 0%, rgba(25,184,146,.35), transparent 60%), linear-gradient(135deg, #0e1b2e, #0b1422); box-shadow: var(--shadow-lg); }
.portal-hero.due { background: radial-gradient(600px 240px at 0% 0%, rgba(245,165,36,.32), transparent 60%), linear-gradient(135deg, #1d1a14, #0b1422); }
.portal-hero .lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #9fb0c6; font-weight: 600; }
.portal-hero .amt { font-size: 2.3rem; font-weight: 750; letter-spacing: -.03em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.portal-hero .amt small { font-size: 1rem; color: #9fb0c6; font-weight: 600; }
.portal-hero .sub { color: #c4cddb; font-size: .9rem; max-width: 560px; }
.portal-hero .pill { font-size: .85rem; padding: 5px 12px; }
@media (max-width: 720px) {
  .portal-bar { padding: 10px 16px; }
  .portal-who .who { display: none; }
  .portal-main { padding: 18px 16px 40px; }
  .portal-hero .amt { font-size: 1.8rem; }
  .portal-foot { padding: 0 16px 24px; }
}
@media print { .portal-top, .portal-foot { display: none !important; } .portal-main { padding: 0; } .portal-hero { box-shadow: none; } }

/* Segmented switch (payroll pay period) */
.seg { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: .88rem; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--panel); color: var(--brand); box-shadow: var(--shadow-sm); }
.seg a svg.i { width: 15px; height: 15px; }
@media print { .seg { display: none; } }
.nowrap { white-space: nowrap; }
select.multi { height: auto; min-height: 140px; padding: 6px; background-image: none; }

.apply-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
.apply-sum { margin-left: auto; }
.apply-table input.amt { width: 150px; height: 34px; text-align: right; }
.apply-table td { vertical-align: middle; }
.readonly-fields input[readonly] { background: var(--panel-2); color: var(--text-2); border-style: dashed; cursor: default; }
.breakdown.stack { grid-template-columns: 1fr; max-width: 980px; }
@media print { .breakdown.stack { grid-template-columns: 1fr; } }

/* Print several invoices (29 Nov 2026) */
.batch-print { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-top: 1px solid var(--line, #e5e7eb); }
.batch-print .bp-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.batch-print .bp-open { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: .85rem; }
.batch-print .bp-open input { width: auto; margin: 0; }
th.tick, td.tick { width: 34px; text-align: center; }
@media print { .batch-print, th.tick, td.tick { display: none; } }
@media (max-width: 600px) {
  .hdr-name small, .top-print { display: none; }
  .hdr-name b { font-size: 1.02rem; }
  .new-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .new-btn span { display: none; }
  .hdr-menu { position: static; }
  .menu-pop { left: 10px; right: 10px; top: calc(var(--top-h) - 4px); max-width: none; width: auto; }
  .new-pop { grid-template-columns: 1fr 1fr; max-height: calc(100vh - 90px); overflow-y: auto; }
}

/* ---------- 30 Nov 2026 polish: accessibility, jump box, phones ---------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 10px; }
.content:focus { outline: none; }
a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
kbd { display: inline-block; min-width: 1.5em; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--panel-2); color: var(--text-2); font: 600 .72rem/1.4 var(--font); text-align: center; }
.jump-btn { gap: 8px; color: var(--muted); min-width: 190px; justify-content: flex-start; }
.jump-btn span { flex: 1; text-align: left; }
.jump-btn kbd { margin-left: 8px; }
.foot-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot-keys { color: var(--muted); }
.jump { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(16, 24, 40, .45); }
.jump.open { display: flex; }
.jump-panel { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.jump-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; height: 54px; padding: 0 18px; font-size: 1rem; box-shadow: none !important; }
.jump-input:focus-visible { outline: none; }
.jump-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.jump-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.jump-list li small { color: var(--muted); font-size: .78rem; }
.jump-list li.on { background: var(--brand-50); color: var(--brand-600); }
.jump-list li.jump-empty { color: var(--muted); cursor: default; }
.jump-help { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: .76rem; }
.jump-help kbd { margin-right: 3px; }
@media (max-width: 1240px) { .jump-btn kbd, .jump-btn span { display: none; } .jump-btn { min-width: 0; } }
@media (max-width: 960px) { .foot-keys { display: none; } }
/* Phones: lists keep one line per row and scroll sideways, instead of squashing numbers and dates. */
@media (max-width: 760px) {
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap th, .table-wrap td { white-space: nowrap; }
  .filters { gap: 8px; }
  .filters .search { flex: 1 1 100%; }
  .filters label { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .filters label input, .filters label select { flex: 1; min-width: 0; width: 100%; }
  .batch-print .muted.small { display: none; }
  .page-head { flex-wrap: wrap; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .skip-link, .jump, .jump-btn, .foot-keys { display: none !important; } }

/* Item picker on orders (Brand / Product / Wattage / Temp / Colour) */
.item-picker { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; margin: 0 0 12px; background: #f4f6f8; border: 1px solid #dde3ea; border-radius: 8px; }
.item-picker label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.item-picker select { min-width: 110px; max-width: 220px; }
.item-picker small { flex-basis: 100%; }
@media print { .item-picker { display: none !important; } }
.th-sort { color: inherit; text-decoration: none; white-space: nowrap; } .th-sort:hover { text-decoration: underline; }
.recon-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.recon-sum div { display: flex; flex-direction: column; gap: 2px; }
.recon-sum b { font-size: 16px; }
.recon-ok { color: #0a7a4d; }
.recon-done td { color: #64748b; background: #f8fafc; }

/* Edit items in batches (2 Dec 2026) */
.bulk-table th, .bulk-table td { white-space: nowrap; }
.bulk-table input[type=text], .bulk-table select { padding: 5px 7px; font-size: 13px; }
.bulk-table .num-in { width: 92px; text-align: right; }
.bulk-table .mid-in { width: 110px; }
.bulk-table .wide-in { width: 330px; }

/* Reconcile, QuickBooks style (3 Dec 2026) */
.recon-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.recon-sum .recon-diff b { font-size: 20px; }
.recon-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 8px; }
.recon-tools input[type="search"] { flex: 1 1 220px; max-width: 360px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--nav-active-bg, #e8f6f0); color: var(--brand, #0a7a4d); font-weight: 650; }
.recon-extra summary { cursor: pointer; }
.recon-extra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 12px; }
.recon-extra fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.recon-report .sum-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.recon-report .sum-table tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.recon-report h3 { margin: 18px 0 6px; }
.reconciled-note { border-left: 4px solid var(--warn, #b45309); }
@media print { .recon-tools, .recon-extra { display: none !important; } }
.recon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-bottom: 12px; align-items: start; }
.recon-report .sum-table { width: 100%; }
#recon + h2, #recon ~ h2 { margin-top: 28px; }
.actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  form.filters[action="/reconcile"] label { flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 4px; }
  form.filters[action="/reconcile"] .btn { width: 100%; }
}

/* Reports pack (3 Dec 2026) */
.seg a { display: inline-block; padding: 6px 12px; font-size: .85rem; color: var(--text-2); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.active { background: var(--nav-active-bg, #e8f6f0); color: var(--brand, #0a7a4d); font-weight: 650; }
table.cmp tr.sec td { background: var(--panel-2, #f6f8fa); padding-top: 10px; }
table.cmp tr.total td { font-weight: 700; border-top: 1px solid var(--text-2); }
table.cmp tr.grand td { font-weight: 800; background: var(--brand-50, #e8f6f0); color: #0a4d3e; }
table.cmp td.r, table.cmp th.r { white-space: nowrap; }
.ageing-table tr.grp td { background: var(--panel-2, #f6f8fa); }
.ageing-table tr.sub td:first-child { padding-left: 28px; }
.ageing-tiles .tile { padding: 14px 16px; }
.ageing-tiles .value { font-size: 1.2rem; margin-top: 6px; }
.gl-acc { margin-bottom: 14px; }
.gl-acc thead tr:first-child th { font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--text); }

/* QuickBooks-style entry screens (3 Dec 2026) */
.doc-head-bar { align-items: flex-start; }
.doc-total { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.doc-total span { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.doc-total b { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.doc-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.cust-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2, #f7f9fb); padding: 14px 16px; font-size: .9rem; position: sticky; top: calc(var(--top-h, 60px) + 12px); }
.cust-panel .cp-name { font-weight: 700; font-size: 1rem; }
.cp-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 10px 0; }
.cp-kv dt { color: var(--muted); }
.cp-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.cp-orders { margin-bottom: 8px; }
.cust-panel .flash { margin: 8px 0; padding: 8px 10px; }
.lines-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.doc-actions { position: sticky; bottom: 0; background: var(--panel); z-index: 5; margin-left: -20px; margin-right: -20px; padding: 12px 20px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 16px -12px rgba(15, 23, 42, .25); }
.doc-actions .spacer { flex: 1; }
.kbd-hint { margin-right: 6px; }
.cbx { position: relative; width: 100%; }
.cbx-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; }
.cbx-input { width: 100%; }
.cbx-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px -12px rgba(15, 23, 42, .35); max-height: 300px; overflow-y: auto; min-width: 260px; }
.cbx-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbx-list li.on { background: var(--nav-active-bg, #e8f6f0); color: var(--brand, #0a7a4d); }
.cbx-list li.sel { font-weight: 650; }
.cbx-list li.cbx-empty { color: var(--muted); cursor: default; }
.cbx-list li.cbx-addnew { color: var(--accent, #0f7a5c); font-weight: 600; border-top: 1px solid var(--border, #e5e7eb); }
.cbx.cbx-new .cbx-input { border-style: dashed; background: #fffbea; }
.cbx.cbx-new::after { content: 'New item'; display: block; font-size: 11px; color: #92600a; margin-top: 2px; }
table.lines td .cbx { min-width: 240px; }
@media (max-width: 900px) {
  .doc-top { grid-template-columns: 1fr; }
  .cust-panel { position: static; }
  .doc-total { min-width: 0; }
  .doc-total b { font-size: 1.4rem; }
  .kbd-hint { display: none; }
  .doc-actions { margin-left: -14px; margin-right: -14px; padding: 10px 14px; }
}

/* Reports printed from the app: no browser header / footer (zero page margin, our own margin repeated on each page). */
@page { size: A4; margin: 0; }
@media print {
  html, body { margin: 0 !important; padding: 0 !important; }
  .main { padding: 10mm 10mm 12mm !important; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  thead { display: table-header-group; }
  tfoot { display: table-row-group; }
}

/* ---------- Dynamic sidebar (3 Dec 2026): find, pinned, recent, fold, icons only, badges ---------- */
.side-find { position: relative; margin: 12px 12px 2px; }
.side-find svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--nav-muted); pointer-events: none; }
.side-find input { width: 100%; padding: 7px 10px 7px 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2, #f7f9fb); font-size: .88rem; }
.side-find input:focus { background: #fff; }
.nav-group { margin-top: 10px; }
.nav-title { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; padding: 6px 10px; border-radius: 6px; font: inherit; font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--nav-muted); font-weight: 700; }
.nav-title:hover { background: var(--nav-hover); color: var(--nav-text); }
.nav-title.static { cursor: default; } .nav-title.static:hover { background: none; color: var(--nav-muted); }
.nav-title svg.i { width: 14px; height: 14px; }
.nav-title span { flex: 1; }
.nav-title svg.i:last-child { transition: transform .15s; opacity: .7; }
.nav-title > svg.i:first-child { display: none; }
.nav-pinned .nav-title > svg.i:first-child, .nav-recent .nav-title > svg.i:first-child { display: block; color: var(--accent, #f5a524); }
.nav-recent .nav-title > svg.i:first-child { color: var(--nav-muted); }
.nav-group.folded .nav-title svg.i:last-child { transform: rotate(-90deg); }
.nav-group.folded .nav-links { display: none; }
.side-nav.filtering .nav-group.folded .nav-links { display: block; }
.f-hide { display: none !important; }
.nav-item { position: relative; }
.nav-item a { padding-right: 30px; }
.nav-item .nl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; border-radius: 6px; color: var(--nav-muted); cursor: pointer; opacity: 0; transition: opacity .12s; }
.pin-btn svg.i { width: 14px; height: 14px; }
.nav-item:hover .pin-btn, .pin-btn:focus-visible { opacity: 1; }
.pin-btn:hover { background: #fff; color: var(--accent, #f5a524); }
.pin-btn.on { color: var(--accent, #f5a524); }
.pin-btn.on svg.i { fill: currentColor; }
.nav-pinned .pin-btn.on { opacity: 0; } .nav-pinned .nav-item:hover .pin-btn.on { opacity: 1; }
.nav-badge { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--nav-hover); color: var(--nav-text); font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-badge.bad { background: #fdecec; color: #b42318; }
.nav-badge.info { background: #e8f0fe; color: #1d4ed8; }
.nav-item:hover .nav-badge { visibility: hidden; }
.nav-none { padding: 8px 12px; }
.side-foot { border-top: 1px solid var(--hdr-line); padding: 8px 12px; }
.side-mini-btn { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 8px 10px; border-radius: 8px; color: var(--nav-muted); cursor: pointer; font: inherit; font-size: .86rem; }
.side-mini-btn:hover { background: var(--nav-hover); color: var(--nav-text); }
.side-mini-btn svg.i { transition: transform .2s; }
@media (min-width: 961px) {
  body.nav-mini { --side-w: 64px; }
  body.nav-mini .hdr-brand { width: auto; }
  body.nav-mini .side-find, body.nav-mini .nav-title span, body.nav-mini .nav-title svg.i:last-child, body.nav-mini .side-mini-btn span, body.nav-mini .nav-none { display: none; }
  body.nav-mini .side-nav { padding: 6px 8px 20px; overflow-x: hidden; }
  body.nav-mini .nav-group { margin-top: 4px; }
  body.nav-mini .nav-title { justify-content: center; padding: 10px 0; border-radius: 8px; }
  body.nav-mini .nav-title > svg.i:first-child { display: block; width: 20px; height: 20px; color: var(--nav-text); }
  body.nav-mini .nav-group:not(.nav-recent):not(.nav-pinned):has(a.active) > .nav-title { background: var(--nav-active-bg); box-shadow: inset 3px 0 0 var(--brand); }
  body.nav-mini .nav-group:not(.nav-recent):not(.nav-pinned):has(a.active) > .nav-title > svg.i:first-child { color: var(--brand); }
  body.nav-mini .nav-group .nav-links, body.nav-mini .nav-group.folded .nav-links { display: none; }
  body.nav-mini .nav-group.fly .nav-links { display: block; position: fixed; left: 60px; z-index: 80; width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg, 0 18px 40px -16px rgba(15,23,42,.35)); padding: 6px; }
  body.nav-mini .side-foot { padding: 8px; }
  body.nav-mini .side-mini-btn { justify-content: center; }
  body.nav-mini .side-mini-btn svg.i { transform: rotate(180deg); }
  body.nav-mini .main { min-width: 0; }
}
@media (max-width: 960px) { .side-foot { display: none; } .pin-btn { opacity: .6; } }
@media print { .side-find, .side-foot { display: none !important; } }

/* ---------- Customisable dashboard (3 Dec 2026) ---------- */
.dash-head .btns { align-items: center; }
.dash-updated { margin-right: 2px; }
.btn.icon-only { padding-left: 10px; padding-right: 10px; }
.btn.spin svg.i { animation: rf-spin .8s linear infinite; }
@keyframes rf-spin { to { transform: rotate(360deg); } }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; grid-auto-flow: row dense; align-items: stretch; margin-bottom: 18px; }
.dw { min-width: 0; display: flex; flex-direction: column; position: relative; }
.dw-s { grid-column: span 3; } .dw-m { grid-column: span 6; } .dw-l { grid-column: span 12; }
.dw-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dw-body > .card, .dw-body > .tile { flex: 1; margin-bottom: 0; }
.dw-bar { display: none; }
.dash-empty { grid-column: span 12; text-align: center; padding: 40px; }
.dash-editbar { position: sticky; top: calc(var(--top-h) + 8px); z-index: 20; display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; align-items: center; background: var(--panel); border: 1px solid var(--brand-100, #bfe6da); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; margin-bottom: 16px; }
.dash-editbar[hidden] { display: none; }
.deb-text { font-size: .9rem; }
.deb-add { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; order: 3; }
.deb-btns { display: flex; gap: 8px; }
.chip { border: 1px dashed var(--line-strong, #c9d1da); background: var(--panel-2, #f7f9fb); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .84rem; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50, #eaf7f2); }
.dash-edit .dw { outline: 2px dashed var(--brand-100, #bfe6da); outline-offset: 3px; border-radius: var(--radius); }
.dash-edit .dw-bar { display: flex; align-items: center; gap: 4px; background: var(--brand-50, #eaf7f2); border: 1px solid var(--brand-100, #bfe6da); border-radius: 8px; padding: 4px 6px; margin-bottom: 6px; font-size: .8rem; }
.dash-edit .dw-body { pointer-events: none; user-select: none; opacity: .92; }
.dw-name { flex: 1; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-grip { cursor: grab; color: var(--muted); display: grid; place-items: center; }
.dw-bar button { border: 0; background: none; border-radius: 6px; padding: 3px 6px; cursor: pointer; color: var(--muted); font: inherit; font-size: .74rem; font-weight: 700; display: grid; place-items: center; }
.dw-bar button:hover { background: #fff; color: var(--text); }
.dw-bar button svg.i { width: 15px; height: 15px; }
.dw-sizes { display: inline-flex; background: #fff; border-radius: 6px; border: 1px solid var(--line); margin-right: 4px; }
.dw-sizes button { border-radius: 0; padding: 2px 7px; }
.dw-sizes button.on { background: var(--brand); color: #fff; }
.dw.dragging { opacity: .45; }
.dw[hidden] { display: none; }
.age-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--panel-2, #f1f3f5); margin: 6px 0 12px; }
.age-bar span { display: block; height: 100%; }
.ab-current { background: #12a383; } .ab-d30 { background: #f5c451; } .ab-d60 { background: #f59f36; } .ab-d90 { background: #e8663d; } .ab-over { background: #c0362c; } .ab-other { background: #94a3b8; }
.age-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.age-tbl tr.tot td, .pl-mini tr.tot td, .dw table.dense tr.tot td { font-weight: 700; border-top: 1px solid var(--line); }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.shortcuts a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: .88rem; font-weight: 550; }
.shortcuts a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; background: var(--brand-50, #eaf7f2); }
.shortcuts a svg.i { color: var(--brand); }
@media (max-width: 1280px) { .dw-s { grid-column: span 6; } }
@media (max-width: 1100px) { .dw-m { grid-column: span 12; } }
@media (max-width: 700px) {
  .dash-grid { gap: 12px; }
  .dw-s { grid-column: span 6; }
  .dash-editbar { grid-template-columns: 1fr; }
  .dash-updated { display: none; }
}
@media (max-width: 460px) { .dw-s { grid-column: span 12; } }
@media print { .dash-editbar, .dw-bar, [data-dash-edit], [data-dash-refresh], .dash-updated { display: none !important; } .dash-grid { display: block; } .dw { break-inside: avoid; margin-bottom: 12px; } }

/* Quick date ranges (3 Dec 2026) */
.quick-dates, .quick-asat, select[data-period] { max-width: 230px; }
.nav-badge[hidden] { display: none; }

.fly-title { display: none; }
@media (min-width: 961px) { body.nav-mini .nav-group.fly .fly-title { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--nav-muted); font-weight: 700; padding: 6px 10px 4px; } }

/* Hide the whole menu on wide screens with the header's menu button (3 Dec 2026) */
@media (min-width: 961px) {
  .menu-btn { display: grid; }
  .menu-btn .mb-close, .nav-open .menu-btn .mb-close { display: none; }
  .nav-open .menu-btn .mb-open { display: grid; }
  body.nav-hidden { --side-w: 0px; }
  body.nav-hidden .sidebar { display: none; }
  body.nav-hidden .hdr-brand { width: auto; }
  .topbar .menu-btn { margin-right: 4px; }
}
@media (min-width: 961px) { body:not(.nav-mini):not(.nav-hidden) .hdr-brand { width: calc(var(--side-w) - 72px); } }

/* Settings in one place (3 Dec 2026) */
.settings-nav { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.sn-head { display: flex; align-items: center; gap: 8px; font-size: 1rem; width: 100%; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sn-head svg.i { color: var(--brand); }
.sn-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sn-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; margin-right: 6px; }
.settings-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--text); font-size: .86rem; font-weight: 550; }
.settings-nav a svg.i { width: 15px; height: 15px; color: var(--muted); }
.settings-nav a:hover { background: var(--nav-hover); text-decoration: none; }
.settings-nav a.on { background: var(--nav-active-bg); color: var(--nav-active-text); }
.settings-nav a.on svg.i { color: var(--brand); }
.gear-btn { width: 38px; justify-content: center; padding: 0; }
.gear-btn.on { background: var(--nav-active-bg); color: var(--nav-active-text); }
@media (max-width: 700px) { .sn-group { width: 100%; } }

/* Settings > Print and PDF: form style editor with live preview (3 Dec 2026) */
.fs-forms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.fs-forms a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: .86rem; font-weight: 550; background: var(--panel); }
.fs-forms a:hover { text-decoration: none; border-color: var(--brand); }
.fs-forms a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fs-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.fs-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 16px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow-y: auto; }
.fs-sec { border-bottom: 1px solid var(--line); padding: 10px 0 14px; }
.fs-sec summary { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; list-style: none; padding: 4px 0 8px; }
.fs-sec summary small { font-weight: 500; margin-left: auto; }
.fs-sec summary::-webkit-details-marker { display: none; }
.fs-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 10px 0 6px; display: block; }
.fs-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { position: relative; cursor: pointer; }
.sw input { position: absolute; opacity: 0; }
.sw span { display: block; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.sw input:checked + span { outline: 3px solid var(--text); outline-offset: 2px; }
.sw input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.fs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.fs-row select { width: 100%; }
.fs-checks { display: grid; gap: 4px; }
.fs-checks .check, .fs-sec .check { font-size: .88rem; }
.fs-logo { display: flex; align-items: center; gap: 12px; }
.fs-logo img { max-height: 48px; max-width: 140px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.fs-actions { display: flex; gap: 8px; padding-top: 14px; }
.fs-upload { padding-top: 14px; margin-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.fs-preview-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fs-preview-head .muted { flex: 1; }
.fs-frame { width: 100%; height: calc(100vh - var(--top-h) - 120px); min-height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
@media (max-width: 1000px) { .fs-wrap { grid-template-columns: 1fr; } .fs-panel { position: static; max-height: none; } .fs-frame { height: 80vh; min-height: 500px; } }
.fs-preview { position: sticky; top: calc(var(--top-h) + 12px); } @media (max-width: 1000px) { .fs-preview { position: static; } }
/* Full backup and restore (3 Dec 2026) */
.bk-up { display: grid; gap: 10px; }
.bk-go { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 16px; }
.bk-go label { display: grid; gap: 4px; }
.bk-confirm details { margin: 12px 0; }

/* Print preview window, QuickBooks style (3 Dec 2026) */
.pv-open { overflow: hidden; }
.pv-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 20px; }
.pv-box { width: min(1000px, 100%); height: min(94vh, 1200px); background: var(--panel); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); display: flex; flex-direction: column; overflow: hidden; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pv-title { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.pv-sp { flex: 1; }
.pv-x { font-size: 1.1rem; line-height: 1; }
.pv-body { position: relative; flex: 1; background: #e9edf2; }
.pv-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #e9edf2; }
.pv-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.pv-hint { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .pv-overlay { padding: 0; } .pv-box { height: 100vh; border-radius: 0; } .pv-title { max-width: 100%; width: 100%; } }
@media print { .pv-overlay { display: none !important; } }
/* A normal page shown inside the preview: just the page content, like on paper */
body.embed .topbar, body.embed .sidebar, body.embed .scrim, body.embed .filters, body.embed .btns, body.embed .no-print, body.embed .site-foot, body.embed footer, body.embed .settings-nav, body.embed .flash { display: none !important; }
body.embed .app { background: #fff; }
body.embed .main { padding: 10mm 12mm; }
body.embed .print-head { display: flex !important; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid var(--brand); }
body.embed .ph-brand { display: flex; gap: 10px; align-items: center; }
body.embed .ph-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; }
body.embed .ph-mark svg { width: 20px; height: 20px; }
body.embed .ph-co { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
body.embed .ph-sub { color: #64748b; font-size: 10px; }
body.embed .ph-title { text-align: right; }
body.embed .ph-title b { display: block; font-size: 14px; color: var(--brand); letter-spacing: .03em; text-transform: uppercase; }
body.embed .ph-title span { color: #64748b; font-size: 10px; }
body.embed .content { max-width: none; }
/* Print templates picker (3 Dec 2026) */
.fs-tpls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fs-tpl { position: relative; cursor: pointer; text-align: center; font-size: .74rem; }
.fs-tpl input { position: absolute; opacity: 0; }
.fs-tpl b { display: block; font-weight: 600; margin-top: 4px; color: var(--text); }
.fs-tpl input:checked ~ b { color: var(--brand); }
.fs-thumb { --c: #0d7a63; position: relative; display: block; height: 66px; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; padding: 7px 6px; }
.fs-tpl input:checked + .fs-thumb { outline: 3px solid var(--brand); outline-offset: 1px; }
.fs-tpl input:focus-visible + .fs-thumb { outline: 3px solid var(--text); }
.fs-thumb i { display: block; border-radius: 1px; }
.fs-thumb .a { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); }
.fs-thumb .b { width: 40%; height: 5px; margin: 2px 0 6px auto; background: var(--c); }
.fs-thumb .c { height: 5px; background: #0f172a; margin-bottom: 4px; }
.fs-thumb .d { height: 3px; background: #e2e8f0; margin-bottom: 4px; }
.t-airy .a { display: none; } .t-airy .b { height: 3px; width: 50%; } .t-airy .c { height: 1px; background: var(--c); margin-top: 10px; } .t-airy .d { height: 1px; margin-bottom: 7px; }
.t-bold .a { height: 22px; } .t-bold .b { background: #fff; position: relative; z-index: 1; margin-top: 4px; } .t-bold .c { background: var(--c); margin-top: 12px; }
.t-fresh .a { display: none; } .t-fresh .b { border-radius: 4px; height: 7px; width: 34%; } .t-fresh .c { background: color-mix(in srgb, var(--c) 22%, #fff); border-radius: 3px; } .t-fresh .d { border-radius: 2px; }
.t-modern .a { width: 4px; height: auto; bottom: 0; right: auto; } .t-modern .b { margin-left: 4px; width: 55%; height: 8px; } .t-modern .c { background: transparent; border-bottom: 2px solid var(--c); margin-left: 4px; } .t-modern .d { margin-left: 4px; }
.t-classic .a { display: none; } .t-classic .b { margin: 2px auto 6px; width: 46%; background: #334155; } .t-classic .c { background: #fff; border: 1px solid #334155; } .t-classic .d { height: 4px; background: #fff; border: 1px solid #94a3b8; border-top: 0; margin-bottom: 0; }
.t-compact .b { height: 4px; margin-bottom: 3px; } .t-compact .c { height: 4px; margin-bottom: 2px; } .t-compact .d { height: 2px; margin-bottom: 2px; }
.t-ink .a { background: #111; height: 1px; } .t-ink .b { background: #111; } .t-ink .c { background: #fff; border-top: 1px solid #111; border-bottom: 1px solid #111; } .t-ink .d { background: #fff; border-bottom: 1px solid #cbd5e1; }
.fs-about { margin: 6px 0 2px; min-height: 2.4em; }
.sw-own span { background-image: conic-gradient(#f43f5e, #f59e0b, #22c55e, #0ea5e9, #8b5cf6, #f43f5e) !important; }
.sw-own input:checked + span { background-image: none !important; }
.sw-own input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
@media (max-width: 420px) { .fs-tpls { grid-template-columns: repeat(2, 1fr); } }

/* QuickBooks batch (Dec 2026): apply credits, banking, attachments, void */
form.inline-form { display: inline; }
.apply-wrap { display: grid; grid-template-columns: minmax(280px, 2fr) 3fr; gap: 14px; align-items: start; }
.apply-wrap input[name="amount"] { width: 140px; height: 34px; text-align: right; }
@media (max-width: 900px) { .apply-wrap { grid-template-columns: 1fr; } }
.bank-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.bank-accounts a.card { display: block; text-decoration: none; color: inherit; margin: 0; }
.bank-accounts a.card.on { outline: 2px solid var(--brand, #1f4e8c); }
.bank-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.bank-batch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bank-table td { vertical-align: middle; }
.bank-row:hover { background: rgba(31, 78, 140, .04); }
.bank-detail > td { background: rgba(31, 78, 140, .05); padding: 12px; }
.bank-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.bank-panel { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bank-panel h4 { margin: 0; font-size: 14px; }
.bank-panel .check { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; }
.bk-f { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.bk-f > span { color: var(--muted); font-size: 12px; }
.bk-f select, .bk-f input { height: 34px; }
.bk-f[hidden] { display: none; }
.bank-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bank-upload, .bank-up { margin-bottom: 12px; }
.bank-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.bank-rules td { vertical-align: middle; }
.attach-list { list-style: none; padding: 0; margin: 0 0 8px; }
.attach-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.attach-list li a { flex: 1; word-break: break-all; }
.attach-up { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.void-zone { border-top: 1px dashed rgba(0, 0, 0, .15); margin-top: 14px; padding-top: 12px; }
.void-zone .void-reason { min-width: 260px; height: 34px; }
/* Page change without reload: thin bar at the top while the next page loads */
html.rf-loading::before { content: ""; position: fixed; z-index: 9999; top: 0; left: 0; height: 3px; width: 100%; background: linear-gradient(90deg, transparent, var(--brand, #1f4e8c) 40%, var(--brand, #1f4e8c) 60%, transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: rf-bar 1s linear infinite; }
html.rf-loading body { cursor: progress; }
@keyframes rf-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { html.rf-loading::before { animation: none; background: var(--brand, #1f4e8c); opacity: .6; } }

.apply-full { margin: 0 0 8px; color: var(--muted); }
tr.apply-locked td { color: var(--muted); }
tr.apply-locked input.chk { cursor: not-allowed; }

/* ---- Bank transactions, QuickBooks style (4 Dec 2026) ---- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bt-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.bt-head h1 { margin: 0; flex: 1; }
.bt-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.bt-nav a { padding: 10px 14px; color: var(--text); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-size: 14px; }
.bt-nav a:hover { color: var(--brand); }
.bt-nav a.on { border-bottom-color: var(--brand); font-weight: 700; }
.bt-accrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.bt-accrow .sp { flex: 1; }
.bt-accpick { display: flex; align-items: center; gap: 10px; }
.bt-accicon { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.bt-accicon .i { width: 20px; height: 20px; }
.bt-accpick select { font-size: 20px; font-weight: 700; border: 0; background: transparent; padding: 4px 26px 4px 2px; height: auto; color: var(--text); cursor: pointer; }
.bt-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 14px; text-decoration: none; }
.bt-link .i { width: 16px; height: 16px; }
.bt-cards { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 12px; }
.bt-card { flex: 0 0 250px; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); }
.bt-card:hover { border-color: var(--brand); }
.bt-card.on { border: 2px solid var(--brand); background: var(--brand-50); padding: 11px 13px; }
.bt-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.bt-count { background: var(--text); color: #fff; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.bt-bank { font-size: 19px; font-weight: 700; }
.bt-card-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.bt-card-foot .i { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
.bt-warn { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #c2410c; color: #c2410c; font-weight: 800; font-size: 11px; align-items: center; justify-content: center; }
.bt-pills { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; margin: 4px 0 12px; }
.bt-pills a { padding: 8px 16px; color: var(--text); text-decoration: none; font-size: 14px; border-right: 1px solid var(--line-2); background: var(--panel); }
.bt-pills a:last-child { border-right: 0; }
.bt-pills a.on { background: #5b6472; color: #fff; font-weight: 600; }
.bt-list { padding: 0; overflow: hidden; }
.bt-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bt-filters .sp { flex: 1; }
.bt-filters select, .bt-filters input[type=date] { height: 36px; }
.bt-search { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); }
.bt-search input { border: 0; height: 34px; min-width: 260px; background: transparent; }
.bt-iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 30px; height: 30px; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; text-decoration: none; padding: 0 4px; }
.bt-iconbtn:hover { background: var(--panel-2); color: var(--brand); }
.bt-iconbtn.on { color: var(--brand); }
.bt-iconbtn .i { width: 18px; height: 18px; }
.bt-iconbtn small { font-size: 11px; font-weight: 700; }
.bt-pager { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.bt-pager a { display: inline-flex; color: var(--brand); }
.bt-batch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--brand-50); border-bottom: 1px solid var(--line); }
.bt-batch[hidden] { display: none; }
.bt-table { width: 100%; border-collapse: collapse; }
.bt-table th { background: var(--panel-2); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--text); padding: 10px 8px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.bt-table th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.bt-table th .i { width: 14px; height: 14px; }
.bt-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
.bt-table tbody tr.bt-row:nth-of-type(4n+3) td { background: rgba(15, 23, 42, .018); }
.bt-row:hover td { background: var(--brand-50) !important; }
.bt-row.open td { background: var(--brand-50) !important; border-bottom-color: transparent; }
.bt-click { cursor: pointer; }
.bt-desc { max-width: 260px; font-weight: 600; }
.bt-c-chk { width: 32px; }
.bt-c-date { width: 104px; }
.bt-c-ico { width: 38px; text-align: center; }
.bt-c-act { width: 120px; text-align: right; }
.bt-from { max-width: 170px; color: var(--muted); }
.bt-mc { min-width: 220px; }
.bt-sug { display: block; font-size: 13px; margin-bottom: 5px; }
.bt-sug .i { width: 14px; height: 14px; vertical-align: -2px; color: var(--brand); }
.bt-sug.good b { color: var(--good); }
.bt-tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--good-bg); color: var(--good); vertical-align: 1px; }
.bt-tag.dark { background: #4b5563; color: #fff; }
.bt-tag.good { background: var(--good-bg); color: var(--good); }
.bt-seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; gap: 2px; }
.bt-seg button { border: 0; background: none; font: inherit; font-size: 12px; padding: 2px 9px; border-radius: 4px; cursor: pointer; color: var(--text); }
.bt-seg button.on { background: var(--panel); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-sm); font-weight: 700; }
.bt-seg.big button { font-size: 13px; padding: 4px 12px; }
.bt-act { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px 6px; }
.bt-act:hover { text-decoration: underline; }
.bt-more { display: inline-block; position: relative; vertical-align: middle; }
.bt-more summary { list-style: none; cursor: pointer; display: inline-flex; padding: 4px; border-left: 1px solid var(--line-2); color: var(--muted); }
.bt-more summary::-webkit-details-marker { display: none; }
.bt-more summary .i { width: 16px; height: 16px; }
.bt-menu { position: absolute; right: 0; top: 100%; z-index: 30; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 4px; text-align: left; }
.bt-menu a, .bt-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); text-decoration: none; border-radius: 5px; cursor: pointer; }
.bt-menu a:hover, .bt-menu button:hover { background: var(--panel-2); }
.bt-detail > td { background: var(--panel-2) !important; padding: 0 !important; border-bottom: 1px solid var(--line-2); }
.bt-panel { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.bt-panel-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bt-fulldesc { font-weight: 600; font-size: 13px; margin-top: 2px; }
.bt-detail[data-mode="match"] .bt-mode-cat, .bt-detail[data-mode="cat"] .bt-mode-match { display: none; }
.bt-box { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; }
.bt-found { margin: 0 0 10px; font-size: 14px; }
.bt-found .i { width: 16px; height: 16px; color: var(--brand); vertical-align: -3px; }
.bt-sub { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.bt-sub th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 6px; border-bottom: 1px solid var(--line); background: none; }
.bt-sub td { padding: 7px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bt-actions { display: flex; align-items: center; gap: 16px; }
.bt-actions a { color: var(--brand); font-weight: 600; }
.bt-h4 { margin: 14px 0 6px; font-size: 14px; }
.bt-cat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 18px; align-items: start; }
.bt-catform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.bt-catform .bk-wide { grid-column: 1 / -1; }
.bt-catform textarea { min-height: 54px; }
.bt-suggest { background: var(--panel); border: 2px solid var(--brand); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; }
.bt-suggest h4 { margin: 0 0 8px; font-size: 15px; }
.bt-suggest h4 .i { width: 16px; height: 16px; color: var(--brand); vertical-align: -2px; }
.bt-suggest p { margin: 0 0 8px; }
.bt-suggest .bt-note { border-top: 1px solid var(--line); padding-top: 8px; margin: 8px 0 0; }
.bt-extras { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; border-top: 1px dashed var(--line-2); padding-top: 12px; }
.bt-noteform { display: flex; align-items: flex-end; gap: 8px; }
.bt-noteform input { min-width: 280px; }
.bt-files { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.bt-file { display: inline-flex; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 13px; }
.bt-file a { display: inline-flex; align-items: center; gap: 4px; }
.bt-file .i { width: 14px; height: 14px; }
.bt-attach { display: inline; }
.bt-empty { text-align: center; padding: 40px 16px 48px; }
.bt-empty h3 { margin: 10px 0 4px; font-size: 18px; }
.bt-tick { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; background: var(--good); color: #fff; align-items: center; justify-content: center; box-shadow: 0 6px 16px -6px rgba(17, 122, 60, .6); }
.bt-tick .i { width: 34px; height: 34px; stroke-width: 3; }
.bt-foot { padding: 10px 14px; }
@media (max-width: 1000px) { .bt-cat { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .bt-catform { grid-template-columns: 1fr; } .bt-search input { min-width: 0; width: 100%; } .bt-search { flex: 1 1 100%; } .bt-card { flex-basis: 210px; } }
@media print {
  .bt-nav, .bt-accrow, .bt-cards, .bank-upload, .bt-pills, .bt-filters, .bt-batch, .bt-c-chk, .bt-c-ico, .bt-c-act, .bt-seg, .bt-detail, .bt-foot, .bt-head .btns { display: none !important; }
  .bt-list { border: 0; box-shadow: none; }
}
/* Rules page and Create rule side panel */
.rule-table td { vertical-align: middle; }
.rule-grip { cursor: grab; color: var(--muted); }
.rule-grip .i { width: 16px; height: 16px; }
tr.dragging td { opacity: .5; background: var(--brand-50); }
.rule-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 80; }
.rule-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--panel); z-index: 81; box-shadow: var(--shadow-lg); display: flex; }
.rule-panel form { display: flex; flex-direction: column; width: 100%; }
.rule-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rule-panel-head h2 { margin: 0; font-size: 20px; }
.rule-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.rule-sec { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rule-sec h3 { margin: 0; font-size: 14px; }
.rule-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.rule-row select { height: 34px; min-width: 130px; }
.rule-cond { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.rule-cond select, .rule-cond input { height: 34px; min-width: 0; }
.rule-test { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.rule-test ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.rule-panel [data-for][hidden] { display: none; }
.rule-panel-foot { display: flex; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel-2); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 38px; height: 22px; border-radius: 11px; background: #cbd5e1; position: relative; transition: background .15s; flex: 0 0 auto; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { left: 19px; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Bank transactions: undo the general label layout where labels are buttons or inline controls */
.bt-filters label { margin: 0; }
.bt-search { flex-direction: row !important; gap: 0 !important; padding-right: 2px; }
label.bt-iconbtn, .bt-files label.btn, label.switch { flex-direction: row; margin: 0; gap: 6px; }
.bt-files label.btn { display: inline-flex; align-items: center; }
.bt-catform .bk-f, .bt-noteform .bk-f, .rule-panel .bk-f { margin: 0; }
.bt-panel > .bt-seg { align-self: flex-start; }
.bt-accpick select { border: 0 !important; box-shadow: none !important; background-color: transparent; }
.bt-card { flex-basis: 270px; }
.bt-c-ico form { display: inline; }
.rule-panel label.switch > span:last-child { font-weight: 600; }
.rule-row select { width: auto; flex: 1 1 140px; }
.rule-row > span { flex: 0 0 auto; }
.rule-sec .link-btn { align-self: flex-start; }
.rule-cond { grid-template-columns: 1.25fr 1.05fr 1.3fr auto; }

/* Search everything (4 Dec 2026) */
.jump-list li span em { display: block; font-style: normal; font-size: .78rem; color: var(--muted); margin-top: 2px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jump-list li.jump-rec span { font-weight: 600; }
.jump-list li.jump-rec span em { font-weight: 400; }
.jump-list li.jump-all { border-top: 1px solid var(--line, #e5e7eb); margin-top: 4px; color: var(--brand-600); }
.srch-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.srch-form input[type=search] { flex: 1 1 360px; min-width: 0; }
.srch-group h2 { margin-top: 0; }
.srch-why { color: var(--muted); }
.srch-table { table-layout: fixed; width: 100%; } .srch-table td { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .srch-table col:nth-child(2), .srch-table col:nth-child(3) { width: 0; } .srch-table td:nth-child(2), .srch-table td:nth-child(3) { display: none; } }

/* Sign-in: remember username, passkeys (4 Dec 2026) */
.auth label.remember { flex-direction: row; align-items: center; gap: 8px; margin: -4px 0 14px; font-weight: 400; }
.auth label.remember input { width: auto; margin: 0; }
.pk-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 16px 0 10px; }
.pk-or::before, .pk-or::after { content: ""; flex: 1; border-top: 1px solid var(--line, #e5e7eb); }
.pk-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.pk-add { margin-top: 18px; display: grid; gap: 10px; max-width: 420px; }
.auth [hidden], .pk-or[hidden], [data-passkey-error][hidden] { display: none !important; }
/* Daily report (5 Dec 2026): groups like the workbook's DailyReport tab */
.daily tr.grp th { background: var(--soft, #f3f6f9); text-align: left; font-weight: 700; padding-top: 10px; }
.daily tr.sum td { font-weight: 600; border-top: 1px solid var(--border, #e5e7eb); }
.daily tbody + tbody tr.grp th { border-top: 8px solid transparent; }
.sign-line { margin: 28px 0 16px; color: var(--muted); }
@media print { .no-print { display: none !important; } .sign-line { color: #000; margin-top: 40px; } }
/* Record view lines (5 Dec 2026): item names on one line, quantities never wrap */
table.lines-view td.item-cell { white-space: nowrap; min-width: 220px; }
table.lines-view td.nowrap, table.lines-view th { white-space: nowrap; }
table.lines-view td { vertical-align: middle; }
