/* Taxlibro — plain CSS, no build step. */

:root {
    --brand: #12284a;
    --brand-dark: #0b1c36;
    --brand-2: #1c3b6b;
    --gold: #e0a526;
    --gold-dark: #8a5a07;
    --gold-soft: #fbf0d2;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e3dfd2;
    --field-line: #a3afc0; /* input and drop-down borders: darker than --line so the boxes stand out */
    --bg: #f6f4ee;
    --card: #ffffff;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --ok: #15803d;
    --ok-bg: #f0fdf4;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

/* ---------- Auth (split screen) ---------- */

.auth { display: flex; min-height: 100vh; }

.auth-banner {
    flex: 1.15;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(224, 165, 38, .30), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(28, 59, 107, .5), transparent 50%),
        linear-gradient(135deg, #12284a 0%, #15294B 55%, #0E1B33 100%);
}

.auth-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, #000 30%, transparent 90%);
    pointer-events: none;
}

.auth-banner > * { position: relative; z-index: 1; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.35rem; color: inherit; }
.brand:hover { text-decoration: none; }
.wordmark { letter-spacing: -.04em; }
.wm-tax { color: #12284a; }
.wm-rest { color: #15294B; }
.sidebar .wm-tax, .auth-banner .wm-tax { color: #e0a526; }
.sidebar .wm-rest, .auth-banner .wm-rest { color: #fff; }

/* The animated TaxLibro logo on the sign-in screen: the L is drawn, the base line follows, the mint bar slides in. */
.tl-logo { display: inline-flex; align-items: center; gap: 22px; }
.tl-tile { position: relative; width: 96px; height: 96px; flex: none; border-radius: 23%; overflow: hidden; background: #15294B;
    box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08) inset; animation: tlTile .9s cubic-bezier(.2,.8,.2,1) both; }
.tl-tile svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-tile .shine { position: absolute; inset: -20%; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.22) 50%, transparent 60%);
    transform: translateX(-120%); animation: tlShine 1.3s .75s ease-in-out both; }
.tl-draw { stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; }
.tl-main { animation: tlDraw 1.15s .55s cubic-bezier(.2,.8,.2,1) forwards; }
.tl-base { animation: tlDraw .55s 1.45s cubic-bezier(.2,.8,.2,1) forwards; }
.tl-bar { opacity: 0; transform: translateX(-26px); animation: tlBar .75s 1.8s cubic-bezier(.3,1.4,.5,1) forwards; }
.tl-word { display: flex; flex-direction: column; gap: 8px; }
.tl-name { font-size: 3.4rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.tl-tag { font-size: .8rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: rgba(255,255,255,.7); opacity: 0; animation: tlTag 1.2s 2.1s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes tlTile { from { opacity: 0; transform: scale(.82) rotate(-4deg); } to { opacity: 1; transform: none; } }
@keyframes tlDraw { 0% { opacity: 0; stroke-dashoffset: 1; } 6% { opacity: 1; } 100% { opacity: 1; stroke-dashoffset: 0; } }
@keyframes tlBar { to { opacity: 1; transform: none; } }
@keyframes tlShine { to { transform: translateX(120%); } }
@keyframes tlTag { from { opacity: 0; letter-spacing: .7em; } to { opacity: 1; letter-spacing: .34em; } }
@media (prefers-reduced-motion: reduce) { .tl-logo *, .tl-tile { animation-duration: .01ms !important; animation-delay: 0s !important; } }

.banner-copy { max-width: 560px; }
.banner-copy .eyebrow {
    display: inline-block;
    padding: 4px 12px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    font-size: .8rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.banner-copy h1 { font-size: 2.6rem; font-weight: 800; margin-bottom: 16px; letter-spacing: -.02em; }
.banner-copy h1 span { color: #e0a526; }
.banner-copy .tl-name { color: #fff; }
.banner-copy p { font-size: 1.05rem; color: rgba(255, 255, 255, .8); }

.banner-features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.banner-features li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .9); }
.banner-features .ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
}
.banner-features strong { display: block; color: #fff; }
.banner-features small { color: rgba(255, 255, 255, .7); font-size: .88rem; }

.banner-art { margin: 32px 0 8px; max-width: 520px; }
.banner-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .25)); }

.banner-foot { font-size: .85rem; color: rgba(255, 255, 255, .6); }

.auth-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    background: #fff;
}

.auth-card { width: 100%; max-width: 400px; }
.auth-card .mobile-brand { display: none; margin-bottom: 28px; }
.auth-card h2 { font-size: 1.7rem; font-weight: 700; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 28px; }
.auth-alt { margin-top: 24px; text-align: center; color: var(--muted); }

@media (max-height: 820px) {
    .auth-banner { padding-top: 32px; padding-bottom: 32px; }
    .banner-art { display: none; }
}

@media (max-width: 960px) {
    .auth-banner { display: none; }
    .auth-card .mobile-brand { display: inline-flex; }
}

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }

