/*
    EcolEx web — mobile first.

    The Android app is the reference: a blue/red identity, card lists rather than dense
    tables, touch-sized targets, and a tab bar pinned to the bottom of the screen. That
    layout is the base here; the desktop breakpoint promotes the tab bar to a sidebar and
    lets cards spread into a grid. Nothing is designed table-first and then squeezed.
*/

:root {
    /* Sampled from wwwroot/img/voltora-logo.png rather than eyeballed, so the UI and
       the logo cannot drift apart. */
    --blue: #0050CE;
    --blue-dark: #001A4F;
    --blue-tint: #e9f0fd;
    /* The logo has no red: green is the accent, bolt blue the highlight. A separate
       alert colour stays for genuinely bad numbers, which should not wear the brand. */
    --green: #01C081;
    --blue-bright: #1580FD;
    --green-action: #00875A;
    --green-action-hover: #007049;
    --alert: #c8102e;
    --ink: #10192b;
    --muted: #64748b;
    --line: #e3e9f0;
    --bg: #f4f7fb;
    --card: #ffffff;
    --ok: #01A06C;
    --warn: #b7791f;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 32, 54, .06), 0 6px 20px rgba(16, 32, 54, .06);
    --drawer: 250px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

/* ── App shell ─────────────────────────────────────────────────────────── */

.app-header {
    background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: #fff;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.app-header .eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.app-header h1 { font-size: 21px; margin-top: 2px; }
.app-header .who { font-size: 12px; opacity: .85; margin-top: 3px; }

.wrap { padding: 14px 14px 28px; max-width: 1200px; margin: 0 auto; }

/* ── Cards and tiles ───────────────────────────────────────────────────── */

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: 12px;
}
.card h2 { font-size: 15px; margin-bottom: 10px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.tile {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 13px 14px;
    border-left: 4px solid var(--blue);
}
.tile.red { border-left-color: var(--alert); }
.tile.green { border-left-color: var(--ok); }
.tile .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.tile .value { font-size: 21px; font-weight: 700; margin-top: 3px; }

/* ── Row lists: the mobile pattern, not a table ────────────────────────── */

.row-list { display: flex; flex-direction: column; gap: 9px; }
.row-item {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 13px;
    display: block;
    color: inherit;
    border-left: 3px solid transparent;
}
.row-item .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row-item .title { font-weight: 650; }
.row-item .amount { font-weight: 700; color: var(--blue-dark); white-space: nowrap; }
.row-item .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.row-item .meta span + span::before { content: " · "; }

.pill {
    display: inline-block; font-size: 11px; font-weight: 650;
    padding: 2px 8px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-dark);
}
.pill.ok { background: #e6f6ed; color: var(--ok); }
.pill.warn { background: #fdf3e2; color: var(--warn); }
.pill.bad { background: #fdeaec; color: var(--alert); }

/* ── Forms ─────────────────────────────────────────────────────────────── */

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
input[type=text], input[type=password], input[type=search], input[type=date],
input[type=tel], input[type=email], input[type=number], input[type=url], input:not([type]), select {
    width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fbfcfe; color: var(--ink);
    font-size: 16px; /* 16px keeps iOS from zooming the page on focus */
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; background: #fff; }

.btn {
    display: inline-block; width: 100%; padding: 13px 16px; border: 0; border-radius: 10px;
    background: var(--blue); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
    text-align: center;
}
.btn.secondary { background: var(--blue); }
.btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }

.filters { display: grid; grid-template-columns: 1fr; gap: 9px; }

.alert { padding: 11px 13px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; }
.alert.error { background: #fdeaec; color: #8d0212; border: 1px solid #f6c9cf; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty .big { font-size: 30px; opacity: .35; }


/* ── Login ─────────────────────────────────────────────────────────────── */

.login-hero {
    background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: #fff; padding: 44px 22px 70px;
}
.login-hero .eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.login-hero h1 { font-size: 32px; margin-top: 4px; }
.login-card { margin: -46px 16px 0; }

/* ── Desktop ───────────────────────────────────────────────────────────── */

@media (min-width: 900px) {
    /* minmax(0, 1fr): the work column may shrink below its widest content (a long tab strip, a
       wide table), which then scrolls inside itself — a bare 1fr widened the whole page instead. */
    body.app { display: grid; grid-template-columns: var(--drawer) minmax(0, 1fr); min-height: 100vh; }
    body.app .app-header { grid-column: 2; }
    body.app .wrap { grid-column: 2; padding-bottom: 28px; }


    .tiles { grid-template-columns: repeat(4, 1fr); }
    .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
    .row-list.two { display: grid; grid-template-columns: 1fr 1fr; }
}


/* ── Financial year picker (in the header) ─────────────────────────────── */

.header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.fy { flex: 0 0 auto; text-align: right; }
.fy label {
    display: block; color: #fff; opacity: .72; margin-bottom: 4px;
    font-size: 10px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600;
}
.fy select {
    width: auto; min-width: 132px; padding: 7px 10px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff; font-size: 14px; font-weight: 650; border-radius: 9px;
}
/* The dropdown itself renders in the OS palette, so its options need dark text. */
.fy select option { color: var(--ink); background: #fff; }
.fy select:focus { outline: 2px solid #fff; outline-offset: 1px; }

.fy-single {
    color: #fff; font-weight: 700; font-size: 15px;
    padding: 6px 10px; border-radius: 9px;
    background: rgba(255, 255, 255, .14);
}

@media (max-width: 420px) {
    .fy select, .fy-single { min-width: 0; font-size: 13px; }
    .app-header h1 { font-size: 19px; }
}

/* ── Sign-in ───────────────────────────────────────────────────────────── */

.signin { max-width: 440px; margin: 0 auto; }

.signin-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(155deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: #fff; padding: 40px 22px 62px; border-radius: 0 0 22px 22px;
}
/* The circuit trace sits behind the wordmark, faint enough to read as texture. */
.signin-hero .trace {
    position: absolute; inset: 0; width: 100%; height: 100%;
    color: #fff; opacity: .13; pointer-events: none;
}

.signin-brand { position: relative; display: flex; align-items: center; gap: 13px; }
.signin-brand h1 { font-size: 30px; letter-spacing: -.025em; line-height: 1.05; }
.signin-brand .descriptor {
    font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
    opacity: .82; margin-top: 3px; font-weight: 600;
}
.signin-hero .tagline {
    position: relative; margin: 16px 0 0; font-size: 13.5px; opacity: .8; max-width: 30em;
}

.signin-card { margin: -40px 16px 0; position: relative; }
.signin-card .field { margin-bottom: 13px; }
.signin-card .field:last-of-type { margin-bottom: 18px; }

/* What the system covers — reads as capability, not navigation, so it is not linked. */
.modules {
    list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
    gap: 6px; padding: 18px 16px 0; margin: 0;
}
.modules li {
    font-size: 11.5px; font-weight: 650; color: var(--blue-dark);
    background: #fff; border: 1px solid var(--line);
    padding: 5px 11px; border-radius: 999px;
}

.signin-foot {
    text-align: center; color: var(--muted); font-size: 11.5px;
    margin: 16px 0 26px;
}

@media (min-width: 900px) {
    .signin { padding-top: 34px; }
    .signin-hero { border-radius: 22px; }
    .signin-card { margin: -40px 22px 0; }
}

/* ── Brand mark and sign-in banner ─────────────────────────────────────── */

/* The logo is artwork on white, so on the dark hero it sits on its own light plate
   rather than being knocked out — recolouring a bitmap is not an option. */
.logo-plate {
    flex: 0 0 auto; background: #fff; border-radius: 14px; padding: 7px;
    box-shadow: 0 5px 18px rgba(0, 26, 79, .34); line-height: 0;
}
.logo-plate img { display: block; }

/* The banner replaces the old loose traces: same role, but it draws the actual
   manufacturer → dealer → retailer fan-out rather than abstract lines. */
.signin-hero .banner {
    position: absolute; inset: 0; width: 100%; height: 100%;
    color: #fff; opacity: .16; pointer-events: none;
}


/* ── Navigation drawer ─────────────────────────────────────────────────── */
/*
   Off-canvas on a phone, persistent rail on desktop. A dark rail because the nav is
   chrome, not content: it recedes and lets the white cards carry the data.
*/

.drawer {
    position: fixed; inset: 0 auto 0 0; width: var(--drawer); z-index: 40;
    background: var(--blue-dark);
    display: flex; flex-direction: column;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-100%);
    transition: transform .22s ease;
}
.drawer-open .drawer { transform: none; }

.scrim {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(6, 20, 42, .5);
}

/* The logo on white keeps the mark's own contrast against the dark rail. */
.drawer-logo {
    background: #fff; border-radius: 13px; padding: 12px 14px; margin-bottom: 12px;
}
/* The lockup is wide and short, so it is sized by width and left to keep its ratio. */
.drawer-logo img { display: block; width: 100%; height: auto; }

/* Which company you are in — glanceable, and the switch affordance is visible. */
.workspace {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px; padding: 9px 11px; margin-bottom: 14px;
    color: #fff;
}
.workspace .avatar {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
    background: #e8b923; color: #3a2c00;
    display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
}
.workspace .ws-text { flex: 1 1 auto; min-width: 0; display: block; }
.workspace strong {
    display: block; font-size: 12.5px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.workspace small { display: block; font-size: 11px; opacity: .68; }
.workspace .ico { flex: 0 0 auto; opacity: .55; width: 16px; height: 16px; }

.nav { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; }
.nav > li { margin-bottom: 1px; }

/* Top-level rows and group headers share one look. */
.nav a,
.nav summary {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 11px; border-radius: 10px;
    color: rgba(255, 255, 255, .8); font-size: 13.5px; font-weight: 600;
    cursor: pointer; user-select: none;
}
.nav summary { list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.nav a.on {
    background: #fff; color: var(--blue-dark); font-weight: 700;
}
.nav a.on .ico { color: var(--green); }

.nav .chev {
    margin-left: auto; width: 15px; height: 15px; opacity: .5;
    transition: transform .18s ease;
}
.nav details[open] > summary .chev { transform: rotate(90deg); }
.nav details[open] > summary { color: #fff; }

/* Child links indent under the group's icon rather than its text. */
.nav details ul { list-style: none; margin: 2px 0 6px; padding: 0 0 0 30px; }
.nav details ul a { padding: 8px 11px; font-size: 13px; font-weight: 600; }

.drawer-foot { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 10px; margin-top: 8px; }
.drawer-foot button {
    display: flex; align-items: center; gap: 11px; width: 100%;
    background: none; border: 0; cursor: pointer;
    padding: 10px 11px; border-radius: 10px;
    color: rgba(255, 255, 255, .72); font: inherit; font-size: 13.5px; font-weight: 600;
}
.drawer-foot button:hover { background: rgba(255, 255, 255, .07); color: #fff; }

/* ── Header: burger + title + year ─────────────────────────────────────── */

.app-header .header-top { align-items: center; gap: 12px; }
.header-title { flex: 1 1 auto; min-width: 0; }

.burger {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .2);
    display: grid; place-content: center; gap: 4px; cursor: pointer; padding: 0;
}
.burger span { display: block; width: 17px; height: 2px; background: #fff; border-radius: 2px; }

@media (min-width: 900px) {
    /* Persistent rail: no transform, no scrim, no burger. */
    .drawer { position: sticky; top: 0; height: 100vh; transform: none; grid-row: 1 / span 2; grid-column: 1; }
    .scrim { display: none; }
    .burger { display: none; }
}

/* ── ERP density layer ─────────────────────────────────────────────────── */
/*
   The card/phone styles above still serve the small breakpoint. From here down is the
   desk layer: compact tiles, real tables, modals and key chips. See the voltora-ui skill.
*/

.bar {
    display: flex; align-items: center; gap: 10px; justify-content: flex-end;
    margin-bottom: 10px;
}
.bar-note { margin-right: auto; font-size: 12px; color: var(--muted); }

/* Action buttons: the logo green, deepened. White on the logo's own #01C081 is
   about 2.3:1 and unreadable at 13px; #00875A is the same hue at about 4.6:1. */
.btn.green {
    width: auto; background: var(--green-action); color: #fff; padding: 8px 14px;
    font-size: 13px; border-radius: 7px; display: inline-flex; align-items: center; gap: 8px;
}
.btn.green:hover { background: var(--green-action-hover); }

/* Key chips: always visible on primary actions, revealed elsewhere while Alt is held. */
kbd {
    font: 600 10.5px/1 "Segoe UI", system-ui, sans-serif;
    background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 4px; padding: 3px 5px; letter-spacing: .03em;
}
.btn.ghost kbd, .lnk kbd { background: var(--blue-tint); border-color: var(--line); color: var(--blue-dark); }

/* Stat tiles: label, number, meaning. */
.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 8px; margin-bottom: 12px;
}
.stat {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 10px 12px;
}
.stat .k { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat .v {
    font-size: 22px; font-weight: 700; margin: 2px 0 1px;
    font-variant-numeric: tabular-nums; color: var(--blue-dark);
}
.stat .s { font-size: 11.5px; color: var(--muted); }
/* A tile reporting a data problem, with its consequence on the third line. */
.stat.warn { border-color: #d8a72a; background: #fffdf6; }
.stat.warn .v { color: #8a6100; }

/* Panels */
.panel {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 12px 14px; margin-bottom: 10px;
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { font-size: 14.5px; margin-right: auto; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.panel-actions label { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.panel-actions select { width: auto; padding: 7px 9px; font-size: 13px; border-radius: 7px; }
.panel-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.lnk { font-size: 12.5px; font-weight: 600; }

.split { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 1000px) { .split { grid-template-columns: 3fr 2fr; } }

/* Tables: dense, hairline rules, tabular numbers, no zebra. */
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th {
    text-align: left; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted); font-weight: 700; padding: 6px 8px;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid th.num, .grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td { padding: 7px 8px; border-bottom: 1px solid #f1f4f8; vertical-align: top; }
.grid tbody tr:hover { background: #f7faff; }
.grid td .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.grid td.bad { color: var(--alert); font-weight: 650; }
.grid td.good { color: var(--ok); font-weight: 650; }
.field .static { min-height: 34px; display: flex; align-items: center; font-size: 13px; color: var(--muted); }
.grid a { font-weight: 650; }

/* Sortable headers */
.grid th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.grid th a .caret { font-size: 9px; opacity: .85; }
.grid th a:hover { color: var(--blue); }

/* Pager */
.pager {
    display: flex; align-items: center; gap: 8px; padding-top: 9px; font-size: 12.5px;
    color: var(--muted);
}
.pager .range { margin-right: auto; }
.pager a, .pager span.off {
    border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
    color: var(--blue-dark); font-weight: 600;
}
.pager span.off { opacity: .38; }
.pager select { width: auto; padding: 5px 8px; font-size: 12.5px; border-radius: 6px; }

/* ── Tabs, toolbar, modals ─────────────────────────────────────────────
   The masters screen is the reference for every list in the product: a tab
   strip with counts, a one-line toolbar, a dense table, a pager, and a modal
   for the create form. See the voltora-ui skill. */

.tabs {
    display: flex; gap: 2px; align-items: flex-end;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px; overflow-x: auto;
}
.tabs a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; font-size: 13px; font-weight: 650;
    color: var(--muted); text-decoration: none; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--blue); background: var(--blue-tint); }
.tabs a.on { color: var(--blue-dark); border-bottom-color: var(--blue); }
.tabs a .count {
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
    background: #eef2f8; color: var(--muted);
    border-radius: 20px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.tabs a.on .count { background: var(--blue); color: #fff; }

.toolbar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px; flex-wrap: wrap;
}
.toolbar input[type=search] {
    width: 240px; margin: 0; padding: 7px 10px;
    font-size: 13px; border-radius: 7px;
}
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .note { font-size: 11.5px; color: var(--muted); }
.toolbar .note.dim { opacity: .7; font-style: italic; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 7px; }

.panel.tight { padding: 0; overflow: hidden; }
.panel.tight .pager { padding: 8px 12px; border-top: 1px solid var(--line); margin: 0; }
.scroll-x { overflow-x: auto; }

.grid td.code, .grid th.w-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.grid th.w-code { font-family: inherit; }
.grid th.w-status { width: 90px; }

.alert.ok { background: #e7f8f1; color: #0a6647; border: 1px solid #b8ead7; }

/* A button wears its key permanently — that is how the key gets learnt. Chips on
   tabs and the pager would crowd a strip that is mostly labels, so those collapse
   until Alt is held. Collapsed, not display:none: a screen reader still reads them. */
.btn kbd { margin-left: 6px; opacity: .78; }

.tabs kbd, .pager kbd {
    opacity: 0; max-width: 0; margin: 0; padding: 0;
    border-width: 0; overflow: hidden; white-space: nowrap;
    transition: opacity .12s;
}
body.show-keys .tabs kbd, body.show-keys .pager kbd {
    opacity: .85; max-width: 7em; margin-left: 5px; padding: 3px 5px; border-width: 1px;
}

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal { display: none; }
.modal[open] {
    display: flex; position: fixed; inset: 0; z-index: 60;
    align-items: flex-start; justify-content: center;
    padding: 6vh 16px 16px;
    background: rgba(0, 26, 79, .42);
    overflow-y: auto;
}
body.modal-open { overflow: hidden; }

.modal-panel {
    background: #fff; border-radius: 10px; width: 100%; max-width: 420px;
    box-shadow: 0 24px 60px rgba(0, 26, 79, .3);
}
.modal-panel.wide { max-width: 760px; }
.modal-head {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 14.5px; margin: 0 auto 0 0; color: var(--blue-dark); }

.modal .fields { padding: 14px; display: grid; gap: 12px 14px; }
.modal .fields.three { grid-template-columns: repeat(3, 1fr); }
.modal .field { margin: 0; min-width: 0; }
.modal .field.span2 { grid-column: span 2; }
.modal .field label {
    display: block; font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); margin-bottom: 4px;
}
.modal .field label em {
    font-style: normal; font-size: 9.5px; letter-spacing: .07em;
    color: #b07e0a; margin-left: 5px;
}
.modal .field input, .modal .field select {
    width: 100%; margin: 0; padding: 7px 9px; font-size: 13px; border-radius: 7px;
}
.modal .field small {
    display: block; margin-top: 4px; font-size: 11.5px;
    color: var(--muted); line-height: 1.45;
}
.modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 14px; border-top: 1px solid var(--line); background: #fafbfd;
    border-radius: 0 0 10px 10px;
}

@media (max-width: 720px) {
    .modal .fields.three { grid-template-columns: 1fr; }
    .modal .field.span2 { grid-column: auto; }
    .toolbar input[type=search] { width: 100%; }
}

/* The base .btn is full-width because the phone views stack their actions; on a
   toolbar or a modal footer a button is sized by its label. */
.toolbar .btn, .modal-head .btn, .modal-foot .btn, .panel-actions .btn { width: auto; }
.toolbar input[type=search] { flex: 0 0 240px; }

/* ── Sign-in: the split screen ─────────────────────────────────────────
   Left is the client's finished artwork, shown as one image. Right is the
   part people actually use every morning, so it is the plain, fast half:
   two fields, one button, focus already in the first field. The card
   background is #F5FAFE because that is the artwork's own card colour —
   sampled, so the logo crop sits on it without a seam. */

body.auth { background: #eaf3fc; }
body.auth .wrap { max-width: none; padding: 0; }

/* Full-bleed light sky, a rising blue-to-green arrow, headline left, floating card right. */
.lg {
    --card-col: 0px;   /* the card's column on wide screens; 0 when only the card shows */
    position: relative; overflow: hidden;
    min-height: 100vh; min-height: 100dvh;   /* dvh: the visible height, phone address bar excluded */
    display: grid; grid-template-columns: 1fr;
    background:
        radial-gradient(ellipse 60% 55% at 72% 28%, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, 0) 70%),
        linear-gradient(115deg, #f7fbff 0%, #e8f2fc 42%, #c4ddf5 78%, #a9cdef 100%);
}
.lg-bg { position: absolute; inset: 0; pointer-events: none; }
/* Each drawing fills a box and "meet" fits it inside, keeping its proportions. */
.lg-city { position: absolute; right: 0; bottom: 0; width: 46%; height: 58%; }
.lg-arrow {
    position: absolute; bottom: 0; height: 88%;
    right: calc(var(--card-col) - 60px);
    width: calc((100% - var(--card-col)) * .56);
}
.lg-scene {
    position: absolute; bottom: 3%; right: calc(var(--card-col) + 2%);
    width: min(40vw, 760px); height: auto;   /* height follows width: never stretched */
    filter: drop-shadow(0 30px 40px rgba(0, 26, 79, .25));
}

.lg-hero { display: none; position: relative; flex-direction: column; padding: 56px 40px 44px 80px; }
/* Width and height both auto with two caps, so a short window shrinks it evenly. */
.lg-logo { width: auto; height: auto; max-width: min(470px, 90%); max-height: 24vh; margin-left: -8px; align-self: flex-start; }
.lg-kicker { font-size: 34px; font-weight: 400; color: var(--blue-dark); margin: 34px 0 0; line-height: 1.2; }
.lg-title { font-size: 52px; font-weight: 800; color: var(--blue-dark); margin: 4px 0 0; line-height: 1.08; letter-spacing: -.01em; }
.lg-punch { font-size: 40px; font-weight: 800; color: #10b877; margin: 8px 0 0; line-height: 1.15; }

.lg-features { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 34px 0 0; padding: 0; }
.lg-features li {
    display: flex; align-items: center; gap: 10px; padding: 0 18px;
    font-size: 17px; font-weight: 500; color: var(--blue-dark);
    border-left: 1px solid rgba(0, 26, 79, .18);
}
.lg-features li:first-child { padding-left: 0; border-left: 0; }
.lg-features svg {
    width: 32px; height: 32px; fill: none; stroke: var(--blue);
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.lg-motto {
    margin: auto 0 0; padding-top: 40px; font-size: 15px; font-weight: 500;
    letter-spacing: .34em; text-transform: uppercase; color: var(--blue-dark);
}
.lg-motto span { margin: 0 .5em; color: var(--green); }

.lg-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.lg-card {
    background: #fff; border-radius: 24px; padding: 26px 30px 22px;
    box-shadow: 0 24px 60px rgba(0, 26, 79, .16), 0 2px 6px rgba(0, 26, 79, .06);
}
/* voltora-logo-erp.png is voltora-logo-card.png with its #F5FAFE ground made transparent. */
.lg-card .auth-logo { margin-bottom: 18px; }
.lg-card h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.lg-sub { color: var(--muted); font-size: 15.5px; margin: 0 0 24px; }

.auth-card { width: 100%; max-width: 470px; position: relative; }

.region {
    display: flex; align-items: center; justify-content: flex-end; gap: 7px;
    margin: 0 0 12px; font-size: 14px; color: var(--blue-dark); font-weight: 500;
}
.region .ico { width: 18px; height: 18px; }

.auth-logo { display: block; width: 100%; max-width: 290px; height: auto; margin: 0 0 22px; }
.auth-card h1 { font-size: 20px; font-weight: 600; color: var(--blue-dark); margin: 0 0 18px; }
.auth-copy { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 22px; }

/* One bordered line per field, icon inside it. The placeholder carries the
   label visually; a real label stays for screen readers. */
.input-line {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid #d5dfeb; border-radius: 10px;
    background: #fff; padding: 0 16px; margin-bottom: 12px; height: 52px;
}
.input-line:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 80, 206, .1); }
.input-line .lead-ico { color: var(--blue-dark); display: flex; flex: 0 0 auto; }
.input-line .lead-ico .ico { width: 21px; height: 21px; }
.input-line input {
    flex: 1 1 auto; width: 100%; border: 0; background: transparent;
    padding: 0; height: 100%; font-size: 15.5px;
}
.input-line input:focus { outline: none; }
.input-line .reveal {
    flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
    color: var(--muted); padding: 4px; display: flex; border-radius: 6px;
}
.input-line .reveal:hover, .input-line .reveal.on { color: var(--blue); }

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

.auth-row {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 0 22px;
}
.remember {
    display: flex; align-items: center; gap: 10px; margin: 0;
    font-size: 14.5px; color: var(--ink); font-weight: 500;
}
.remember input { width: 19px; height: 19px; margin: 0; accent-color: var(--blue); }
.forgot { font-size: 14.5px; font-weight: 500; }
.forgot:hover { text-decoration: underline; }

/* The one gradient in the product, and it earns it: the button every user
   presses first, every day. */
.btn.auth-go {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 52px; padding: 0 16px; border-radius: 10px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%);
    font-size: 17px; font-weight: 600; letter-spacing: .01em;
}
.btn.auth-go:hover { filter: brightness(1.06); }

.or {
    display: flex; align-items: center; gap: 18px;
    margin: 18px 0; color: var(--muted); font-size: 13px;
}
.or::before, .or::after { content: ""; flex: 1 1 auto; height: 1px; background: #d5dfeb; }

.btn.sso {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 52px; background: #fff; color: var(--blue-dark);
    border: 1px solid #d5dfeb; border-radius: 10px; font-size: 16px; font-weight: 500;
}
.btn.sso .ico { color: var(--blue); width: 22px; height: 22px; }
.btn.sso:hover { border-color: var(--blue); }
.sso-note {
    margin: 12px 0 0; padding: 10px 12px; border-radius: 8px;
    background: var(--blue-tint); color: var(--blue-dark); font-size: 13px; line-height: 1.5;
}

.auth-foot {
    text-align: center; color: var(--muted); font-size: 13px; margin: 26px 0 0;
}
.auth-foot span {
    display: block; margin-top: 8px; font-size: 10.5px;
    letter-spacing: .12em; text-transform: uppercase; opacity: .8;
}

/* Below 1000px only the card shows, on the sky; the card keeps its own logo. */
@media (max-width: 999px) {
    .lg-arrow { width: 70%; height: 70%; right: -40px; opacity: .6; }
}
@media (min-width: 1000px) {
    .lg { --card-col: clamp(440px, 38vw, 560px); grid-template-columns: 1fr var(--card-col); }
    .lg-hero { display: flex; }
    .lg-panel { padding: 44px 52px 44px 0; }
    .lg-card { padding: 30px 52px 24px; }
}
@media (min-width: 1000px) and (max-width: 1300px) {
    .lg-hero { padding-left: 48px; }
    .lg-title { font-size: 42px; }
    .lg-punch { font-size: 32px; }
    .lg-kicker { font-size: 28px; }
    .lg-features li { font-size: 15px; padding: 0 12px; }
}

/* Fit the window without a scroll bar: a laptop browser leaves ~650px of height, and the
   full-size card needs ~770px. Shorter windows get a tighter card and hero, never a scroll. */
@media (max-height: 800px) {
    .lg-card { padding-top: 16px; padding-bottom: 14px; }
    .lg-card .region { margin-bottom: 0; }
    .lg-card .auth-logo { max-width: 210px; margin-bottom: 8px; }
    .lg-card h1 { font-size: 24px; margin-bottom: 2px; }
    .lg-sub { font-size: 14.5px; margin-bottom: 14px; }
    .lg-card .input-line { height: 44px; margin-bottom: 10px; }
    .lg-card .auth-row { margin: 0 0 12px; }
    .lg-card .btn.auth-go, .lg-card .btn.sso { height: 44px; }
    .lg-card .or { margin: 8px 0; }
    .lg-card .auth-foot { margin-top: 12px; }
    .lg-panel { padding-top: 14px; padding-bottom: 14px; }
    .lg-hero { padding-top: 30px; padding-bottom: 26px; }
    .lg-kicker { margin-top: 16px; }
    .lg-features { margin-top: 22px; }
    .lg-motto { padding-top: 18px; }
}
@media (max-height: 640px) {
    .lg-card { padding-top: 12px; padding-bottom: 10px; }
    .lg-card .auth-logo { max-width: 170px; margin-bottom: 4px; }
    .lg-card h1 { font-size: 22px; }
    .lg-sub { margin-bottom: 10px; }
    .lg-card .input-line { height: 40px; margin-bottom: 8px; }
    .lg-card .auth-row { margin-bottom: 10px; }
    .lg-card .btn.auth-go, .lg-card .btn.sso { height: 40px; }
    .lg-card .or { margin: 6px 0; }
    .lg-card .auth-foot { margin-top: 8px; }
    .lg-panel { padding-top: 8px; padding-bottom: 8px; }
    .lg-hero { padding-top: 20px; padding-bottom: 18px; }
    .lg-kicker { font-size: 26px; margin-top: 10px; }
    .lg-title { font-size: 40px; }
    .lg-punch { font-size: 30px; }
    .lg-features { margin-top: 16px; }
}

/* ── Compact header, full-width work area ───────────────────────────────
   The desktop shell is a grid whose drawer spans two rows at 100vh. With no
   row sizes the leftover height was shared between the header and the page,
   so the header grew to ~125px of empty blue. Pin it to its content.
   The work area drops the 1200px reading-width cap: this is an ERP, and a
   wide screen should show more columns, not more margin. */
@media (min-width: 900px) {
    body.app { grid-template-rows: auto 1fr; }
    body.app .wrap { max-width: none; margin: 0; padding: 12px 18px 24px; }
}
.app-header { padding: 9px 18px; }
.app-header .eyebrow { font-size: 10px; }
.app-header h1 { font-size: 18px; margin-top: 0; line-height: 1.25; }
.fy label { margin-bottom: 2px; }
.fy select, .fy-single { padding: 4px 10px; font-size: 13.5px; }

/* overflow-x:auto on the tab strip also turned on a vertical scrollbar,
   because the active tab's -1px underline overhangs by a pixel — that was
   the stray ▲▼ at the right-hand end. */
.tabs { overflow-y: hidden; }

/* An unreachable API is a data-integrity warning, not decoration: it is the one place
   the alert colour belongs outside a bad number. */
.api-down {
    background: #fdeaec; color: #8d0212; border: 1px solid #f6c9cf;
    border-left: 4px solid var(--alert); border-radius: 8px;
    padding: 9px 12px; margin-bottom: 10px; font-size: 13px; line-height: 1.5;
    overflow-wrap: anywhere;
}

/* ── Setup screens ─────────────────────────────────────────────────────
   Row actions sit in a narrow right-hand column; a data problem shows as an
   amber advisory chip above the table, never as a popup. */
.grid th.act, .grid td.act { width: 1%; white-space: nowrap; text-align: right; }
.grid td.act form { display: inline; margin: 0; }
.grid td.act .lnk {
    background: none; border: 0; padding: 0; margin: 0 0 0 10px; width: auto;
    font: inherit; font-weight: 650; color: var(--blue); cursor: pointer;
}
.grid td.act .lnk.dim { color: var(--muted); font-weight: 500; }
.grid td.act .lnk:hover, .grid td.act .lnk:focus-visible { text-decoration: underline; }

.advisory {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px;
    padding: 6px 10px; border: 1px solid #e3c27a; border-radius: 7px;
    background: #fdf6e3; color: #7a5200; font-size: 12.5px;
}
.advisory strong { color: #5c3d00; }
.advisories { display: flex; flex-wrap: wrap; gap: 8px; }

.toolbar select.picker { width: auto; margin: 0; padding: 7px 9px; font-size: 13px; border-radius: 7px; }

.modal .field.span3 { grid-column: 1 / -1; }
.modal .field select[multiple] { padding: 4px; }
.modal .field label.check {
    display: flex; align-items: center; gap: 7px; margin-top: 6px;
    font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: inherit;
}
.modal .field input[type=checkbox] { width: auto; margin: 0; }
.modal .readonly {
    min-height: 34px; padding: 7px 9px; border: 1px dashed var(--line); border-radius: 7px;
    background: #fafbfd; font-size: 13px;
}
@media (max-width: 720px) { .modal .field.span3 { grid-column: auto; } }

/* ── Row actions and View mode ─────────────────────────────────────────
   View opens the edit form with every control disabled; it should read as a
   record, not as a greyed-out form, so disabled fields keep full contrast. */
.modal.viewing .modal-foot { display: none; }
.modal.viewing .field label em { display: none; }
.modal.viewing .field input:disabled,
.modal.viewing .field select:disabled {
    background: #fafbfd; color: inherit; opacity: 1; -webkit-text-fill-color: currentColor;
    border-style: dashed;
}
.modal .shot { display: block; max-width: 100%; max-height: 200px; border-radius: 7px; border: 1px solid var(--line); }
.grid td.act .lnk-off { margin-left: 10px; font-size: 11.5px; color: var(--muted); cursor: help; }

/* ── Row action icons: eye · pencil · switch · bin ──────────────────── */
.grid td.act .ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; margin: 0 0 0 2px; padding: 0; vertical-align: middle;
    border: 0; border-radius: 6px; background: none; color: var(--blue); cursor: pointer;
}
.grid td.act .ic .ico { width: 18px; height: 18px; }
.grid td.act .ic:hover, .grid td.act .ic:focus-visible { background: var(--blue-tint); }
.grid td.act .ic.on { color: var(--green-action); }
.grid td.act .ic.off { color: var(--muted); }
.grid td.act .ic.del { color: var(--muted); }
.grid td.act .ic.del:hover, .grid td.act .ic.del:focus-visible { color: var(--alert); background: #fdeaec; }
.grid td.act .ic.locked { color: var(--muted); opacity: .3; cursor: not-allowed; }
.grid td.act .ic.locked:hover { background: none; }

/* ── Password with a show/hide eye ─────────────────────────────────── */
.pw { position: relative; }
.modal .field .pw input { padding-right: 36px; }
.pw-eye {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
    width: 28px; height: 28px; padding: 0; margin: 0; border: 0; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; color: var(--muted); cursor: pointer;
}
.pw-eye:hover { color: var(--blue); background: var(--blue-tint); }
.pw-eye .ico { width: 18px; height: 18px; }
.pw-eye .hide, .pw-eye[aria-pressed="true"] .show { display: none; }
.pw-eye[aria-pressed="true"] .hide { display: inline-flex; }

/* ── Chart of accounts: the group tree ─────────────────────────────── */
.grid td .tree { display: inline-block; }

/* ── Confirmation dialog (keys.js askConfirm) ─────────────────────────
   Replaces the browser's confirm box: a centred card with an icon, title,
   the question, and Cancel / confirm. Red confirm only for deletes. */
.confirm-backdrop {
    position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(0, 26, 79, .45); animation: confirm-fade .12s ease-out;
}
.confirm {
    width: 100%; max-width: 420px; background: #fff; border-radius: 12px; text-align: center;
    padding: 26px 24px 20px; box-shadow: 0 24px 60px rgba(0, 26, 79, .35); animation: confirm-pop .16s ease-out;
}
.confirm-icon {
    width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 700; line-height: 1;
    color: #b07e0a; border: 3px solid #f0d596; background: #fdf6e3;
}
.confirm.danger .confirm-icon { color: var(--alert); border-color: #f6c9cf; background: #fdeaec; }
.confirm h2 { margin: 0 0 6px; font-size: 18px; color: var(--blue-dark); }
.confirm p { margin: 0 0 20px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.confirm-actions { display: flex; justify-content: center; gap: 10px; }
.confirm-actions .btn { width: auto; min-width: 120px; }
.btn.danger { background: var(--alert); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
@keyframes confirm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirm-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* ── Control: logs ─────────────────────────────────────────────────── */
.logtext {
    margin: 0; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfd;
    font: 12px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.grid td .sub.hint, .modal .readonly.hint { color: var(--green-action); }
.modal .field textarea {
    width: 100%; margin: 0; padding: 7px 9px; font: inherit; font-size: 13px;
    border: 1px solid var(--line); border-radius: 7px; resize: vertical;
}
.modal > .modal-panel > .fields { padding: 14px; }
.toolbar label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; color: var(--muted); }

/* ── Targets: achievement meters ───────────────────────────────────── */
.meter { height: 6px; min-width: 110px; margin: 4px 0 3px; border-radius: 3px; background: #eef2f7; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.meter.ok span { background: var(--green-action); }
.meter.mid span { background: #d9a21b; }
.meter.low span { background: var(--alert); }

/* ── Master import ─────────────────────────────────────────────────── */
.import-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 12px; }
.import-steps .panel { margin: 0; }
.step-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14.5px; color: var(--blue-dark); }
.step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; }
.import-steps form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.import-steps .file { flex: 1 1 220px; margin: 0; font-size: 13px; }
.import-steps .btn { width: auto; margin-top: 8px; }
.import-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.import-summary > div { display: flex; flex-direction: column; }
.import-summary .big { font-size: 26px; font-weight: 700; color: var(--green-action); line-height: 1.1; font-variant-numeric: tabular-nums; }
.import-summary .big.warn { color: #b07e0a; }
.import-summary .big.bad { color: var(--alert); }
.import-summary .sub { font-size: 11.5px; color: var(--muted); }
.import-summary .grow { flex: 1 1 200px; }
.import-summary .actions { flex-direction: row; gap: 8px; align-items: center; }
.import-summary .actions form { margin: 0; }
.import-summary .actions .btn { width: auto; }
.grid td.dim { color: var(--muted); font-size: 12px; }
.import-steps .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Header, top right: financial year switch + user menu ──────────── */
.hdr-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.menu { position: relative; }
.menu > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
    min-height: 38px; padding: 4px 10px; border-radius: 10px; color: #fff;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
    user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: rgba(255, 255, 255, .2); }
.menu > summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.menu > summary .chev { width: 14px; height: 14px; flex: 0 0 auto; transition: transform .15s; }
.menu[open] > summary .chev { transform: rotate(180deg); }
/* The key chip floats as a badge on the corner, so it never changes the button's size. */
.menu > summary { position: relative; height: 42px; }
.menu > summary kbd {
    position: absolute; right: -4px; top: -9px; display: none;
    padding: 1px 5px; margin: 0; border: 0; border-radius: 4px;
    font-size: 10px; line-height: 1.4; background: var(--green-action); color: #fff;
}
body.show-keys .menu > summary kbd { display: block; }

.fy-menu > summary { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 3px 12px; }
.fy-cap { font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; opacity: .72; font-weight: 600; line-height: 1.1; }
.fy-val { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; line-height: 1.2; }

.avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
    display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--blue-bright), var(--green));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.avatar.big { width: 44px; height: 44px; font-size: 16px; box-shadow: none; }
.user-who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; min-width: 0; }
.user-who strong { font-size: 13px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-who small { font-size: 11px; opacity: .78; }
@media (max-width: 700px) {
    .user-who, .fy-cap { display: none; }
    .menu > summary { padding: 4px 8px; }
}

.menu-pop {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 250px;
    background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 26, 79, .22); padding: 6px;
}
.menu-pop form { margin: 0; }
.menu-pop a, .menu-pop button {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 0;
    padding: 8px 10px; border: 0; border-radius: 7px; background: none; cursor: pointer;
    color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; text-decoration: none;
}
.menu-pop a:hover, .menu-pop button:hover, .menu-pop a:focus-visible, .menu-pop button:focus-visible { background: var(--blue-tint); outline: none; }
.menu-pop .ico { width: 18px; height: 18px; color: var(--blue); flex: 0 0 auto; }
.menu-title { margin: 4px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.menu-note { margin: 6px 10px 4px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.fy-menu .menu-pop button { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 1px; }
.fy-menu .menu-pop button span { font-weight: 700; }
.fy-menu .menu-pop button small { grid-column: 1; font-size: 11.5px; color: var(--muted); }
.fy-menu .menu-pop button .ico { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--green-action); }
.fy-menu .menu-pop button.on { background: #eef8f3; }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-user strong { display: block; font-size: 14px; color: var(--blue-dark); }
.menu-user small { display: block; font-size: 11.5px; color: var(--muted); }

/* ── My profile ──────────────────────────────────────────────────── */
.profile-card { max-width: 1000px; }
.profile-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.profile-head strong { display: block; font-size: 16px; color: var(--blue-dark); }
.profile-head .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.profile-form .grid3 { display: grid; gap: 12px 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .profile-form .grid3 { grid-template-columns: 1fr; } }
.profile-form .field { margin: 0; min-width: 0; }
.profile-form .field.span3 { grid-column: 1 / -1; }
.profile-form .field label {
    display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); margin-bottom: 4px;
}
.profile-form .field label em { font-style: normal; font-size: 9.5px; letter-spacing: .07em; color: #b07e0a; margin-left: 5px; }
.profile-form .field input, .profile-form .field textarea {
    width: 100%; margin: 0; padding: 7px 9px; font: inherit; font-size: 13px; border-radius: 7px;
}
.profile-form .field input:disabled { background: #f4f6fa; color: var(--muted); }
.profile-form .field small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.profile-form .pw input { padding-right: 36px; }
.profile-form .form-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.profile-form .form-actions .btn { width: auto; }

/* ── Purchase, vouchers, sale orders ──────────────────────────────── */
.grid tr.struck td { color: var(--muted); }
.grid tr.struck td:not(.act) { text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .35); }
.grid tfoot td { padding: 8px; border-top: 2px solid var(--line); font-size: 12.5px; color: var(--muted); }
.grid tfoot td.num { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Entry pages: the same field look as the modals, on a page. */
.entry .entry-head { display: grid; gap: 12px 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .entry .entry-head { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .entry .entry-head { grid-template-columns: 1fr; } }
.entry .field { margin: 0; min-width: 0; }
.entry .field.span2 { grid-column: span 2; }
@media (max-width: 560px) { .entry .field.span2 { grid-column: auto; } }
.entry .field label {
    display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); margin-bottom: 4px;
}
.entry .field label em { font-style: normal; font-size: 9.5px; letter-spacing: .07em; color: #b07e0a; margin-left: 5px; }
.entry .field input, .entry .field select { width: 100%; margin: 0; padding: 7px 9px; font-size: 13px; border-radius: 7px; }
.entry .field small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.entry .readonly { padding: 7px 0; font-size: 12.5px; color: var(--muted); }
.entry .panel-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.advisory.inline { display: inline-block; margin: 0 0 0 10px; padding: 2px 9px; font-size: 12px; }
.advisory.inline:empty { display: none; }

.grid.lines td { vertical-align: middle; padding: 4px 6px; }
.grid.lines th.w-item, .grid.lines td.w-item { min-width: 260px; width: 34%; }
.grid.lines select, .grid.lines input {
    width: 100%; margin: 0; padding: 5px 7px; font-size: 13px; border-radius: 6px; height: 32px;
}
.grid.lines td.num input { text-align: right; min-width: 72px; font-variant-numeric: tabular-nums; }
.grid.lines input[readonly] { background: #f4f6fa; color: var(--muted); border-color: transparent; }
.grid.lines td[data-f="n"] { color: var(--muted); width: 28px; }

.lines-foot { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lines-foot .btn { width: auto; }
/* The totals sit at the right edge, under the Amount column, however the row wraps. */
.lines-foot .spacer { flex: 1 1 auto; }
.lines-foot .totals { margin-left: auto; }
.warn-text { color: var(--alert); font-size: 12.5px; align-self: center; }
.totals { display: grid; grid-template-columns: auto auto; gap: 3px 22px; margin: 0; min-width: 260px; font-size: 13px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 16px; font-weight: 700; color: var(--blue-dark); padding-top: 5px; border-top: 1px solid var(--line); }
.entry .form-actions, .panel .form-actions { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; justify-content: flex-end; }
.form-actions .note { margin-right: auto; font-size: 12px; color: var(--muted); }
.form-actions .btn { width: auto; }
.btn.danger { color: var(--alert); border-color: #f1c4cb; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; }
.facts > div { display: flex; flex-direction: column; min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts span { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts strong { font-size: 14px; color: var(--blue-dark); margin-top: 2px; }
.facts small { font-size: 12px; color: var(--muted); }

/* ── Multi-pick lists as tick boxes (checklist.js) ─────────────────── */
select.checklist-source { display: none !important; }
.checklist-bar { display: flex; justify-content: space-between; align-items: center; margin: 0 0 4px; font-size: 11.5px; color: var(--muted); }
.checklist-tools button { background: none; border: 0; padding: 0; margin: 0; width: auto; font: inherit; color: var(--blue); cursor: pointer; }
.checklist-tools button:hover { text-decoration: underline; }
.checklist {
    border: 1px solid var(--line); border-radius: 7px; background: #fff;
    max-height: 230px; overflow-y: auto; padding: 3px 0;
}
.checklist label, .modal .field .checklist label {
    display: flex; align-items: center; gap: 9px; margin: 0; padding: 6px 10px;
    font-size: 13px; font-weight: 500; letter-spacing: normal; text-transform: none;
    color: var(--ink); cursor: pointer;
}
.checklist label:hover { background: var(--blue-tint); }
.checklist input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--green-action); }
.checklist label:has(input:checked) { background: #eef8f3; }
.checklist-group { padding: 7px 10px 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.checklist-empty { padding: 10px; font-size: 12.5px; color: var(--muted); }
.checklist-error { margin-top: 4px; font-size: 12px; color: var(--alert); }

/* ── Long master forms in sections (the dealer modal mirrors the phone's seven) ── */
.modal-panel.wide.xl { max-width: 980px; }
.modal .fields .fsec {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
    margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line);
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--blue-dark);
}
.modal .fields .fsec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.modal .fields .fsec b {
    display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px;
    background: var(--blue); color: #fff; font-size: 10.5px; letter-spacing: 0;
}
.modal .field input[type=file] { padding: 5px 6px; background: #fff; }
.modal-foot .stamp { margin-right: auto; align-self: center; font-size: 11.5px; color: var(--muted); }
.modal-panel.xl .shot { max-height: 110px; }

/* ── Tabs inside a long modal (modal-tabs.js): one panel of the form at a time ── */
.mtabs {
    display: flex; gap: 2px; overflow-x: auto; padding: 0 10px;
    border-bottom: 1px solid var(--line); background: #fafbfd;
}
.mtabs button {
    display: inline-flex; align-items: center; gap: 6px; width: auto;
    padding: 9px 11px; margin: 0 0 -1px; background: none; border: 0; border-radius: 0;
    border-bottom: 2px solid transparent; box-shadow: none;
    font-size: 12.5px; font-weight: 650; color: var(--muted); white-space: nowrap; cursor: pointer;
}
.mtabs button:hover { color: var(--blue); background: var(--blue-tint); }
.mtabs button.on { color: var(--blue-dark); border-bottom-color: var(--blue); background: #fff; }
.mtabs button b {
    display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 4px;
    background: #e3e9f3; color: var(--muted); font-size: 10.5px;
}
.mtabs button.on b { background: var(--blue); color: #fff; }
.mtabs kbd {
    opacity: 0; max-width: 0; margin: 0; padding: 0;
    border-width: 0; overflow: hidden; white-space: nowrap; transition: opacity .12s;
}
body.show-keys .mtabs kbd { opacity: .85; max-width: 7em; margin-left: 3px; padding: 3px 5px; border-width: 1px; }
/* Every panel keeps the height of the tallest, so the modal does not jump between tabs. */
.modal [data-mpanel] { min-height: 330px; align-content: start; }
.modal [data-mpanel][hidden] { display: none; }
.mtabs { overflow-y: hidden; }
/* .shot is display:block, which would beat the hidden attribute and draw a broken picture. */
.modal .shot[hidden] { display: none; }

/* ── Billing: range chips, order picker, previews, print setup ───────── */
.toolbar .chips { display: inline-flex; gap: 4px; }
.toolbar .chip {
    padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
    font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap;
}
.toolbar .chip:hover { color: var(--blue); border-color: var(--blue); }
.toolbar .chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.entry .field.span6 { grid-column: 1 / -1; }
.entry textarea { width: 100%; margin: 0; padding: 7px 9px; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 7px; resize: vertical; }
.entry .entry-head + .entry-head { margin-top: 12px; }
.facts .pre { white-space: pre-line; font-weight: 500; }

.order-pick { margin-top: 12px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; background: #fafbfd; }
.order-pick-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.order-pick-head .note { font-size: 12px; color: var(--muted); }
.order-pick-list { display: grid; gap: 4px; margin: 8px 0; max-height: 220px; overflow-y: auto; }
.order-pick-list label { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.order-pick-list input { width: auto; margin: 0; }
.order-pick .btn { width: auto; }

.modal-panel.preview-panel { max-width: 1000px; height: calc(100vh - 60px); display: flex; flex-direction: column; }
.print-frame { flex: 1; width: 100%; min-height: 70vh; border: 0; background: #e9edf3; border-radius: 0 0 10px 10px; }

.print-setup { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .print-setup { grid-template-columns: 1fr; } }
.print-form .ps-grid, .setup-form .ps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; margin-top: 10px; }
.print-form .field.span2, .setup-form .field.span2 { grid-column: span 2; }
.print-form .field.span3, .setup-form .field.span3 { grid-column: 1 / -1; }
.print-form textarea, .setup-form textarea { width: 100%; margin: 0; padding: 7px 9px; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 7px; resize: vertical; }
.print-form fieldset.checks { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.print-form fieldset.checks legend { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.print-form fieldset.checks small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.print-form label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: inherit; text-transform: none; letter-spacing: 0; margin: 0; }
.print-form label.check input { width: auto; margin: 0; }
.print-preview { position: sticky; top: 8px; }
.print-preview .panel-head { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.print-preview .panel-head .note { font-size: 12px; color: var(--muted); }
.print-preview .print-frame { height: calc(100vh - 170px); min-height: 520px; border-radius: 0 0 10px 10px; }
.order-pick [hidden] { display: none !important; }
.grid td.code { white-space: nowrap; }

/* ── Order life: stage chips, bulk approve bar, the stage line ─────────── */
.pill.info { background: var(--blue-tint); color: var(--blue); }
.stage-tabs { margin-top: -2px; }
.bulk-bar { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulk-bar .btn { width: auto; }
.bulk-bar .note { font-size: 12px; color: var(--muted); }
.bulk-bar label.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin: 0; color: inherit; }
.bulk-bar input[type=checkbox], .grid td.act input[type=checkbox] { width: auto; margin: 0; }
.stage-line { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stage-line li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.stage-line li b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e3e9f3; color: var(--muted); font-size: 11px; }
.stage-line li span { font-weight: 700; color: var(--muted); font-size: 13px; }
.stage-line li small { font-size: 11.5px; color: var(--muted); }
.stage-line li.done b { background: var(--green-action); color: #fff; }
.stage-line li.done span { color: var(--green-action); }
.stage-line li.now { border-color: var(--blue); }
.stage-line li.now b { background: var(--blue); color: #fff; }
.stage-line li.now span { color: var(--blue-dark); }
.stage-line.stopped li.now { border-color: var(--alert); }
@media (max-width: 720px) { .stage-line { grid-template-columns: 1fr 1fr; } }
.grid td.nowrap { white-space: nowrap; }
/* Side-by-side panels may shrink below their widest table, so the table scrolls inside its own
   panel instead of widening the whole page. */
.split > * { min-width: 0; }
/* A toolbar field hidden by script stays hidden: label.inline sets display, which beats [hidden]. */
.toolbar [hidden] { display: none !important; }

/* ── Number inputs: no spinner arrows ────────────────────────────────────────
   A clerk types the figure; the arrows only ever nudge a quantity or a rate by
   accident. The mouse wheel is guarded in keys.js. Typing, Enter to advance and the
   keyboard's own Up/Down still work. */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Searchable pickers (combo.js) ─────────────────────────────────────────
   The native <select data-combo> stays in the form as the real field, hidden; the box the
   clerk sees is .combo-input, and .combo-list is the narrowing list under it. Sized to
   match the input it replaces wherever it sits — a modal field, an entry head, a line. */
.combo { position: relative; width: 100%; }
.combo select.combo-native { display: none !important; }
.combo .combo-input {
    width: 100%; margin: 0; padding: 7px 30px 7px 9px; font-size: 13px; border-radius: 7px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.grid.lines .combo .combo-input { padding: 5px 26px 5px 7px; border-radius: 6px; height: 32px; }
.toolbar .combo { width: auto; min-width: 220px; }
.toolbar .combo .combo-input { padding: 7px 30px 7px 9px; }
.combo-list {
    position: fixed; z-index: 1200;   /* placed by combo.js from the box's rectangle; above any modal */
    max-height: 280px; overflow-y: auto; background: #fff;
    border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 26, 79, .14);
}
.combo-row {
    padding: 7px 10px; font-size: 13px; cursor: pointer; line-height: 1.3;
    border-bottom: 1px solid #f1f4f8;
}
.combo-row:last-child { border-bottom: 0; }
.combo-row.on { font-weight: 600; }
.combo-row.hi, .combo-row:hover { background: #eef4ff; }
.combo-row .combo-sub { display: block; font-size: 11.5px; color: var(--muted); }
.combo-create { color: var(--green-action); font-weight: 600; background: #f3fbf7; }
.combo-create.hi, .combo-create:hover { background: #e2f6ec; }
.combo-empty { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
.modal.viewing .combo .combo-input:disabled { background: #f4f6fa; color: var(--muted); }

/* Planned manufacturing / godown modules: in the menu for the shape of the flow, muted until built. */
.nav a.planned { opacity: .62; }
.nav a.planned:hover, .nav a.planned.on { opacity: 1; }
.nav a.planned small {
    font-size: 9.5px; font-weight: 700; letter-spacing: .05em; margin-left: auto;
    padding: 1px 5px; border-radius: 8px; background: rgba(255, 255, 255, .12); color: #cfd8ea;
}

/* Sign-in: the way back to the public landing page. */
.auth-foot .auth-home { color: var(--blue); text-decoration: none; font-weight: 600; }
.auth-foot .auth-home:hover { text-decoration: underline; }

/* ── Setup › Company ──────────────────────────────────────────────────────── */
/* The grid, span classes and textarea come from the .print-form rules above. */

.setup-form .field label em {
    font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .07em;
    color: #b07e0a; margin-left: 5px;
}
.setup-form .field small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.setup-form .field small.hint { margin-top: -2px; }
.setup-form .field code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }

/* A section heading inside the grid: a rule with a label, not a boxed fieldset. */
.setup-form fieldset.group {
    border: 0; border-top: 1px solid var(--line); padding: 0; margin: 6px 0 0;
}
.setup-form fieldset.group:first-child { border-top: 0; margin-top: 0; }
.setup-form fieldset.group legend {
    font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--blue-dark); padding: 0 6px 0 0;
}

.brand-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
@media (max-width: 900px) { .brand-grid { grid-template-columns: 1fr; } }

.brand-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; min-width: 0; }
.brand-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.brand-shot {
    height: 108px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 7px; background: #fafbfd; overflow: hidden; padding: 6px;
}
.brand-shot img { max-height: 100%; max-width: 100%; object-fit: contain; }
.brand-shot.empty { border-style: dashed; }
.brand-shot .none { font-size: 18px; color: var(--muted); }
.brand-pick { display: block; margin: 9px 0 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.brand-card input[type=file] { width: 100%; font-size: 12px; }
.brand-card small { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }

/* A branding image that failed to load: say so, rather than leaving a blank tile. */
.brand-shot.broken { border-style: dashed; border-color: #e3c27a; background: #fdf6e3; }
.brand-shot.broken::after {
    content: "could not be loaded"; font-size: 11.5px; color: #7a5200; text-align: center; padding: 0 8px;
}
.brand-src { margin-top: 6px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.brand-src a { color: var(--blue); }

/* Performance points: the little bar beside a part of the score (Field Force › Performance). */
.pbar { display: inline-block; width: 74px; height: 5px; margin-left: 6px; border-radius: 3px; background: #e7eaf0; vertical-align: middle; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 3px; }

/* A filter form sitting in a .bar (Godown, Performance): its fields read as one line, and a
   label.inline keeps its text beside the field instead of stacking above it. */
.inline-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.bar label.inline, .inline-form label.inline {
    display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; color: var(--muted);
}
.bar .inline-form input.picker, .bar .inline-form select, .bar .inline-form input { width: auto; }

/* ── Entry screens, tightened ─────────────────────────────────────────
   An invoice is typed all day: the header, the lines and the totals should sit in one
   screenful. These override the entry rules above — same look, less air. */
.entry .entry-head { gap: 8px 10px; }
.entry .field label { margin-bottom: 2px; font-size: 10px; }
.entry .field input, .entry .field select, .entry .field textarea { padding: 5px 8px; }
.entry .field small { margin-top: 2px; font-size: 11px; line-height: 1.35; }
.entry .field textarea { font-size: 13px; }
.entry .readonly { padding: 4px 0; }
.entry .panel-note { margin-top: 6px; font-size: 11.5px; }
.entry .panel { padding: 10px 12px; margin-bottom: 8px; }
.entry .panel.tight { padding: 0; }
.entry .advisory { margin: 6px 0 0; padding: 5px 9px; font-size: 12px; }

.entry .grid.lines td { padding: 3px 5px; }
.entry .grid.lines th { padding: 5px 6px; }
.entry .grid.lines select, .entry .grid.lines input { height: 30px; padding: 4px 6px; }
.entry .lines-foot { padding: 8px 10px; gap: 10px; }
.entry .totals { gap: 2px 18px; font-size: 12.5px; min-width: 240px; }
.entry .totals .grand { font-size: 15px; padding-top: 4px; }
.entry .form-actions { padding: 8px 10px; }
.entry .field.span3 { grid-column: span 3; }
.entry .field.span4 { grid-column: span 4; }
@media (max-width: 900px) { .entry .field.span3, .entry .field.span4 { grid-column: span 2; } }
@media (max-width: 560px) { .entry .field.span3, .entry .field.span4 { grid-column: auto; } }