.input-icon { position: relative; }
.input-icon > svg.lead {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.input-icon input[type] { padding-left: 44px; }
.input-icon .eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.input-icon .eye:hover { color: var(--ink); background: #f1f5f9; }
.input-icon input[type].has-eye { padding-right: 48px; }
.eye .eye-off { display: none; }
.eye.on .eye-open { display: none; }
.eye.on .eye-off { display: block; }

input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=file], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:not([type]):focus, input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(18, 40, 74, .15);
}
.is-invalid { border-color: var(--danger) !important; }
.error { color: var(--danger); font-size: .85rem; margin-top: 6px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 6px; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-light { color: var(--ink); background: #fff; border-color: var(--line); }
.btn-light:hover { background: #f8fafc; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-block { width: 100%; padding: 12px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: .92rem; }
.alert-ok { color: var(--ok); background: var(--ok-bg); border: 1px solid #bbf7d0; }
.alert-error { color: var(--danger); background: var(--danger-bg); border: 1px solid #fecaca; }

/* ---------- App shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex: none;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    color: #cbd5e1;
    background: #12284a;
}
.sidebar .brand { color: #fff; padding: 4px 10px 22px; font-size: 1.2rem; }
.nav-title { padding: 16px 12px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #cbd5e1;
    font-weight: 500;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(224, 165, 38, .16); box-shadow: inset 3px 0 0 var(--gold); }
.nav a.soon { opacity: .5; pointer-events: none; }
.nav a.soon::after { content: "soon"; margin-left: auto; font-size: .68rem; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 2px solid var(--gold);
}
.topbar .who { display: flex; align-items: center; gap: 12px; }
.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.who small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.2; }

/* Pages use the whole screen, up to a very wide monitor. */
.content { padding: 28px; max-width: 1840px; width: 100%; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px; }
.card h2 { margin-bottom: 4px; }
.card .card-sub { color: var(--muted); margin-bottom: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat .num { font-size: 1.9rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 8px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #f1f5f9; color: #334155; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: var(--danger-bg); color: var(--danger); }
.badge-brand { background: #e6ebf4; color: var(--brand-dark); }

.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.perm-group h3 { font-size: .95rem; margin-bottom: 10px; }
.perm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
.perm-row select { width: auto; padding: 6px 10px; }
.obs-row .obs-leader { flex: 1; border-bottom: 1px dotted var(--muted, #9aa5b1); align-self: center; min-width: 20px; height: 0; }

.qr { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.code-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 14px; background: #f8fafc; border-radius: 10px; font-family: Consolas, monospace; }
.mono { font-family: Consolas, monospace; letter-spacing: .05em; word-break: break-all; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

/* ---------- Bookkeeping screens ---------- */

.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.row-attention { background: #fff7f7; }
.badge-attention { display: inline-flex; align-items: center; gap: 3px; }
.icon.bulb { color: #ca8a04; fill: #fde047; }
input.obs-amt { flex: 0 0 130px; width: 130px; padding: 6px 10px; text-align: right; border: 1px solid var(--field-line); border-radius: 8px; background: #f8fafc; }
input.obs-amt:focus { background: #fff; border-color: var(--brand, #0b1c36); }
.obs-row { padding: 3px 0; }
.badge-email { background: #ede9fe; color: #6d28d9; }
.alert-warn { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; }
.alert a { color: inherit; }
.client-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.client-title h1 { margin: 0; }
.my-job { font-size: .88rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px; padding: 4px 12px; }
.my-job:hover { text-decoration: none; background: #fef3c7; }
.page-head .actions form { margin: 0; }
.comment-pop { max-width: 560px; margin: 0 auto; }
/* An entry's comments: one block per conversation, each with its own reply box. */
.entry-thread { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.entry-reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.entry-reply textarea { flex: 1; min-height: 44px; }
.comment-pop .context-check { background: #f1f4f9; border: 1px solid #B9EEDD; border-radius: 8px; padding: 8px 12px; margin: 4px 0 14px; }
.recipients { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.recipients legend { font-weight: 600; padding: 0 4px; }
.recipients .check { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.recipients .locked { color: var(--muted); }
.comment-where { font-size: .85rem; color: var(--brand); margin: 2px 0 4px; }
.comment-to { font-size: .8rem; margin-top: 4px; }
/* Client pages: the buttons always sit under the client's name, on the left, so they don't move between tabs. */
.page-head.client-head { flex-direction: column; align-items: stretch; }
/* Their own row between the client's name and the tabs, at the right (above the last tabs). */
.page-head.client-head .actions { justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.page-head.client-head { gap: 12px; }
.page-head.client-head .actions > .actions { display: contents; }
.actions-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
/* VAT rate, total, net, VAT: the rate gets more room (its names are long), labels stay on one line and the boxes line up. */
.money-row { grid-template-columns: minmax(130px, 1.25fr) repeat(3, minmax(105px, 1fr)); align-items: end; }
.money-row input { min-width: 0; padding-left: 10px; padding-right: 8px; }
.money-row label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
/* Files tab: folders on the left, the files on the right (folders above the list on a phone). */
.files-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.files-nav { padding: 14px; position: sticky; top: 12px; }
.files-folder { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.files-folder:hover { background: #f1f5f9; text-decoration: none; }
.files-folder.is-here { background: #e6f4f1; font-weight: 600; }
.files-folder span:first-of-type { flex: 1; }
.files-sub { padding-left: 32px; font-size: .9rem; }
.files-count { font-size: .8rem; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: 1px 8px; }
.files-count.is-due { background: #fef3c7; color: #92400e; }
.files-nav-head { margin: 14px 8px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
@media (max-width: 900px) { .files-layout { grid-template-columns: 1fr; } .files-nav { position: static; } }
@media (max-width: 1080px) { .split { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: -6px 0 22px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
/* Client tabs: many of them, so tighter, on one line; a narrow window scrolls them sideways instead of wrapping. */
/* No visible scrollbar: on a narrow window the row can still be swiped or shift-scrolled sideways. */
nav.tabs:not(.sub-tabs) { flex-wrap: nowrap; gap: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
nav.tabs:not(.sub-tabs)::-webkit-scrollbar { display: none; }
/* The grey line is drawn inside the row (not as a border) so the hidden overflow doesn't clip the active tab's underline. */
nav.tabs:not(.sub-tabs) { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
nav.tabs:not(.sub-tabs) a { margin-bottom: 0; }
nav.tabs:not(.sub-tabs) a { padding: 10px 12px; font-size: .92rem; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1500px) { nav.tabs:not(.sub-tabs) a { padding: 10px 6px; font-size: .86rem; } }
.sub-tabs { margin-top: -12px; }
.sub-tabs a { padding: 6px 12px; font-size: .9rem; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type=text] { flex: 1 1 240px; }
.filters input, .filters select { width: auto; }
form.card.filters { padding: 14px 16px; }

.table td.num, .table th.num, .data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table.kv th { width: 34%; text-transform: none; letter-spacing: 0; font-size: .88rem; vertical-align: top; }
.table tfoot td { border-top: 2px solid var(--line); }
.table.tx td { vertical-align: top; }
tr.row-danger td { background: #fef2f2; }
tr.row-muted td { background: #fafafa; }
tr.row-warn td { background: #fffbeb; }
/* Year-end readiness: one step per VAT quarter. */
.quarter-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.quarter-step { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #f8fafc; color: var(--ink); text-decoration: none; }
.quarter-step:hover { text-decoration: none; border-color: var(--brand); }
.quarter-step small { color: var(--muted); }
.quarter-step.done { background: var(--ok-bg); border-color: #bbf7d0; }
.quarter-step.done small { color: var(--ok); font-weight: 600; }
.quarter-step.draft { background: #fffbeb; border-color: #fde68a; }
/* Sortable column headings and the "How entered" column. */
th.is-sorted { color: var(--brand); }
th .sort-mark { margin-left: 4px; font-size: .75em; }
.entry-how { white-space: nowrap; }
.how { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #f1f5f9; color: #475569; }
.how-bank { background: #e0f2fe; color: #0369a1; }
.how-scanned { background: #ede9fe; color: #6d28d9; }
.how-manual { background: #f1f4f9; color: var(--brand-dark); }
.how-payroll, .how-contract, .how-mileage { background: #fef3c7; color: #92400e; }
.scope-hint { margin: 0 0 10px; padding: 6px 10px; border-radius: 8px; background: #f1f4f9; border: 1px solid #B9EEDD; font-size: .88rem; color: var(--brand-dark); }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.inline-field input { width: auto; }
/* Banks tab: one card per bank account. */
.flag { font-size: .8rem; margin-top: 4px; padding: 3px 8px; border-radius: 6px; display: inline-block; }
.flag-danger { background: #fee2e2; color: #991b1b; }
.flag-warning { background: #fef3c7; color: #92400e; }

.preview img { max-width: 100%; border-radius: 8px; display: block; margin: 0 auto; }
/* Hover magnifier for receipt pictures: the box clips, the picture scales around the mouse. */
.zoom-box { overflow: hidden; border-radius: 8px; cursor: zoom-in; }
.zoom-box img { transition: transform .12s ease-out; will-change: transform; max-height: 78vh; object-fit: contain; }
.preview iframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; background: #f8fafc; }
.dropzone input[type=file] { border: 0; background: transparent; padding: 0; }

.segmented { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.segmented label { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.segmented input { accent-color: var(--brand); }
.segmented label:has(input:checked) { border-color: var(--brand); background: #f1f4f9; }

.vat-boxes td { padding: 12px 8px; }
.vat-boxes td.box { font-weight: 700; color: var(--brand-dark); white-space: nowrap; width: 70px; }
.vat-boxes tr.total td { font-weight: 800; background: #f8fafc; }
.mini-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 4px; }

/* Financial statements (also used inside cards) */
.statements h2 { color: var(--brand-dark); margin-top: 18px; }
.statements h3 { font-size: .95rem; margin: 16px 0 6px; }
.statements .note { color: var(--muted); font-size: .88rem; }
table.data { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.data td, table.data th { padding: 7px 8px; border-bottom: 1px solid #f1f5f9; }
table.data th { font-size: .75rem; text-transform: uppercase; color: var(--muted); text-align: left; }
table.data tr.sub td { font-weight: 700; border-top: 1px solid #94a3b8; }
table.data tr.total td { font-weight: 800; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
table.data tr.section td { font-weight: 700; padding-top: 14px; border-bottom: 0; }
table.data tr.subtotal td { font-weight: 700; }
.report-wide { overflow-x: auto; }
.report-wide table.data td, .report-wide table.data th { white-space: nowrap; }
table.data td.indent { padding-left: 22px; }
table.data .prior { color: var(--muted); }
.statements-text { margin: 12px 0 18px; padding: 12px 14px; background: #f8fafc; border-radius: 10px; }
.statements-text .note { margin: 0 0 6px; }
.statements-text .signature { margin-top: 18px; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: .88em; }

/* ---------- Work in progress & alerts ---------- */

input[type=datetime-local] { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: .72rem; font-weight: 700; text-align: center; }
.bell { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted); }
.bell:hover { background: #f1f5f9; color: var(--ink); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
a.stat { color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--brand); }

.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.board-col { background: #eef2f7; border-radius: var(--radius); padding: 12px; min-height: 120px; }
.board-col h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 2px 4px 10px; }
.job-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; margin-bottom: 10px; background: #fff; border-radius: 10px; border-left: 4px solid var(--brand); box-shadow: var(--shadow); color: var(--ink); }
.job-card:hover { text-decoration: none; transform: translateY(-1px); }
.job-card.soon { border-left-color: #f59e0b; }
.job-card.overdue { border-left-color: #dc2626; background: #fff7f7; }
.job-card small { font-size: .8rem; }
/* The whole card opens the job (stretched link); the client name sits above it and opens the client's work page. */
.job-card { position: relative; }
.job-card .job-link { color: inherit; }
.job-card .job-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.job-card .job-client { position: relative; z-index: 1; align-self: flex-start; color: var(--brand-dark); }
.job-card .job-client:hover { text-decoration: underline; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.timeline li.t-completed::before, .timeline li.t-approved::before { background: #16a34a; }
.timeline li.t-added::before { background: var(--brand); }
.timeline li.t-removed::before { background: #dc2626; }
.timeline li.t-reminder::before { background: #f59e0b; }
.timeline li.t-reopened::before { background: #dc2626; }

.alert-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--ink); }
.alert-row:hover { background: #f8fafc; text-decoration: none; }
.alert-row.unread { font-weight: 600; background: #f1f4f9; }
.alert-row.k-overdue span { color: #b91c1c; }

/* ---------- Charts (dataviz reference palette; status colours always paired with a label) ---------- */

:root {
    --series-1: #2a78d6;      /* blue   */
    --series-2: #eb6834;      /* orange */
    --series-3: #1baf7a;      /* aqua   */
    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-critical: #d03b3b;
    --viz-grid: #e1e0d9;
    --viz-base: #c3c2b7;
    --viz-muted: #898781;
}
.viz { position: relative; }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-tick { fill: var(--viz-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-value { fill: #52514e; font-size: 11px; font-weight: 600; }
.viz-mark path { transition: opacity .12s; }
.viz-svg:hover .viz-mark path { opacity: .55; }
.viz-svg .viz-mark:hover path { opacity: 1; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: .82rem; color: #52514e; }
.viz-legend i, .stack-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-table { margin-top: 8px; font-size: .82rem; }
.viz-table summary { cursor: pointer; color: var(--viz-muted); }
.viz-table table { margin-top: 6px; }

.hbar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 10px; padding: 5px 0; }
.hbar-label { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; }
.hbar-fill { display: flex; gap: 2px; height: 100%; }
.hbar-seg { height: 100%; border-radius: 0; position: relative; }
.hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-value { font-size: .85rem; font-weight: 600; color: #52514e; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

.stackbar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; }
.stack-seg { position: relative; height: 100%; }
.stack-empty { flex: 1; background: var(--viz-grid); }
.stack-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.stack-key { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 4px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: .85rem; }
a.stack-key[href]:hover { text-decoration: none; border-color: var(--brand); }
.stack-key i { grid-row: span 2; }
.stack-key strong { font-size: 1.15rem; grid-row: span 2; }
.stack-key small { grid-column: 2; }

/* Hover tooltip for HTML bars */
[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    padding: 6px 10px; border-radius: 8px; background: #15294B; color: #fff; font-size: .78rem; white-space: nowrap; pointer-events: none;
}
[data-tip]:hover { filter: brightness(1.08); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: var(--brand); }
.kpi .num { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.kpi .lbl { color: var(--muted); font-size: .85rem; }
.kpi .sub { font-size: .78rem; margin-top: 4px; }
.kpi.alert .num { color: var(--status-critical); }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.dash-grid > .card { margin-bottom: 0; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1100px) { .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; } }

/* ---------- Client progress & records requests ---------- */

.rag { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0, 0, 0, .04); }
.rag-red { background: #dc2626; }
.rag-amber { background: #f59e0b; }
.rag-green { background: #16a34a; }
.stat.risk-red .num { color: #dc2626; }
.stat.risk-amber .num { color: #d97706; }
.stat.risk-green .num { color: #16a34a; }
.steps { display: flex; gap: 3px; margin-bottom: 4px; }
.steps span { flex: 1; height: 8px; border-radius: 4px; background: #e2e8f0; }
.steps span.on { background: linear-gradient(90deg, var(--brand), #e0a526); }
.progress-table td { vertical-align: top; }
.progress-table .badge { margin: 0 4px 4px 0; }
.checklist { margin: 0 0 14px; padding-left: 0; list-style: none; }
.checklist li { position: relative; padding: 6px 0 6px 28px; border-bottom: 1px dashed #eef2f6; }
.checklist li::before { content: "✓"; position: absolute; left: 4px; top: 6px; color: var(--brand); font-weight: 800; }

.upload-page { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; background: linear-gradient(160deg, #f1f4f9, #eef2ff); }
.upload-card { width: 100%; max-width: 620px; padding: 30px; }
.upload-card h1 { font-size: 1.5rem; }
.upload-form { margin-top: 18px; padding: 18px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }

/* ---------- Built-in guidance ---------- */

.help {
    position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%;
    background: #e0f2f1; color: var(--brand-dark); font-size: .72rem; font-weight: 800; cursor: help; vertical-align: 1px;
}
.help .help-text {
    display: none; position: absolute; z-index: 40; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    width: max-content; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: #15294B; color: #fff;
    font-size: .82rem; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
}
.help:hover .help-text, .help:focus .help-text { display: block; }
.nav a small { display: none; }
/* Right side of the top bar: icons and Sign out, the search under them. */
.topbar-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.topsearch { position: relative; width: 380px; max-width: 100%; margin: 0; }
.topsearch input {
    width: 100%; padding: 9px 40px 9px 38px; font-size: .9rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--bg); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s;
}
.topsearch input::placeholder { color: var(--muted); }
.topsearch input:hover { border-color: #cbd5e1; }
.topsearch input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 40, 74, .15); }
.topsearch-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.topsearch:focus-within .topsearch-icon { color: var(--brand); }
/* Search box at the end of a filter bar: wide, rounded, with an icon, like the top search. */
.filters .filter-search { position: relative; flex: 1 1 320px; min-width: 260px; margin: 0 0 0 auto; }
.filters .filter-search input {
    width: 100%; height: 46px; padding: 0 16px 0 44px; font-size: .98rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--bg); color: var(--ink); transition: border-color .2s, box-shadow .2s, background .2s;
}
.filters .filter-search input::placeholder { color: var(--muted); }
.filters .filter-search input:hover { border-color: #cbd5e1; background: #fff; }
.filters .filter-search input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(18, 40, 74, .14); }
.filter-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .2s; }
.filter-search:focus-within .filter-search-icon { color: var(--brand); }
.topsearch-key { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 1px 7px; border: 1px solid var(--line);
    border-radius: 6px; background: #fff; color: var(--muted); font-size: .72rem; font-family: inherit; pointer-events: none; }
.topsearch:focus-within .topsearch-key { display: none; }
.guide { border-left: 4px solid var(--brand); }
.guide-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 18px; }
.guide-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.guide-steps .tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); font-size: .75rem; font-weight: 800; color: #fff; }
.guide-steps li.done .tick { background: var(--status-good); border-color: var(--status-good); }
.guide-steps li.done a { color: var(--muted); text-decoration: line-through; }
.help-page h2 { margin-top: 8px; }
.help-page .card p, .help-page .card li { color: #334155; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.help-toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .88rem; }
dl.glossary dt { font-weight: 700; margin-top: 10px; }
dl.glossary dd { margin: 2px 0 0; color: #475569; }

/* ---------- Deadlines calendar ---------- */

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 92px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-day.blank { background: transparent; border-color: transparent; }
.cal-day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-num { font-size: .78rem; font-weight: 700; color: var(--muted); }
.cal-chip { display: block; padding: 2px 6px; border-radius: 5px; background: #e0f2fe; color: #0c4a6e; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { text-decoration: none; filter: brightness(.95); }
.cal-chip.done { background: #dcfce7; color: #166534; }
.cal-chip.late { background: #fee2e2; color: #991b1b; font-weight: 600; }
@media (max-width: 860px) { .cal-day { min-height: 60px; } .cal-chip { font-size: .66rem; } }

/* ---------- Pop-up entry window ---------- */

dialog.lw-modal {
    width: min(1180px, 96vw); height: 96vh; max-height: none; max-width: none; padding: 0; border: 0;
    border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
}
dialog.lw-modal.lw-wide { width: min(1600px, 98vw); height: 98vh; }
dialog.lw-modal::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
dialog.lw-modal iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
/* While the next page loads, hide the old one and show a quiet "Loading…" */
dialog.lw-modal.is-loading iframe { visibility: hidden; }
dialog.lw-modal.is-loading::after { content: 'Loading…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.lw-modal-x {
    position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: #f1f5f9; color: #334155; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lw-modal-x:hover { background: #e2e8f0; }
/* Back and Forward within the pop-up, beside the ✕ */
.lw-modal-nav { position: absolute; top: 10px; right: 56px; z-index: 2; display: flex; gap: 6px; }
.lw-modal-nav button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f5f9; color: #334155; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 0 3px; }
.lw-modal-nav button:hover:not(:disabled) { background: #e2e8f0; }
.lw-modal-nav button:disabled { opacity: .35; cursor: default; }
/* "Close this window?" question shown over the pop-up when Esc is pressed */
.lw-confirm { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .45); }
.lw-confirm[hidden] { display: none; }
.lw-confirm-box { background: #fff; border-radius: 16px; padding: 22px 24px; width: min(400px, 90%); box-shadow: 0 24px 60px rgba(15, 23, 42, .35); }
.lw-confirm-box strong { font-size: 1.15rem; }
.lw-confirm-box p { margin: 6px 0 16px; color: var(--muted); }
.lw-confirm-box .actions { justify-content: flex-end; }
.bulk-bar { align-items: center; }
/* Dated outside the VAT quarter it counts in: a quiet note, not a warning. */
.badge-outside { background: #f8fafc; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
/* Report lines that open a ledger. */
.report-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(18, 40, 74, .35); text-underline-offset: 3px; }
.report-link:hover { color: var(--brand); text-decoration-color: var(--brand); }
/* Filters apply as soon as they change, so their Filter / Update buttons aren't shown. */
form.auto-filter button[type="submit"] { display: none; }
.flag-btn { color: var(--muted); }
.flag-btn:hover { color: #dc2626; }
.flag-btn.is-flagged { color: #fff; background: #dc2626; border-color: #dc2626; }
.flag-btn[disabled] { opacity: .6; cursor: progress; }
.comment-btn { color: var(--muted); }
.comment-btn:hover { color: var(--brand); }
.mail-btn { color: var(--muted); }
.mail-btn:hover { color: #7c3aed; }
/* Emailed the client about this entry. */
.mail-btn.has-emails { position: relative; color: #fff; background: #7c3aed; border-color: #7c3aed; }
.mail-btn.has-emails:hover { color: #fff; background: #6d28d9; }
.mail-btn .talk-count { color: #6d28d9; border-color: #7c3aed; }
.comment.email-sent { border-left: 3px solid #7c3aed; }
/* Under discussion: there are comments about this entry. */
.comment-btn.has-comments { position: relative; color: #fff; background: #2563eb; border-color: #2563eb; }
.comment-btn.has-comments:hover { color: #fff; background: #1d4ed8; }
.comment-btn .talk-count, .mail-btn .talk-count { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: #fff; color: #1d4ed8; border: 1px solid #2563eb; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Switch between the + Record screens without leaving the window. */
.rec-switch { margin: 0 0 14px; padding: 12px 14px; background: #f8fafc; }
.rec-aside .rec-switch { margin: 0; }
.rec-switch h2 { font-size: .95rem; margin: 0 0 8px; }
.rec-switch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.rec-switch-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--text); font-size: .76rem; font-weight: 600; text-align: center; text-decoration: none; line-height: 1.2; }
.rec-switch-item svg { color: var(--muted); }
.rec-switch-item.in svg { color: #059669; }
.rec-switch-item.out svg { color: #dc2626; }
.rec-switch-item.asset svg, .rec-switch-item.doc svg { color: #15294B; }
a.rec-switch-item:hover { border-color: var(--brand); color: var(--brand); background: #f1f4f9; }
.rec-switch-item.is-current { border: 2px solid var(--brand); background: #f1f4f9; color: var(--brand); }
/* Flag and comment icons in a report row. */
.report-marks { white-space: nowrap; width: 1%; }
.report-marks .icon-btn { width: 28px; height: 28px; }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; }
.job-head-people { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-head-people .work-people .assignee { margin: 0; }
.table-search { width: min(420px, 100%); }
.people-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.work-table .job-title { font-weight: 600; color: var(--ink); }
.work-table .tick { width: 32px; padding-right: 0; }
/* The app's own "Are you sure?" window (replaces the browser's confirm box). */
.lw-ask { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .45); padding: 16px; }
.lw-ask[hidden] { display: none; }
.lw-ask-box { background: #fff; border-radius: 16px; padding: 22px 24px; width: min(440px, 100%); box-shadow: 0 24px 60px rgba(15, 23, 42, .35); }
.lw-ask-box strong { font-size: 1.1rem; display: block; }
.lw-ask-box p { margin: 8px 0 18px; color: var(--muted); white-space: pre-line; }
.lw-ask-box .actions { justify-content: flex-end; }

/* Searchable client picker (VAT page tiles) */
dialog.pick-modal {
    width: min(560px, 94vw); max-height: 80vh; padding: 24px 24px 18px; border: 0; border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35); display: none; flex-direction: column;
}
dialog.pick-modal[open] { display: flex; }
dialog.pick-modal::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
dialog.pick-modal h2 { margin: 0 40px 2px 0; }
.pick-search { width: 100%; margin: 12px 0 10px; padding: 11px 14px; font-size: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.pick-search:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.pick-list { overflow-y: auto; min-height: 120px; margin: 0 -6px; padding: 0 6px; }
.pick-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; color: inherit; }
.pick-list a[hidden] { display: none; }
.pick-list a:hover, .pick-list a.active { background: #eef2ff; text-decoration: none; }
.pick-list a > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.pick-list small { color: var(--muted); font-size: .8rem; }
.pick-list .badge { flex-shrink: 0; }
/* Workstation quick access: recently opened, open jobs, assigned. Compact rows above the search. */
.pick-quick { margin: 10px -6px 0; padding: 0 6px; }
.pick-quick[hidden], .pick-list[hidden] { display: none; }
.pick-group { margin: 8px 0 2px; padding: 0 12px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pick-quick a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 12px; border-radius: 10px; color: inherit; }
.pick-quick a:hover, .pick-quick a.active { background: #eef2ff; text-decoration: none; }
.pick-quick a > span:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pick-quick strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-quick small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-quick .badge { flex-shrink: 0; }
body.in-modal { background: #fff; }
.modal-content { padding: 22px 28px 28px; }
/* Show only what's needed in the pop-up */
.in-modal .tabs, .in-modal .page-head > .actions, .in-modal .page-head .hint:first-child { display: none; }
.in-modal .page-head { margin-bottom: 10px; }
.in-modal .page-head h1 { font-size: 1.15rem; color: var(--muted); }
.in-modal .page-head p { display: none; }
.in-modal .record-card { border: 0; box-shadow: none; padding: 6px 0 0; }
/* Compact pop-up so the whole entry screen fits without scrolling */
.modal-content { padding: 16px 26px 18px; }
.in-modal .page-head { margin-bottom: 4px; }
.in-modal .rec-row { padding: 6px 0; }
.in-modal .record-top { margin-bottom: 6px; }
.in-modal .rec-hint { min-height: 0; }
.in-modal .alert { margin-bottom: 8px; padding: 8px 12px; }
#currency:invalid { border-color: var(--status-warning); }
.money select#currency { min-width: 120px; font-weight: 700; }
.in-modal .card { box-shadow: none; }

/* ---------- Record (fast keyboard entry) ---------- */

.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.record-tile {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 18px;
    border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: var(--radius);
    background: #fff; color: var(--ink); box-shadow: var(--shadow); transition: transform .08s, box-shadow .15s;
}
.record-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .1); }
.record-tile strong { font-size: 1.08rem; }
.record-tile small { color: var(--muted); }
.record-tile.in { border-left-color: #16a34a; }
.record-tile.out { border-left-color: #dc2626; }
.record-tile.asset { border-left-color: var(--brand-2); }
.record-tile.doc { border-left-color: #94a3b8; }
.record-tile .key { position: absolute; top: 14px; right: 14px; }
kbd, .record-tile .key {
    display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid #cbd5e1; border-bottom-width: 2px;
    border-radius: 6px; background: #f8fafc; font: 600 .78rem/1.5 Consolas, monospace; color: #334155; text-align: center;
}
.btn-primary kbd { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff; margin-left: 6px; }

.record-card { padding: 28px 32px; }
.record-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.ref-badge {
    display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 110px; padding: 10px 16px;
    border-radius: 14px; color: #fff; font-size: 2rem; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 18px rgba(18, 40, 74, .3);
}
.ref-badge small { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .85; margin-bottom: 4px; }
/* The quarter's paper file the number belongs to (numbers start again each quarter). */
.ref-badge .ref-quarter { margin-top: 5px; font-size: .66rem; font-weight: 600; font-style: normal; white-space: nowrap; opacity: .9; }
/* A Ref number shown in a list, with its quarter underneath. */
.ref-q { display: block; margin-top: 2px; font-size: .7rem; color: var(--muted); white-space: nowrap; }

.rec-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px dashed #eef2f6; }
.rec-row > label { font-weight: 700; font-size: 1.05rem; color: #334155; }
.record-card input[type=text], .record-card select { font-size: 1.35rem; padding: 12px 16px; border-width: 2px; }
.record-card input[type=text]:focus, .record-card select:focus { box-shadow: 0 0 0 5px rgba(18, 40, 74, .18); background: #f1f4f9; }
.record-card ::selection { background: #B9EEDD; }
.date-boxes { display: flex; align-items: center; gap: 8px; }
.date-boxes input[type=text] { width: 76px; text-align: center; font-variant-numeric: tabular-nums; }
.date-boxes input.yyyy { width: 110px; }
.date-boxes span { font-size: 1.5rem; color: #94a3b8; }
/* A list you can search by typing (select[data-search]): the box takes the list's place and width. */
.select-search { width: 100%; }
/* A browser date picker turned into DD / MM / YYYY boxes: compact, to fit filter bars and table cells. */
.date-split { display: inline-flex; gap: 4px; vertical-align: middle; }
.date-split input[type=text] { width: 3.2em; padding-left: 4px; padding-right: 4px; }
.date-split input.yyyy { width: 4.6em; }
.date-split span { font-size: 1rem; }
.money { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.money input[type=text] { max-width: 240px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.money select { width: auto; }
.money .prefix { font-size: 1.2rem; font-weight: 700; color: var(--muted); }
.rec-hint { margin: 4px 0 0 186px; min-height: 1.2em; }
.rec-hint.is-warn { color: #b45309; font-weight: 600; }
.ready-meter { display: block; height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; margin: 6px 0 2px; }
.ready-meter > span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #10b981); border-radius: 3px; }
.ready-meter.big { height: 10px; flex: 1 1 200px; margin: 0; }
.rec-ready { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rec-finding { padding: 10px 0; border-bottom: 1px dashed #e2e8f0; }
.stat-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.stat-link:hover { border-color: #12284a; box-shadow: 0 0 0 3px rgba(18, 40, 74, .12); }
.sb-pair { border-bottom: 1px solid #eef2f6; padding: 8px 0; }
.sb-pair summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.sb-sums { margin-left: auto; font-size: .9rem; }
.sense { border-left: 4px solid #f59e0b; }
.palette { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 1000; }
.palette[hidden] { display: none; }
.palette-box { width: min(560px, 92vw); background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); overflow: hidden; }
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid #e2e8f0; padding: 14px 16px; font-size: 1.05rem; outline: none; }
.palette-box ul { list-style: none; margin: 0; padding: 4px 0; max-height: 50vh; overflow: auto; }
.palette-box li { padding: 8px 16px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.palette-box li.on { background: #f1f4f9; color: #0b1c36; }
.palette-box li small { color: var(--muted); }
.saved-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.saved-filters .chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; font-size: .82rem; }
.saved-filters .chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; }
.note-form { display: grid; gap: 8px; }
.note-form textarea { width: 100%; resize: vertical; }
.note { margin-bottom: 10px; }
.note.is-pinned { border-left: 4px solid #12284a; }
.note-body { white-space: pre-wrap; margin-top: 8px; line-height: 1.5; }
.wb-sheet { margin-bottom: 14px; }
.wb-sheet.is-skip { opacity: .6; }
.wb-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; margin-top: 10px; }
.wb-cols label { font-size: .8rem; color: var(--muted); display: block; }
/* A sheet's preview scrolls on its own: framed so its edges show, and the wheel only stays in it while the pointer is over it. */
.wb-preview { max-height: 220px; overflow: auto; margin-top: 10px; font-size: .78rem; border: 1px solid #cbd5e1; border-bottom: 0; border-radius: 8px 8px 0 0; background: #fff; }
.wb-preview[style*="height"] { max-height: none; } /* sized by its bar (set on load and when dragged) */
/* Columns as in Excel: a fixed width each (dragged at the heading's right edge), longer text cut with "…" (shown in full on hover). */
.wb-preview table { table-layout: fixed; border-collapse: collapse; }
.wb-preview td, .wb-preview th { padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid #eef2f6; border-right: 1px solid #eef2f6; text-align: left; }
.wb-preview th { position: sticky; top: 0; z-index: 1; background: #f1f5f9; }
.wb-grip { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; }
.wb-grip:hover, .wb-dragging-col .wb-grip:active { background: #94a3b8; }
.wb-grow { height: 10px; margin-bottom: 4px; cursor: ns-resize; border: 1px solid #cbd5e1; border-top: 1px solid #e2e8f0; border-radius: 0 0 8px 8px; background: #f1f5f9 center / 28px 4px no-repeat linear-gradient(#94a3b8 0 1px, transparent 1px 3px, #94a3b8 3px 4px); }
.wb-grow:hover { background-color: #e2e8f0; }
/* Cells that can be typed over, as in Excel: a green box round the one being edited, changed ones tinted yellow. */
.wb-preview td[data-cell] { cursor: cell; }
.wb-preview td[data-cell]:focus { outline: 2px solid #16a34a; outline-offset: -2px; background: #fff; text-overflow: clip; cursor: text; }
.wb-preview td.is-edited, .wb-preview td.is-changed { background: #fef9c3; }
.wb-dragging-col, .wb-dragging-col * { cursor: col-resize !important; user-select: none; }
.wb-dragging-row, .wb-dragging-row * { cursor: ns-resize !important; user-select: none; }
.amt-cell { width: 110px; text-align: right; font: inherit; color: inherit; background: transparent; border: 1px solid #cbd5e1; border-radius: 4px; padding: 2px 6px; }
.amt-cell:hover { border-color: var(--field-line); background: #fff; }
.amt-cell:focus { border-color: #12284a; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(18, 40, 74, .15); }
.amt-cell.is-saved { border-color: #16a34a; background: #f0fdf4; }
.rec-tiles { margin-bottom: 18px; }
.rec-tiles .home-tile.is-clear { opacity: .75; }
.rec-tiles .home-tile.is-active { opacity: 1; outline: 3px solid #12284a; outline-offset: 2px; }
.rec-pick-hint { text-align: center; margin: 4px 0 18px; }
.rec-nothing { display: none; align-items: center; gap: 8px; }
.rec-tiles-on .rec-section { display: none !important; }
.rec-tiles-on .rec-section.is-open { display: block !important; }
.rec-tiles-on .rec-nothing.is-open { display: flex !important; }
.rec-tiles .home-tile.is-clear:hover { opacity: 1; }
.rec-section { scroll-margin-top: 80px; }
.name-group { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; }
.name-group .chip { display: inline-block; padding: 2px 10px; margin: 2px 4px 2px 0; border-radius: 999px; background: #f1f5f9; font-size: .88rem; }
.cell-link { color: inherit; text-decoration: none; border-bottom: 1px dotted #94a3b8; }
.cell-link:hover { color: #0b1c36; border-bottom-color: #0b1c36; background: #f1f4f9; }
/* A date after today on the Transactions list. */
td.is-future, td.is-future .cell-link { color: #b91c1c; font-weight: 700; }
td.is-future .cell-link { border-bottom-color: #b91c1c; }
.money-in { color: #15803d; font-weight: 700; }
.money-out { color: #b91c1c; font-weight: 700; }
.cat-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.cat-link.is-none { color: #b45309; font-weight: 600; }
.cat-scope label { display: block; margin: 4px 0; }
.rec-drop { display: block; margin: 0 0 8px; padding: 10px 14px; border: 2px dashed #cbd5e1; border-radius: 10px; color: var(--muted); font-size: .9rem; cursor: pointer; transition: border-color .15s, background .15s; }
.rec-drop:hover, .rec-drop.is-over { border-color: #12284a; background: #f1f4f9; color: #0b1c36; }
.rec-drop.is-busy { border-style: solid; border-color: #12284a; background: #f1f4f9; cursor: progress; }
.rec-drop.is-done { border-style: solid; border-color: #86efac; background: #f0fdf4; color: #166534; }
.bank-ok { display: block; margin-top: 2px; font-size: .7rem; font-weight: 600; color: #15803d; white-space: nowrap; }
.rec-more { margin-top: 14px; }
.rec-more summary { cursor: pointer; color: var(--muted); font-weight: 600; }

.ta { position: relative; }
.ta-list {
    position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
    max-height: 320px; overflow-y: auto;
}
.ta-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 1.05rem; }
.ta-list li:hover, .ta-list li.on { background: #e6ebf4; }

.segmented.compact { margin: 0; gap: 0; }
.segmented.compact a { padding: 6px 12px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .88rem; }
.segmented.compact a:first-child { border-radius: 8px 0 0 8px; }
.segmented.compact a:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.segmented.compact a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.segmented.compact a:hover { text-decoration: none; }

@media (max-width: 720px) {
    .rec-row { grid-template-columns: 1fr; gap: 6px; }
    .rec-hint { margin-left: 0; }
    .record-card { padding: 20px; }
}

@media (max-width: 860px) {
    .sidebar { display: none; }
    .content { padding: 18px; }
}

/* ---------- Icons on tiles and buttons ---------- */
.icon { flex: none; vertical-align: -4px; }
.btn .icon { margin-right: 6px; vertical-align: -3px; }
.record-tile .tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; margin-bottom: 8px; background: #e6ebf4; color: var(--brand-dark); }
.record-tile.in .tile-icon { background: #dcfce7; color: #15803d; }
.record-tile.out .tile-icon { background: #fee2e2; color: #b91c1c; }
.record-tile.asset .tile-icon { background: #E1E7EF; color: var(--brand-2); }
.record-tile.doc .tile-icon { background: #f1f5f9; color: #475569; }
.record-tile:hover .tile-icon { transform: scale(1.06); transition: transform .12s; }

/* ---------- Payroll ---------- */
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }
.card-inset { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.payroll-start h2 { margin-bottom: 2px; }
.progress-line { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; width: min(420px, 100%); margin-top: 6px; }
.progress-line span { display: block; height: 100%; background: var(--status-good); border-radius: 99px; transition: width .3s; }
.pay-grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pay-grid th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: right; padding: 8px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: #fff; z-index: 1; }
.pay-grid th.l, .pay-grid td.l { text-align: left; }
.pay-grid td { padding: 6px 5px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; vertical-align: middle; }
.pay-grid tr.is-checked td { background: #f0fdf4; }
.pay-grid tr:hover td { background: #f8fafc; }
.pay-grid tr.is-checked:hover td { background: #e7f9ee; }
.pay-grid input[type=text] { width: 74px; text-align: right; padding: 6px 7px; font-variant-numeric: tabular-nums; font-weight: 600; }
.pay-grid input.small { width: 50px; }
.pay-grid input:focus { outline: 2px solid var(--brand); background: #f1f4f9; }
.pay-grid input.saving { background: #fefce8; }
.pay-grid .net { font-weight: 800; font-size: 1.02rem; }
.pay-grid .emp strong { display: block; }
.pay-grid .emp small { color: var(--muted); }
.pay-grid tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: 0; }
.pay-grid .warn-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; }
.warn-dot.danger { background: var(--status-critical); }
.warn-dot.warning { background: var(--status-warning); }
.warn-dot.info { background: #94a3b8; }
.pay-grid .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.pay-grid .tick.on { background: var(--status-good); border-color: var(--status-good); color: #fff; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.bulk-bar .count { font-weight: 700; margin-right: 6px; }
.payslip-sheet { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: #fff; }
.payslip-sheet table { width: 100%; border-collapse: collapse; }
.payslip-sheet td { padding: 5px 0; border-bottom: 1px dashed #eef2f6; }
.payslip-sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
.payslip-sheet .netpay { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); }
.slip-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.slip-nav .pos { color: var(--muted); font-weight: 600; }
.status-line { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.status-line strong { color: var(--ink); }
@media (max-width: 760px) {
    .pay-grid input[type=text] { width: 70px; }
}
.checklist.status li::before { content: "○"; color: var(--muted); }
.checklist.status li.done::before { content: "✓"; color: var(--status-good); }
.checklist.status li.done { color: var(--muted); }
.tick-demo { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--status-good); color: #fff; font-size: .75rem; align-items: center; justify-content: center; }
.table.compare th, .table.compare td { padding: 9px 8px; }
.table.compare tbody th, .table.compare tr > th:first-child { text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); font-weight: 600; }
.table.compare tr.strong td, .table.compare tr.strong th { font-weight: 800; border-top: 2px solid var(--line); }
/* Pop-up entry window: recent entries sit beside the form instead of below it */
.in-modal .rec-side { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.in-modal .rec-recent { margin: 0; padding: 14px 16px; max-height: calc(96vh - 330px); overflow: auto; background: #f8fafc; }
.rec-aside { display: flex; flex-direction: column; gap: 14px; }
.in-modal .rec-aside { margin-top: 34px; } /* clear of the window's ✕ */
.in-modal .rec-recent h2 { font-size: 1rem; }
.in-modal .rec-recent .table td { padding: 7px 4px; font-size: .86rem; }
/* Ref on the left; name and amount on the first line, the entry's icons on the second (four icons don't fit beside them). */
.in-modal .rec-recent .table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.in-modal .rec-recent .table td:first-child { grid-row: span 2; }
.in-modal .rec-recent .table td:nth-child(3) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-modal .rec-recent .table td.rec-actions { grid-column: 2 / 4; padding-top: 0; }
.in-modal .rec-recent .table td { border: 0; }
.in-modal .rec-recent td.cat, .in-modal .rec-recent td.vat, .in-modal .rec-recent td:nth-child(2) { display: none; }
@media (max-width: 900px) { .in-modal .rec-side { grid-template-columns: 1fr; } }
/* Receipts / Payments: big money in / out picture centred at the top of the entry screen */
.record-top:has(.rec-hero) { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.record-top:has(.rec-hero) .actions { justify-self: end; }
.record-top:has(.rec-hero) .ref-badge { justify-self: start; }
.rec-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.rec-hero h2 { margin: 6px 0 0; font-size: 1.35rem; }
.rec-hero small { color: var(--muted); font-weight: 600; }
.rec-hero-icon {
    width: 80px; height: 80px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 22px -8px currentColor, inset 0 0 0 6px rgba(255, 255, 255, .55);
}
.rec-hero.in .rec-hero-icon { background: linear-gradient(145deg, #dcfce7, #bbf7d0); color: #15803d; }
.rec-hero.in h2 { color: #166534; }
.rec-hero.out .rec-hero-icon { background: linear-gradient(145deg, #fee2e2, #fecaca); color: #b91c1c; }
.rec-hero.out h2 { color: #991b1b; }
.rec-hero.in .rec-hero-icon svg { animation: rec-in 1.6s ease-in-out 2; }
.rec-hero.out .rec-hero-icon svg { animation: rec-out 1.6s ease-in-out 2; }
@keyframes rec-in { 50% { transform: translateY(3px); } }
@keyframes rec-out { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .rec-hero-icon svg { animation: none !important; } }
.in-modal .record-top:has(.rec-hero) .ref-badge { margin-bottom: 0; }

/* Required documents: tick lists and the "who is asked" chooser */
.req-ticks { display: grid; gap: 6px; }
.req-ticks .check, .req-who .check { align-items: flex-start; }
.req-more { margin-top: 12px; }
.req-more summary, .req-add > summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.req-more[open] summary { margin-bottom: 8px; }
.req-add { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.req-add > summary { list-style: none; display: inline-flex; color: inherit; }
.req-add > summary::-webkit-details-marker { display: none; }
.req-who { display: grid; gap: 6px; }
.req-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; margin: 0 0 4px 26px; }
.req-clients { margin: 0 0 4px 26px; }
.req-clients input[type=search] { width: 100%; margin-bottom: 6px; }
.req-client-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: grid; gap: 4px; }
.req-client-list [hidden], .req-who [hidden] { display: none; }
.req-edit { display: inline-block; }
.req-edit > summary { list-style: none; }
.req-edit > summary::-webkit-details-marker { display: none; }
.req-edit[open] .req-edit-card { position: absolute; right: 24px; z-index: 30; width: min(520px, 90vw); text-align: left; white-space: normal; box-shadow: 0 20px 50px rgba(15, 23, 42, .2); }

/* Column-check screen: every line editable */
.edit-lines td { padding: 3px 4px; }
.edit-lines input { width: 100%; min-width: 70px; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; }
.edit-lines input:hover { border-color: var(--line); }
.edit-lines input:focus { border-color: var(--brand); background: #fff; outline: none; }
.edit-lines td.bal { color: var(--muted); white-space: nowrap; }
.edit-lines td.bal.changed { color: #b45309; font-weight: 700; }
.edit-totals { display: flex; gap: 16px; flex-wrap: wrap; font-size: .92rem; }

/* Review imported bank lines: one row per payee */
.review-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; padding: 4px 0 12px; }
.review-bar .hint { flex: 1; min-width: 240px; }
.review-table td { vertical-align: top; }
.review-table select { max-width: 230px; }
.review-payee { width: 100%; min-width: 180px; font-weight: 600; }
.review-group + .review-group .review-head td { border-top: 2px solid var(--line); }
.review-head td { border-bottom: 0; }
.review-toggle { display: block; margin-top: 6px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; font-size: .82rem; }
.review-sub td { padding-top: 4px; padding-bottom: 4px; border-top: 0; border-bottom: 0; font-size: .84rem; color: var(--muted); vertical-align: middle; }
.review-sub td:nth-child(2) { padding-left: 18px; }
.review-sub .review-date { color: var(--text, #0f172a); font-weight: 600; margin-right: 6px; }
.review-sub select { font-size: .84rem; padding: 4px 8px; max-width: 230px; }
.review-sub select.own { border-color: #b45309; color: #b45309; font-weight: 600; }
.review-sub .icon-btn { width: 26px; height: 26px; }
.amount-input { width: 104px; padding: 4px 6px; text-align: right; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
.amount-input.changed { border-color: #b45309; color: #b45309; font-weight: 700; }
.drafts-card { margin-bottom: 18px; border-left: 4px solid #f59e0b; }
/* Client comments (permanent record) */
.comments { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.comment { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.comment.question { border-left: 4px solid #f59e0b; background: #fffbeb; }
.comment.answered { border-left: 4px solid var(--brand); }
.comment.reply { margin: 8px 0 0 18px; background: #f8fafc; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-body { white-space: pre-line; }
.comment-reply { margin-top: 6px; }
.comment-reply summary { cursor: pointer; }
.comment-reply textarea { width: 100%; margin: 6px 0; }
.work-table td { vertical-align: top; }
.work-table .strong-link { font-weight: 700; }
.work-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.work-people { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.work-people .assignee { margin: 0; }
.work-people .assignee a { color: inherit; }
.add-person { position: relative; }
.add-person summary { list-style: none; cursor: pointer; width: 28px; height: 28px; }
.add-person summary::-webkit-details-marker { display: none; }
/* Opens to the left of the + button so it never runs off the edge of the table. */
.add-person-form { position: absolute; z-index: 20; top: 34px; right: 0; width: 280px; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.add-person-form strong { font-size: .95rem; }
/* Reconciliation work tab. */
.tab-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.rec-section { margin-bottom: 14px; }
.rec-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rec-file { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px; color: var(--text); text-decoration: none; border-left: 4px solid #dc2626; }
.rec-file.is-clear { border-left-color: #10b981; }
.rec-file:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .1); }
.rec-file strong { font-size: 1.05rem; }
.rec-section h2 { display: flex; align-items: center; gap: 8px; }
.rec-section td { vertical-align: top; }
.rec-act { white-space: nowrap; text-align: right; width: 1%; }
.rec-act form { display: inline; margin: 0; }
.rec-icons { white-space: nowrap; width: 1%; }
div.rec-icons { margin-top: 6px; width: auto; }
.rec-quote { margin: 4px 0; padding: 6px 10px; border-left: 3px solid var(--line); background: #f8fafc; white-space: pre-line; font-size: .9rem; }
.rec-empty { display: flex; align-items: center; gap: 8px; color: #047857; font-weight: 600; }
.danger-text { color: #dc2626; }
/* Opening a VAT quarter's file: the client's HMRC stagger group and its deadlines. */
.stagger-note { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #f1f4f9; border: 1px solid #B9EEDD; font-size: .92rem; }
/* Buttons that can't be used yet look it (a reason is shown next to them). */
.btn:disabled, .btn.is-blocked { opacity: .5; cursor: not-allowed; box-shadow: none; }
@keyframes lw-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } 30% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .35); } }
.alert.flash { animation: lw-flash 1.2s ease-in-out 2; }
/* Prepare VAT return: tick several people at once. */
.vat-people .work-people { gap: 8px; }
.vat-people #vat-people-chips { display: contents; }
.vat-people .add-person-form { left: 0; right: auto; }
.vat-people-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.vat-people-list .check { margin: 0; }
/* Let the menu spill over the table's edge on the last rows (small screens keep the table scrolling sideways). */
@media (min-width: 900px) { .table-wrap:has(.work-table) { overflow: visible; } }
.add-person-form select { width: 100%; min-width: 0; padding: 9px 10px; font-size: .95rem; }
.add-person-form .actions { justify-content: flex-end; gap: 8px; }
.view-toggle { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle a { padding: 6px 12px; color: inherit; font-size: .9rem; }
.view-toggle a.active { background: var(--brand); color: #fff; }
.assignee { display: inline-flex; align-items: center; gap: 4px; margin: 0 12px 4px 0; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; }
.assignee form { display: inline; margin: 0; }
.assignee .icon-btn { width: 24px; height: 24px; }
/* Job page: the client's actions as big buttons */
.import-hint { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--brand); }
.import-hint .hint { flex: 1; min-width: 220px; }
.import-sheets [data-sheet] .row-between { align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.amount-in { color: #15803d; }
.amount-out { color: #b91c1c; }

/* Edit / delete icons on recent entries */
td.rec-actions { white-space: nowrap; text-align: right; }
td.rec-actions form { display: inline; margin: 0; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #475569; cursor: pointer; vertical-align: middle;
}
.icon-btn + .icon-btn, .icon-btn + form, form + .icon-btn { margin-left: 4px; }
.icon-btn:hover { background: #f1f5f9; color: var(--brand); text-decoration: none; }
.icon-btn.danger:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.icon-btn.locked { color: #94a3b8; cursor: default; background: transparent; }
.content:has(.pay-grid) { max-width: 1520px; }
.pay-grid .last-net { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.pay-grid td.emp { white-space: normal; min-width: 170px; }
/* Session currency choice for multi-currency clients */
.currency-pick { max-width: 860px; }
.currency-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 8px; }
.currency-option { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); transition: border-color .12s, transform .08s; }
.currency-option:hover, .currency-option:focus { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); outline: none; }
.currency-option .sym { font-size: 1.9rem; font-weight: 800; color: var(--brand-dark); line-height: 1.1; }
.currency-option.mixed .sym { font-size: 1.3rem; color: var(--brand-2); }
.currency-option small { color: var(--muted); }
.currency-option .key { position: absolute; top: 12px; right: 12px; font: 600 .75rem/1 ui-monospace, monospace; background: #f1f5f9; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
.in-modal .money { flex-wrap: nowrap; } .in-modal .money select#vat_rate { max-width: 230px; } .in-modal .money input[type=text] { min-width: 0; }
.in-modal .rec-row { padding: 4px 0; } .in-modal .rec-more { margin-top: 8px; } .in-modal .record-top .ref-badge { transform: scale(.85); transform-origin: left top; margin-bottom: -8px; }
/* ---------- Home: big buttons ---------- */
.home-group { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 12px; }
.home-group:first-of-type { margin-top: 6px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.home-tile { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 20px; min-height: 104px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 10px; box-shadow: var(--shadow); color: var(--ink); transition: transform .1s, box-shadow .15s, border-color .15s; }
.home-tile:hover, .home-tile:focus-visible { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15, 23, 42, .12); border-color: var(--tile-fg); outline: none; }
.home-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 12px; background: var(--tile-bg); color: var(--tile-fg); transition: transform .15s; }
.home-tile:hover .home-icon { transform: scale(1.07) rotate(-3deg); }
.home-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.home-text strong { font-size: 1.12rem; }
.home-text small { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.home-count { position: absolute; top: -10px; right: 10px; z-index: 2; box-shadow: 0 0 0 3px #fff; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--status-critical); color: #fff; font-size: .8rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.home-count.neutral { background: #e2e8f0; color: #334155; }
.home-count + .home-count { right: auto; left: 10px; }
/* A count in red on a button's top right corner (e.g. "Out of scope" on Transactions). */
.btn:has(> .btn-count) { position: relative; }
.btn-count { position: absolute; z-index: 5; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--status-critical); color: #fff;
    font-size: .72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.tone-teal { --tile-bg: #12284a; --tile-fg: #e0a526; }
.tone-indigo { --tile-bg: #E1E7EF; --tile-fg: #15294B; }
.tone-amber { --tile-bg: #fbf0d2; --tile-fg: #8a5a07; }
.tone-rose { --tile-bg: #ffe4e6; --tile-fg: #be123c; }
.tone-slate { --tile-bg: #f1f5f9; --tile-fg: #334155; }
@media (max-width: 600px) { .home-grid { grid-template-columns: 1fr; } .home-tile { min-height: 84px; padding: 16px; } }
.home-tile.is-current { border-color: var(--tile-fg); box-shadow: 0 0 0 3px var(--tile-bg), var(--shadow); }
/* ---------- Side menu: a drawer, hidden until the Menu button is pressed ---------- */
.sidebar { display: flex !important; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; overflow-y: auto; transform: translateX(-100%); transition: transform .22s ease, box-shadow .22s; }
body.nav-open .sidebar { transform: none; box-shadow: 12px 0 40px rgba(15, 23, 42, .35); }
.nav-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(15, 23, 42, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.nav-toggle:hover { background: #f1f5f9; }
.topbar-home { display: inline-flex; }
@media (max-width: 600px) { .nav-toggle span { display: none; } }
/* Phones: a compact top bar (menu, logo, alerts, avatar, sign out) */
@media (max-width: 700px) {
    .topbar { padding: 10px 12px; gap: 8px; }
    .topbar-left strong, .topsearch, .topbar .who > a.who > span:not(.avatar) { display: none; }
    .topbar .who { gap: 6px; }
    .topbar .btn-sm { padding: 6px 9px; }
    .page-head { flex-wrap: wrap; gap: 10px; }
    .page-head .actions { flex-wrap: wrap; }
}
.filters { flex-wrap: wrap; } .filters > *, .filters select, .filters input { max-width: 100%; min-width: 0; }

/* Year-end figures the app already knows, under each balance box. */
.known-row { margin: -2px 0 8px; padding: 6px 10px; border-radius: 6px; background: var(--bg); font-size: 12.5px; line-height: 1.45; }
.known-diff { color: #b45309; font-weight: 600; }
.known-ok { color: var(--ok); }
.linklike { background: none; border: 0; padding: 0 0 0 6px; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; }


/* Excel export: choose the layout. */
dialog.export-pick { overflow-y: auto; }
.export-options { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.export-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.export-option:has(input:checked) { border-color: var(--brand); background: #f1f4f9; }
.export-option input { margin-top: 3px; }
.export-option span { display: flex; flex-direction: column; min-width: 0; }
.export-option small { color: var(--muted); }
.export-upload { border-top: 1px solid var(--line); padding-top: 12px; }


/* Upload documents, at the end of the Documents filter bar. */


/* Flagged once and resolved since: green, so it stays visible. And why an entry was flagged, under its badge. */
.flag-btn.was-flagged { color: #fff; background: #16a34a; border-color: #16a34a; }
.flag-btn.was-flagged:hover { background: #15803d; color: #fff; }
.flag-why { margin-top: 3px; padding: 4px 8px; border-left: 3px solid #dc2626; background: #fef2f2; color: #7f1d1d; font-size: .78rem; line-height: 1.35; border-radius: 0 6px 6px 0; max-width: 520px; }
.flag-why.was { border-left-color: #16a34a; background: #f0fdf4; color: #166534; }


/* Resolve button at the end of a flag's reason, and its pop-up. */
.flag-resolve { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: #dc2626; color: #fff !important; font-weight: 600; font-size: .74rem; text-decoration: none; }
.flag-resolve:hover { background: #b91c1c; }
.settle-pair { display: grid; gap: 10px; margin: 12px 0; }
.settle-line { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.settle-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }


/* Reports as big tiles: the tile opens the report; its exports sit along the bottom. */
/* Export bar at the top of a report. */
.export-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.export-bar-label { font-weight: 600; color: var(--muted); margin-right: 4px; }
.export-bar .btn { display: inline-flex; align-items: center; gap: 6px; }

/* Alert system. */
.alert-actions { white-space: nowrap; }
.alert-actions form { display: inline; }
.alert-actions .btn { margin: 0 0 4px 4px; }
.alert-preview { text-align: left; white-space: normal; margin-top: 4px; }
.alert-preview pre { white-space: pre-wrap; font-family: inherit; font-size: .82rem; background: var(--bg); padding: 10px; border-radius: 8px; max-width: 420px; margin: 6px 0 0 auto; }

/* Accounts dashboard and invoices. */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-grid .kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.kpi-grid .lbl { color: var(--muted); font-size: .85rem; font-weight: 600; }
.kpi-grid .num { font-size: 1.75rem; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .82rem; color: var(--muted); }
.trend-up { color: #0b7a3b; }
.trend-down { color: #b42318; }
.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.upcoming .up-date { font-weight: 700; color: var(--muted); }
.upcoming .up-what small { display: block; color: var(--muted); font-size: .75rem; }
.upcoming .up-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.upcoming li.in .up-amount { color: #0b7a3b; }
.upcoming li.late .up-date { color: #b42318; }
.invoice-lines input, .invoice-lines select { width: 100%; }
.invoice-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 12px 0; }
.invoice-totals div { display: flex; gap: 18px; min-width: 240px; justify-content: space-between; }
.invoice-totals .grand { font-size: 1.15rem; border-top: 2px solid var(--ink); padding-top: 6px; }
.row-total td { font-weight: 700; border-top: 2px solid var(--line); }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* Help page: the guide finder and the "What's new" card. */
.help-find { display: block; margin: 0 0 12px; }
.help-find input[type=search] { width: 100%; min-height: 50px !important; font-size: 1.02rem !important; }
.help-new { border-left: 4px solid var(--brand); }

/* Receipt batch: drop zone, counters, progress bar, and the review screen. */
.batch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 8px; }
.batch-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.batch-bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.batch-errors { margin: 6px 0; padding-left: 18px; color: #b45309; font-size: .85rem; }
.review-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.review-split .preview img.review-img { width: 100%; max-height: 78vh; object-fit: contain; }
.review-split .preview iframe { width: 100%; height: 78vh; border: 0; }
.zoom-stage { overflow: hidden; border-radius: 8px; cursor: zoom-in; }
.zoom-stage.is-zoomed { cursor: crosshair; }
.zoom-in { transition: transform .12s ease-out; }
.zoom-turn { transition: transform .2s ease-out; }
.receipt-crop { width: 100%; aspect-ratio: 1 / 2; margin: 0 auto; background-repeat: no-repeat; border-radius: 8px; border: 1px solid var(--line); }
.match-card { border: 2px solid #1a8d4a; }
.ref-written input { max-width: 120px; font-weight: 700; font-size: 1.05rem; text-align: center; border-radius: 999px; }
.ref-written .badge { margin-left: 6px; }
@media (max-width: 700px) { .batch-stats { grid-template-columns: repeat(2, 1fr); } }

/* WhatsApp: its own green, so it's found at a glance next to PDF, Excel and Email. */
.btn-whatsapp { display: inline-flex; align-items: center; gap: 6px; background: #1a8d4a; border-color: #1a8d4a; color: #fff; }
.btn-whatsapp:hover { background: #157a3f; color: #fff; text-decoration: none; }
.btn.btn-wa { color: #157a3f; }

/* Buttons at the top right of a client page (e.g. Banks: import statements, upload documents). */


/* Every search box (except the top bar's and the transactions bar's, which have their own markup): one look across
   the app. Rounded, a little taller, a magnifying glass drawn in, and a soft brand-coloured ring when typing. */
input[type=search]:not(#topsearch):not(.filter-search input) {
    -webkit-appearance: none; appearance: none;
    min-height: 44px; padding: 0 16px 0 42px; font-size: .95rem; color: var(--ink);
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 15px center;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input[type=search]:not(#topsearch):not(.filter-search input)::placeholder { color: var(--muted); }
input[type=search]:not(#topsearch):not(.filter-search input):hover { border-color: #cbd5e1; background-color: #fff; }
input[type=search]:not(#topsearch):not(.filter-search input):focus {
    outline: none; background-color: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(18, 40, 74, .14);
}
.filters input[type=search]:not(.filter-search input) { flex: 1 1 300px; min-width: 240px; }
.pick-search { border-radius: 999px; }

/* Pop-ups on phones and tablets: every pop-up scrolls when it's taller than the screen (so Save is always reachable),
   and takes nearly the whole screen on a phone. */
dialog.pick-modal { overflow-y: auto; overscroll-behavior: contain; }
dialog.fees-modal { width: min(780px, 94vw); }
dialog.people-modal { width: min(600px, 94vw); }
.fee-row { display: grid; grid-template-columns: 1.4fr .8fr 1fr 1.4fr; gap: 8px; margin-bottom: 8px; }
.fee-row > * { min-width: 0; width: 100%; }
.fee-dd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 14px; }
.add-people-line { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
    .fee-row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
    .fee-dd { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    dialog.pick-modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; padding: 20px 16px 16px; border-radius: 18px 18px 0 0; }
    dialog.lw-modal { width: 100vw; height: 100vh; border-radius: 0; }
    .fee-dd { grid-template-columns: 1fr; }
    .pick-modal .actions { position: sticky; bottom: -16px; background: #fff; padding: 10px 0 6px; }
}

/* Column headings that sort when clicked. */
th.th-sort a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
th.th-sort a:hover { color: var(--brand); }
th.th-sort.num a { justify-content: flex-end; }
th .flag-rainbow { vertical-align: middle; }
.flag-resolve-row { margin-top: 6px; }
.badge-resolved { background: #e3f6e8; color: #1b7a3a; font-weight: 600; }
/* Record window: "Lock" ticks after the name and category keep them for the next entries. */
.rec-lockable { display: flex; align-items: center; gap: 10px; }
.rec-lockable .ta { flex: 1; min-width: 0; }
.rec-lock { position: relative; display: inline-flex; align-items: center; white-space: nowrap; font-size: .85rem; font-weight: 600; color: #64748b; cursor: pointer; user-select: none; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.rec-lock:hover { border-color: #94a3b8; }
/* The padlock is the switch: open = not locked, closed = locked. */
.rec-lock input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rec-lock span { display: inline-flex; align-items: center; gap: 5px; }
.rec-lock .lk-shut, .rec-lock:has(input:checked) .lk-open { display: none; }
.rec-lock:has(input:checked) .lk-shut { display: inline-flex; }
.rec-lock:has(input:checked) { color: var(--brand-dark); border-color: var(--brand); background: #f1f4f9; }
.rec-lockable input[readonly] { background: #f1f5f9; color: #0f172a; border-style: dashed; }
/* Ref badge on entry screens: click to type the number by hand. */
.ref-pick { cursor: pointer; }
.ref-pick:hover { outline: 2px solid var(--brand); outline-offset: 2px; }
.ref-dialog { border: 0; border-radius: 14px; padding: 22px 24px; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.ref-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.ref-dialog h3 { margin: 0 0 6px; }
.ref-dialog input { font-size: 1.6rem; font-weight: 700; width: 140px; text-align: center; }
.ref-dialog-choices { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 6px; }
.ref-edit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; }
.archive-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; } .archive-filter a { text-decoration: none; }
/* Ticking files to remove several at once: the bar stays in view at the bottom while any are ticked. */
.tick-col { width: 34px; }
.archive-bulk { position: sticky; top: 12px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 14px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }
.archive-bulk[hidden] { display: none; }
/* Quick pop-up for a missing email or number */
dialog.quick-contact { border: 0; border-radius: 14px; padding: 20px 22px 16px; width: min(420px, calc(100% - 32px)); box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
dialog.quick-contact::backdrop { background: rgba(15, 23, 42, .45); }
dialog.quick-contact h3 { margin: 0 0 10px; }
dialog.quick-contact .hint { margin: -4px 0 10px; }
.qc-row { display: flex; gap: 6px; margin-bottom: 6px; }
.qc-row input { flex: 1; min-width: 0; font-size: 1rem; padding: 9px 12px; }
.qc-plus { width: 38px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 1.2rem; cursor: pointer; }
.qc-plus:hover { border-color: var(--brand); color: var(--brand); }
.qc-row:not(:last-child) .qc-plus { visibility: hidden; }
dialog.quick-contact .actions { align-items: center; margin-top: 10px; }
.bulk-new { margin-top: 6px; } .bulk-new input { width: 100%; max-width: 240px; }
.missing-contact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.whose-card { max-width: 860px; }
.whose-lead { font-size: 1.15rem; margin: 0 0 4px; }
.whose-found { background: #f1f4f9; border: 1px solid #B9EEDD; border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; }
/* Archive (Home screen): who a file is shared with, search row, edit row */
.archive-people { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.archive-people label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; cursor: pointer; }
.archive-people label:has(input:checked) { border-color: var(--brand); background: #f1f4f9; color: var(--brand-dark); }
.clash-dialog { max-width: 520px; }
.clash-dialog fieldset.clash { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 10px; }
.clash-dialog fieldset.clash legend { padding: 0 4px; word-break: break-word; }
.clash-dialog .check { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.clash-dialog input[type=text] { font-size: inherit; font-weight: 400; width: 100%; text-align: left; }
.also-added { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.also-added .chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 10px; border-radius: 999px; background: #f1f4f9; border: 1px solid var(--brand); color: var(--brand-dark); font-size: .88rem; }
.also-added .chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 4px; }
.also-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.also-list label { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; font-weight: 500; cursor: pointer; }
.also-list label:hover { background: #f8fafc; }
.also-list label:has(input:checked) { background: #f1f4f9; color: var(--brand-dark); }
/* "From archive" beside every upload box */
.archive-from-wrap { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.archive-from { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 2px dashed var(--brand); border-radius: 10px; background: #f1f4f9; color: var(--brand-dark); font-weight: 600; font-size: .95rem; cursor: pointer; }
.archive-from:hover { background: #e6ebf4; }
.archive-from svg { width: 24px; height: 24px; }
.archive-pick { max-width: 640px; }
.archive-pick h3 { display: flex; align-items: center; gap: 8px; }
.archive-pick .archive-pick-search { width: 100%; margin: 8px 0 10px; }
.archive-pick-list { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.archive-pick-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.archive-pick-row span { display: flex; flex-direction: column; }
.archive-pick-head { margin: 8px 2px 2px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.archive-pick-row small { color: var(--muted, #64748b); }
.archive-pick-row:has(input:checked) { border-color: var(--brand); background: #f1f4f9; }
.archive-pick-row.is-mine { border-left: 4px solid var(--brand); }
.archive-pick-row.is-off { opacity: .5; cursor: not-allowed; }
.archive-pick input { font-size: 1rem; font-weight: 400; text-align: left; }
.archive-pick-row input { width: auto; flex: 0 0 auto; margin: 3px 0 0; }
/* Every file upload box: a roomy dashed drop area with a big, soft "Choose file" button */
input[type=file] { padding: 14px 16px; border: 2px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; color: #475569; font-size: .95rem; cursor: pointer; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
input[type=file]:hover, input[type=file]:focus { border-color: var(--brand); background: #f1f4f9; box-shadow: 0 0 0 4px rgba(18, 40, 74, .12); outline: none; }
input[type=file]::file-selector-button { margin-right: 14px; padding: 11px 20px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 2px 6px rgba(15, 118, 110, .25); transition: transform .15s ease, box-shadow .2s ease, filter .2s ease; }
input[type=file]::file-selector-button:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(15, 118, 110, .3); transform: translateY(-1px); }
input[type=file]::file-selector-button:active { transform: translateY(0); }
.archive-from { transition: background .2s ease, transform .15s ease, box-shadow .2s ease; }
.archive-from:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 118, 110, .18); }
/* Client import: the Import button stays in view while the sheets are checked */
.import-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 24px rgba(15, 23, 42, .12); }
.import-bar span { flex: 1; min-width: 220px; }
.import-figures { margin: 14px 0 4px; padding: 12px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; } .import-figures p { margin: 0 0 8px; } .import-figures .table { margin: 0; }
/* Convert files */
.convert-card #target, .convert-card #mode { width: 100%; }
.convert-list { margin: 0; padding-left: 20px; line-height: 1.7; }
.convert-checks { border-left: 5px solid #16a34a; }
.convert-checks.is-unsure { border-left-color: #d97706; }
.convert-checks.is-bad { border-left-color: #dc2626; }
.convert-checks ul { list-style: none; margin: 0; padding: 0; line-height: 1.8; }
.convert-checks li.ok { color: #166534; } .convert-checks li.bad { color: #b91c1c; font-weight: 600; } .convert-checks li.unsure { color: #92400e; }
.convert-text { white-space: pre-wrap; max-height: 420px; overflow: auto; background: #f8fafc; padding: 12px; border-radius: 8px; }

/* Clients → Import: a VAT workbook's sheets checked in a pop-up before anything is saved */
dialog.wb-pop {
    width: min(1240px, 96vw); height: 94vh; max-height: none; max-width: none; padding: 0; border: 0;
    border-radius: 18px; background: var(--bg, #f5f7fb); box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
}
dialog.wb-pop[open] { display: flex; flex-direction: column; }
dialog.wb-pop::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.wb-pop-head { padding: 18px 64px 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.wb-pop-head h2 { margin: 0; }
.wb-pop-head p { margin: 4px 0 0; color: var(--muted); }
.wb-pop form.wb-pop-form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.wb-pop-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px; }
.wb-pop-foot { padding: 14px 24px; background: #fff; border-top: 1px solid var(--line); flex-wrap: wrap; }
/* The same step inside the import window */
.wb-inline .wb-pop-head { padding: 0 0 12px; background: none; border: 0; }
/* Here the window itself scrolls: the sheets' box must not catch the wheel (a box set to scroll, with nothing to
   scroll and overscroll-behavior: contain, swallows it in Chrome), so the wheel moves the window unless the pointer
   is over a sheet's preview. */
.wb-inline .wb-pop-body { padding: 0; overflow: visible; overscroll-behavior: auto; }
.wb-inline .wb-pop-foot { position: sticky; bottom: 0; z-index: 2; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; }
/* Tidying a workbook sheet before import: a picked block, and deleted rows/columns (left out of the import) */
.wb-preview td.is-picked, .wb-preview th.is-picked { background: #dbeafe !important; }
.wb-preview td.is-gone, .wb-preview th.is-gone { color: #94a3b8; text-decoration: line-through; background: #f8fafc; }
.wb-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; font-size: .88rem; }
.wb-gone-note { margin: 8px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wb-preview th[data-c] { cursor: s-resize; user-select: none; }

/* The icons under a client's name (edit the client, assign work), on every client tab. */
.client-icons { display: flex; gap: 6px; margin-top: 4px; }
.client-icons { align-items: center; }
.client-team { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: #64748b; margin-left: 4px; }
/* Under the client tabs: the tab's own notes on the left, its buttons on the right, on one line. */
.client-actions-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.client-actions-lead { flex: 1; min-width: 0; }
.client-actions-lead .saved-filters { margin: 0; }
.client-actions-row .actions { margin-left: auto; }

/* Client tabs: one calm white bar of rounded buttons, each with its icon. Dark, easy-to-read labels; the open tab is solid teal. */
nav.tabs.file-tabs { flex-wrap: wrap; overflow: visible; box-shadow: var(--shadow); gap: 6px; padding: 7px; margin: -6px 0 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
/* Search this client: a smooth rounded box at the far end of the tabs bar (full width on its own row on a phone). */
nav.tabs.file-tabs .client-search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: 230px; max-width: 100%; padding: 0 14px; height: 36px;
    border: 1px solid #d7dfe8; border-radius: 999px; background: #f6f8fa; transition: border-color .15s, background .15s, box-shadow .15s; }
nav.tabs.file-tabs .client-search .icon { flex: none; color: #64748b; }
nav.tabs.file-tabs .client-search input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; outline: 0; padding: 0; margin: 0; height: auto; font-size: .92rem; color: #334155; }
nav.tabs.file-tabs .client-search:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 40, 74, .15); }
@media (max-width: 700px) { nav.tabs.file-tabs .client-search { width: 100%; margin-left: 0; } }
/* Each tab is a file tab: its own thin border, rounder top corners than bottom ones. */
nav.tabs.file-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; margin: 0;
    border: 1px solid transparent; border-radius: 8px; background: transparent;
    color: #334155; font-size: .92rem; font-weight: 600; line-height: 1.2; transition: background .15s, color .15s, border-color .15s; }
nav.tabs.file-tabs a .icon { flex: none; color: var(--muted); opacity: 1; }
nav.tabs.file-tabs a:hover { background: #f1f4f9; border-color: transparent; color: var(--brand-dark); }
nav.tabs.file-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
nav.tabs.file-tabs a.active { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: none; }
nav.tabs.file-tabs a.active .icon { color: var(--gold); opacity: 1; }
nav.tabs.file-tabs a.active .tab-count { background: #fff; color: var(--brand-dark); }

/* The calculator: a button in the top bar and a small floating window that can be dragged anywhere. */
.calc { position: fixed; right: 24px; bottom: 24px; z-index: 900; width: 260px; padding: 0 12px 12px; background: #fff; border: 1px solid #cfd8e3;
    border-radius: 16px; box-shadow: 0 12px 40px rgba(15, 23, 42, .22); user-select: none; }
.calc[hidden] { display: none; }
.calc:focus { outline: none; }
.calc-head { display: flex; align-items: center; gap: 8px; padding: 10px 2px 8px; cursor: move; color: var(--muted); font-size: .82rem; font-weight: 700; }
.calc-head .icon { color: var(--brand); }
.calc-head button { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.calc-head button:hover { background: #f1f5f9; color: var(--ink); }
.calc-screen { padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: #f1f6f5; border: 1px solid #d5e5e2; text-align: right; overflow: hidden; }
.calc-sum { min-height: 1.1em; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.calc-value { font: 600 1.7rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink); white-space: nowrap; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-keys button { height: 40px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; }
.calc-keys button:hover { background: #eef2f6; }
.calc-keys .op { color: var(--brand-dark); background: #effaf8; border-color: #cdebe6; }
.calc-keys .fn { color: var(--muted); font-size: .82rem; }
.calc-keys .eq { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border-color: transparent; }
.calc-keys .zero { grid-column: span 2; }

/* The small tabs under Client info and Reports: the pages inside that tab. */
.group-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 18px; padding: 0 4px; }
.group-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #d7dfe8; border-radius: 999px;
    background: #fff; color: #334155; font-size: .86rem; font-weight: 600; }
.group-tabs a .icon { color: var(--brand); }
.group-tabs a:hover { text-decoration: none; background: #effaf8; border-color: #a7dcd4; color: var(--brand-dark); }
.group-tabs a.active { background: #e6f6f3; border-color: var(--brand); color: var(--brand-dark); }
.in-modal .group-tabs { display: none; }

/* The Reports tab's picker: report menu, from, to, lock the dates, Generate, on one white bar. */
.report-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: -6px 0 18px; padding: 14px 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.rp-field { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.rp-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.rp-report { position: relative; flex: 1 1 320px; min-width: 260px; }
.rp-trigger { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 12px; border: 1px solid #cfd8e3; border-radius: 10px;
    background: #fff; color: var(--ink); font: inherit; font-size: 1rem; font-weight: 600; text-align: left; cursor: pointer; }
.rp-trigger:hover { border-color: #a7dcd4; }
.rp-trigger:focus-visible, .rp-trigger[aria-expanded=true] { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 40, 74, .15); }
.rp-trigger.rp-missing { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.rp-trigger-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #effaf8; color: var(--brand); flex: none; }
.rp-trigger-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-chevron { flex: none; color: var(--muted); transition: transform .15s; }
.rp-trigger[aria-expanded=true] .rp-chevron { transform: rotate(180deg); }
.rp-panel { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: min(720px, calc(100vw - 48px)); max-height: min(520px, 70vh); overflow-y: auto;
    padding: 10px; background: #fff; border: 1px solid #cfd8e3; border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); }
.rp-panel[hidden] { display: none; }
.rp-filter { width: 100%; height: 40px; margin: 0 0 8px; padding: 0 12px; border: 1px solid #dfe5ec; border-radius: 9px; background: #f8fafc; font-size: .95rem; }
.rp-filter:focus { outline: none; border-color: var(--brand); background: #fff; }
.rp-group + .rp-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.rp-group-title { padding: 4px 6px 6px; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rp-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px; }
.rp-option { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px; background: none;
    font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.rp-option:hover, .rp-option:focus-visible { outline: none; background: #f4fbfa; border-color: #cdebe6; }
.rp-option[aria-selected=true] { background: #e6f6f3; border-color: var(--brand); }
.rp-option[hidden] { display: none; }
.rp-option-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #effaf8; color: var(--brand); flex: none; }
.rp-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-option-text strong { font-size: .93rem; }
.rp-option-text small { color: var(--muted); font-size: .8rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-none { margin: 8px 6px; }
.report-picker .date-boxes input, .report-picker input[type=date] { height: 46px; }
.report-picker.rp-undated .date-boxes { opacity: .45; }
.rp-field[hidden] { display: none; }
.rp-quarter { flex: 0 1 380px; min-width: 240px; }
.rp-quarter select { height: 46px; }
.rp-go { height: 46px; padding: 0 22px; }
.in-modal .report-picker { display: none; }
.rp-start { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* A plain count on a tab (e.g. how many notes), grey rather than red: nothing is wrong. */
.tab-count.tab-count-info { background: #e2e8f0; color: #334155; }
nav.tabs.file-tabs a.active .tab-count.tab-count-info { background: #fff; color: var(--brand-dark); }

/* Pages and tabs offered under the top search as you type. */
.topsearch-pages { position: absolute; z-index: 80; top: calc(100% + 6px); left: 0; right: 0; padding: 6px; background: #fff; border: 1px solid #cfd8e3;
    border-radius: 12px; box-shadow: 0 14px 36px rgba(15, 23, 42, .16); }
.topsearch-pages[hidden] { display: none; }
.topsearch-page { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.topsearch-page:hover, .topsearch-page.on { text-decoration: none; background: #effaf8; }
.topsearch-page strong { font-size: .92rem; }
.topsearch-page small { color: var(--muted); font-size: .78rem; }
.topsearch-pages-foot { padding: 6px 10px 2px; border-top: 1px solid var(--line); margin-top: 4px; color: var(--muted); font-size: .76rem; }

/* Upload (often in a pop-up): two big choices, files or a folder, then what was chosen. */
.up-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.up-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; text-align: center; cursor: pointer;
    border: 2px dashed #cfd8e3; border-radius: 14px; background: #f8fafc; color: var(--brand); transition: border-color .15s, background .15s; }
.up-choice:hover, .up-choice:focus-within { border-color: var(--brand); background: #f1f4f9; }
.up-choice strong { color: var(--ink, #0f172a); font-size: 1.05rem; }
.up-choice small { color: var(--muted); }
.up-picked { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: #f1f4f9; }
.up-picked strong { margin-right: 10px; }
.up-picked ul { margin: 8px 0 0; padding-left: 18px; }

/* Searchable lists (select[data-search]): the box, its arrow and the app's own dropdown under it. */
.ss-wrap { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; }
.ss-wrap .select-search { flex: 1; min-width: 0; padding-right: 34px; }
.ss-arrow { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px;
    padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.ss-wrap:has(> .ss-add) .ss-arrow { right: 52px; }
.ss-panel { position: fixed; z-index: 1000; min-width: 240px; max-height: 300px; overflow-y: auto;
    margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid #dfe5ec; border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14); }
.ss-panel[hidden] { display: none; }
.ss-panel li { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: .95rem; line-height: 1.3; color: var(--ink, #0f172a); }
.ss-panel li.is-chosen { font-weight: 700; color: var(--brand-dark, #0b1c36); }
.ss-panel li.is-at, .ss-panel li:hover { background: #effaf8; }
/* The blank choice at the top ("Any customer / supplier"): undoes just this filter. */
.ss-panel li.ss-reset { color: var(--muted); font-style: italic; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.ss-panel li.ss-none { color: var(--muted); cursor: default; background: none; font-style: italic; }
.ss-add { flex: none; width: 40px; height: 40px; padding: 0; font-size: 1.2rem; font-weight: 700; }

/* Upload boxes on a client's screens: an Upload button (the Upload window) and From archive, in the drop area. */
.lw-file-hidden { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; overflow: hidden; }
.lw-upload-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; font-size: 1rem; }
.lw-upload-zone { position: relative; }
.lw-upload-zone .archive-from-wrap { margin: 0; }
/* The VAT tally pop-up: the label, the upload box and Tally in one row, centred on each other. */
.tally-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.tally-form .archive-from-wrap { margin: 0; }
.tally-form > .btn { padding: 11px 20px; font-size: 1rem; }
.tally-form:has(.archive-from-wrap) [data-tally-fallback] { display: none; }
.tally-why { list-style: none; margin: 4px 0 6px; padding: 0; }
.tally-why li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dotted #e2e8f0; font-size: .9rem; }
.tally-why strong { white-space: nowrap; }
.lw-upload-zone.is-over, .archive-from-wrap.is-over { background: #e6fffa; border-color: var(--brand); }

/* A count that's just a number of things (files in the Archive), not something to act on: grey, not red. */
.tab-count.tab-count-neutral { background: #e2e8f0; color: #334155; }
nav.tabs.file-tabs a.active .tab-count.tab-count-neutral { background: #fff; color: var(--brand-dark); }

/* The + Record window: tiles in groups (money in, money out, assets and files), clean white cards with a coloured icon. */
.record-group + .record-group { margin-top: 20px; }
.record-group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.record-group-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.record-group .record-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.record-group .record-tile { position: relative; display: flex; flex-direction: row; align-items: flex-start; gap: 14px; padding: 16px 44px 16px 16px;
    background: #fff; border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.record-group .record-tile:hover { transform: translateY(-1px); border-color: #a7dcd4; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.record-group .record-tile.in:hover { border-color: #86efac; }
.record-group .record-tile.out:hover { border-color: #fca5a5; }
.record-group .record-tile.asset:hover { border-color: #c7d2fe; }
.record-group .record-tile .tile-icon { flex: none; width: 44px; height: 44px; margin: 0; border-radius: 12px; }
.record-tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.record-group .record-tile strong { font-size: 1rem; line-height: 1.3; }
.record-group .record-tile small { font-size: .84rem; line-height: 1.45; color: var(--muted); }
.record-group .record-tile .key { position: absolute; top: 14px; right: 14px; opacity: .7; }
.record-group .record-tile:hover .key { opacity: 1; }

/* A pop-up opened inside another (Upload from an upload box): only the inner window's ✕ shows. */
.lw-modal.has-inner > .lw-modal-x, .lw-modal.has-inner > .lw-modal-nav { visibility: hidden; }

/* Bringing a spreadsheet into a form: the form's fields, each with a drop-down of the sheet's columns, then every row checked. */
.si-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.si-title { display: flex; gap: 14px; align-items: flex-start; flex: 1 1 380px; }
.si-title h2 { margin: 0 0 4px; }
.si-title .hint { margin: 0; }
.si-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #effaf8; color: var(--brand); flex: none; }
.si-icon.ok { margin: 0 auto 10px; width: 54px; height: 54px; border-radius: 50%; background: #dcfce7; color: #15803d; }
.si-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.si-sheet { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.si-sheet select { min-width: 260px; height: 44px; }
.si-header input { width: 110px; height: 44px; }
.si-why { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.si-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.si-field { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.si-field.is-set { border-color: #a7dcd4; background: #f7fdfc; }
.si-field.is-needed { border-color: #fca5a5; background: #fef2f2; }
.si-field label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 700; }
.si-field select, .si-field input { width: 100%; }
.si-fixed { margin-top: 6px; }
.si-req { color: var(--danger); margin-left: 3px; }
.si-missing { color: var(--danger); margin: 10px 0 0; }
.si-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.si-pill { padding: 5px 12px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: .86rem; }
.si-pill.ok { background: #dcfce7; color: #166534; }
.si-pill.bad { background: #fee2e2; color: #991b1b; }
.si-pill.warn { background: #fef3c7; color: #92400e; }
.si-preview tr.si-problem td { background: #fef2f2; }
.si-preview tr.si-warning td { background: #fffbeb; }
.si-preview tr.si-skip td { color: #94a3b8; }
.si-notes { font-size: .82rem; color: #475569; min-width: 200px; }
.si-problem .si-notes { color: #991b1b; }
span.si-ok { display: inline-flex; align-items: center; gap: 4px; color: #15803d; }
.si-fix { width: 100%; min-width: 90px; padding: 5px 8px; border: 1px solid #fca5a5; border-radius: 7px; }
.si-edited { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 4px; border: 2px solid var(--brand, #0b1c36); border-radius: 999px; color: var(--brand, #0b1c36); font-weight: 700; }
.si-raw td, .si-raw th { font-size: .78rem; white-space: nowrap; }
.si-raw tr.si-headrow td { background: #effaf8; font-weight: 700; }
.si-done { text-align: center; padding: 34px 24px; }
.si-done h2 { margin: 0 0 6px; }
.si-cat { display: block; margin-bottom: 3px; border-color: var(--line); }
.si-preview tr.si-problem .si-cat { border-color: #fca5a5; }
.si-apply { display: block; margin-top: 6px; white-space: nowrap; color: var(--brand-dark); border-color: #a7dcd4; background: #effaf8; }

/* Bank import: the bank chosen from the client's list, or a new one with its details. */
.bank-new { margin-top: 8px; }
.bank-new-details { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 8px; margin-top: 8px; }
@media (max-width: 640px) { .bank-new-details { grid-template-columns: 1fr; } }

/* Convert files: the file uploaded, or a link pasted in a large, clear box. */
.convert-card { padding: 26px 28px; }
.convert-card > .field > label, .convert-link > label { font-size: 1rem; }
.convert-or { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.convert-or::before, .convert-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.convert-link-row { position: relative; display: flex; gap: 10px; align-items: center; }
.convert-link-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: flex; }
.convert-link-row input { flex: 1; min-width: 0; height: 56px; padding: 0 16px 0 48px; font-size: 1.02rem; border: 1px solid #cfd8e3; border-radius: 14px;
    background: #f8fafc; transition: border-color .15s, box-shadow .15s, background .15s; }
.convert-link-row input:hover { border-color: #a7dcd4; }
.convert-link-row input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(18, 40, 74, .14); }
.convert-link-row:focus-within .convert-link-icon { color: var(--brand); }
.convert-link-row .btn { height: 56px; padding: 0 22px; border-radius: 14px; font-size: 1rem; }
#convert-link-note { margin-top: 8px; }
#convert-link-note.is-ok { color: #15803d; font-weight: 600; }
#convert-link-note.is-bad { color: var(--danger); }
.convert-card select { height: 50px; border-radius: 12px; }
#convert-go { height: 50px; padding: 0 30px; font-size: 1rem; border-radius: 12px; }
.convert-page-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 12px; border: 1px dashed #a7dcd4; border-radius: 12px; background: #f7fdfc; }
.convert-page-files .hint { flex-basis: 100%; margin: 0 0 2px; }
.convert-page-file { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convert-page-file.is-page { color: var(--muted); }

/* + Record → Record banks: the Bank form. */
.rec-hero.bank .rec-hero-icon { background: linear-gradient(145deg, #E1E7EF, #c7d2fe); color: var(--brand-2); }
.rec-hero.bank h2 { color: #3730a3; }
.bank-entry .be-bank select { height: auto; min-height: 50px; padding: 10px 14px; font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
.be-drop { margin: 6px 0 4px; }
.be-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.be-grid .be-wide { grid-column: span 3; }
.be-grid > .field { min-width: 0; }
.be-grid input, .be-grid select { width: 100%; max-width: 100%; height: auto; min-height: 50px; line-height: 1.4; }
.bank-entry .bank-new input { font-size: 1.05rem; padding: 10px 14px; }
.be-toggle { display: inline-flex; border: 1px solid #cfd8e3; border-radius: 10px; overflow: hidden; min-height: 50px; }
.be-toggle label { margin: 0; cursor: pointer; display: flex; }
.be-toggle label { position: relative; }
.be-grid .be-toggle input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.be-toggle span { display: flex; align-items: center; padding: 0 16px; font-weight: 600; color: #475569; }
.be-toggle label:first-child input:checked + span { background: #fee2e2; color: #991b1b; }
.be-toggle label:last-child input:checked + span { background: #dcfce7; color: #166534; }
.be-toggle input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.be-recent { margin-top: 18px; }
@media (max-width: 760px) { .be-grid { grid-template-columns: 1fr; } .be-grid .be-wide { grid-column: auto; } }
/* "Start over at #1" under the Ref badge: the papers numbered afresh. */
.ref-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.record-top:has(.rec-hero) .ref-wrap { justify-self: start; }
.ref-restart { padding: 3px 10px; border: 1px solid #cfd8e3; border-radius: 999px; background: #fff; color: #475569; font-size: .74rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ref-restart:hover { border-color: var(--brand); color: var(--brand-dark); background: #f1f4f9; }
.be-dir-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* The counts above the rows are buttons: one shows only its rows. */
button.si-pill { border: 1px solid transparent; font: inherit; font-size: .86rem; cursor: pointer; }
button.si-pill:hover { border-color: currentColor; }
button.si-pill.is-on { border-color: currentColor; box-shadow: 0 0 0 2px rgba(15, 23, 42, .08); }
.si-showall { background: #fff; border: 1px solid var(--line); color: #334155; }

/* Notes from the home page (staff-notes/index): people above the text box, "Add date" under it, then the list. */
.note-form textarea { width: 100%; margin: 8px 0; }
.note-people { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-chosen { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.note-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.note-pick[hidden], .note-date [hidden] { display: none; }
.note-date { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.note-date > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.note-item form { margin: 0; }
.note-main { flex: 1; min-width: 0; }
.note-main small { display: block; margin-top: 4px; }
.note-tick { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #cbd5e1; border-radius: 8px; background: #fff; color: transparent; cursor: pointer; }
.note-tick:hover { border-color: var(--brand); color: var(--brand); }
.note-tick.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.note-item.is-done .note-main p { text-decoration: line-through; color: var(--muted); }
.note-files { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.note-files .archive-from-wrap { margin: 0; }
.note-file-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: .88rem; }
.note-file-list li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.note-file-gone { text-decoration: line-through; color: var(--muted); }
.note-thumbs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.note-thumb { width: 64px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; background: #f8fafc; }
.note-lightbox { padding: 0; border: 0; border-radius: 10px; max-width: 94vw; max-height: 92vh; background: transparent; cursor: zoom-out; }
.note-lightbox::backdrop { background: rgba(15, 23, 42, .75); }
.note-lightbox img { display: block; max-width: 94vw; max-height: 92vh; border-radius: 10px; }
.note-thumb-cell { position: relative; display: inline-block; }
.note-thumb-x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border: 0; border-radius: 99px; background: var(--status-critical); color: #fff;
    font-size: 14px; line-height: 20px; padding: 0; cursor: pointer; box-shadow: 0 0 0 2px #fff; }
.note-file-x { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.note-file-x:hover { color: var(--status-critical); }
/* The note box, like a chat: the text, the pictures waiting to go with it, and Attach, all inside one border. */
.note-composer { border: 1px solid #cfd8e3; border-radius: 12px; background: #fff; margin: 8px 0; }
.note-composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 40, 74, .12); }
.note-form .note-composer textarea { border: 0; margin: 0; box-shadow: none; background: transparent; resize: vertical; }
.note-form .note-composer textarea:focus { outline: none; box-shadow: none; }
.note-composer .note-thumbs { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 12px; }
.note-composer .note-thumbs:not(:empty) { padding: 8px 12px; }
.note-composer-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-top: 1px solid var(--line); }
.note-file-chip { display: inline-flex; align-items: center; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; font-size: .85rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-pick-clients { display: block; }
.note-pick-clients input[type=search] { width: 100%; margin-bottom: 8px; }
.note-pick-list { display: flex; flex-wrap: wrap; gap: 6px 16px; max-height: 220px; overflow-y: auto; }
.note-pick-list label[hidden] { display: none; }
/* The number of each attached file (1, 2, 3…), on its small picture and in the list under the note. */
.note-thumb-n { position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: rgba(15, 23, 42, .78); color: #fff;
    font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; pointer-events: none; }
.note-file-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e2e8f0; color: #334155; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.note-lightbox-x { position: fixed; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 99px; background: #fff; color: #0f172a; font-size: 24px; line-height: 40px; cursor: pointer; box-shadow: 0 4px 14px rgba(15, 23, 42, .3); }
/* A file that isn't a picture: its full name (wrapping if long), with its number in front, not on top of it. */
.note-file-chip { height: auto; min-height: 48px; max-width: 460px; padding: 6px 12px 6px 30px; white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; line-height: 1.3; }
.note-thumb-cell:has(.note-file-chip) .note-thumb-n { left: 6px; top: 50%; bottom: auto; transform: translateY(-50%); }
.note-composer-bar { flex-wrap: wrap; align-items: flex-start; }
.note-composer-bar .archive-from-wrap { flex: 1 1 auto; }
.note-composer-bar > .hint { align-self: center; white-space: nowrap; }
/* Notes: optional title, and the tick box for "Delete ticked". */
.note-title-input { width: 100%; margin-bottom: 6px; font-weight: 600; }
.note-title { display: block; margin-bottom: 2px; }
.note-number { color: var(--muted, #64748b); font-weight: 600; margin-right: 4px; }
.note-pick-box { flex: 0 0 16px; margin-top: 7px; }
/* A button's counter at nought: kept in its place, in grey. */
.btn-count.is-zero { background: var(--muted); }
/* Sheet import: a row with no date, imported to Needs attention. */
.si-preview tr.si-undated td { background: #fff7ed; }
.si-undated .si-notes { color: #9a3412; }

/* "Paid?" on an entry: through the bank, by the director personally, or not paid yet */
.paid-how { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.paid-how .check { margin: 0; }

/* Client info → Directors: a name with its button on one line */
.director-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.director-add input[type=text] { flex: 1; min-width: 200px; max-width: 360px; }

/* "Which director paid it?": each director with their part on one line */
.dir-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.dir-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.dir-row input.num { width: 140px; text-align: right; }
.dir-summary a { font-weight: 600; }
p.is-ok { color: #15803d; }

/* A ledger in parts: one button per director */
.report-switch { flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
/* Entries made from a bank line (Bank tab: Create entry, Add, or the conversion): blue, with a "From bank" tag. */
tr.row-from-bank td { background: #eef5ff; }
.badge-bank { background: #dbeafe; color: #1e40af; }

/* A long customer / supplier name: its start, click to open the whole text. */
.long-name summary { cursor: pointer; }
.long-name[open] summary { color: var(--muted, #6b7280); font-weight: normal; }

/* A category list inside a right-aligned actions cell (Bank tab): its choices read left to right like everywhere else. */
td.rec-actions .ss-wrap, td.rec-actions .ss-panel, td.rec-actions .select-search { text-align: left; }

/* Bank tab: the same width for every row's buttons, so the category lists line up down the page ("Add" / "Add the rest", "Match" / "See"). */
.bank-add .ss-wrap, .bank-add select { width: 220px; }
.bank-add-btn { min-width: 104px; }
.bank-match-btn { min-width: 64px; text-align: center; }

/* Reports: a dotted line runs from a label to its figure so the eye can follow the row. */
td.leader { overflow: hidden; white-space: nowrap; }
td.leader .leader-text::after { content: ""; display: inline-block; width: 100%; margin-right: -100%; margin-left: 8px; border-bottom: 1px dotted currentColor; opacity: .5; vertical-align: middle; }
/* The figure's cell carries the dots on until just before the amount. */
td.num.leader .leader-text::after { content: none; }
td.num.leader .leader-text::before { content: ""; display: inline-block; width: 100%; margin-left: -100%; margin-right: 6px; border-bottom: 1px dotted currentColor; opacity: .5; vertical-align: middle; }
td.leader:first-child { padding-right: 0; }
td.num.leader { padding-left: 0; }

/* Bank tab: cells edited in place, and sortable headings. */
td.cell-edit { cursor: text; }
td.cell-edit:hover { outline: 1px dashed var(--border, #cbd5e1); outline-offset: -3px; }
td.cell-saved { background: #dcfce7; transition: background .4s; }
.cell-input { width: 100%; min-width: 90px; padding: 4px 6px; font: inherit; text-align: inherit; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link.on { text-decoration: underline; }
/* Import screen: a minus amount (credit note or refund) highlighted to check. */
.si-neg { background: #facc15 !important; font-weight: 700; }

/* Entry and its bank line: a calm grey note, not a red warning. */
.flag.flag-note { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
/* Duplicate buttons: a clearer border. */
.btn.btn-outlined { border: 1.5px solid #64748b; }
/* Bulk Accept: each match's percentage, green when it's a full match. */
.ba-pct { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 9px; background: #fef3c7; color: #92400e; font-size: .75rem; font-weight: 700; }
.ba-pct.is-full { background: #dcfce7; color: #166534; }
table.bulk-accept td { vertical-align: top; }
/* Bulk Accept: a clear line between each pair, and a matched row shaded green. */
table.bulk-accept tr.ba-row td { border-bottom: 2px solid #94a3b8; }
table.bulk-accept tr.ba-row.is-matched td { background: #f0fdf4; }
.ba-match { min-width: 64px; font-size: 1rem; }
.undo-match { padding: 0 7px; line-height: 1.4; font-size: .9rem; }
tr.col-totals th { font-size: .8rem; color: #334155; text-transform: none; letter-spacing: 0; padding-top: 0; }
table.bulk-accept { width: 100%; }
.si-neg .amt-cell { background: #facc15; font-weight: 700; }
.vat-cell .rate-odd { font-weight: 700; color: #0f172a; }
/* The client app's routine "please check" flag: yellow, not red (red is kept for duplicates and bad dates). */
.flag-btn.is-flagged.is-mild { background: #f59e0b; border-color: #f59e0b; }
.flag-why.mild { border-left-color: #f59e0b; background: #fffbeb; color: #78350f; }
.badge-mild { background: #fef3c7; color: #92400e; }
/* Phone app state icon (Users and Clients lists): amber = invited, green = signed in. */
.app-state { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; gap: 1px; }
.app-state.app-invited { background: #fef3c7; border-color: #f59e0b; }
.app-state.app-in-use { background: #dcfce7; border-color: #16a34a; }
.app-arrow { font-size: 11px; color: #b45309; }

/* Money in is green, money out is red, on the Reconciliation screen. */
.amt-in { color: #16a34a; font-weight: 600; }
.amt-out { color: var(--danger); font-weight: 600; }
