/* =====================================================================
   Brindawan ERP brand theme (layout patterns from the ERP Connect kit)
   Load order: bootstrap.min.css -> bootstrap-icons.min.css -> this file.
   Brand (Brindawan-ERP-Brand/README.md, owner 23-Nov-2026):
     Navy #16314F       app chrome (sidebar, topbar, login), primary text
     Deep Teal #0F766E  primary CTA, links, labels, accents
     Bright Teal #22A596 active nav, foundation bar, "on" states
     Gold #C8921F (#E6B14A -> #C8921F)  rooftop, highlight, counts
     Off-white #F6F9FC  surfaces      Slate #5B6B7B  muted text
   Green / red stay for signed numbers only.
   Every colour comes from a token below - never a raw hex in a page.
   ===================================================================== */

/* ---------- Project font: Bahnschrift SemiCondensed ------------------
   Licence-safe default: use the copy installed with Windows (local()).
   No font file is served until the web-embedding licence is confirmed
   (see wwwroot/fonts/README.md). Non-Windows devices fall back through
   the stack; swapping to a licensed/open font is a one-line change to
   --app-font. */
@font-face {
    font-family: "Bahnschrift SemiCondensed";
    src: local("Bahnschrift SemiCondensed"), local("Bahnschrift-SemiCondensed"), local("Bahnschrift");
    /* When licensed, add: url("/fonts/bahnschrift.woff2") format("woff2"); */
    font-weight: 300 700;
    font-stretch: 75% 100%;
    font-display: swap;
}

:root {
    --app-font: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", "Segoe UI", "Segoe UI Semibold", system-ui, Arial, sans-serif;
    --num: var(--app-font);

    /* Brand palette */
    --brand-navy: #16314F;
    --brand-teal: #0F766E;
    --brand-teal-bright: #22A596;
    --brand-gold: #C8921F;
    --brand-gold-light: #E6B14A;
    --brand-offwhite: #F6F9FC;
    --brand-slate: #5B6B7B;
    --brand-gold-grad: linear-gradient(135deg, var(--brand-gold-light) 0%, var(--brand-gold) 100%);

    /* Chrome (navy): sidebar, topbar, login */
    --chrome: var(--brand-navy);
    --chrome-dark: #10263F;
    --chrome-darker: #0B1C30;
    --chrome-2: #1C3B5E;
    --chrome-line: rgba(255, 255, 255, .09);
    /* Primary call to action (deep teal) */
    --cta: var(--brand-teal);
    --cta-dark: #0C635C;
    --cta-darker: #094F4A;
    --cta-grad: linear-gradient(180deg, #12857C 0%, var(--brand-teal) 100%);
    /* Highlight (gold): counts, badges, rooftop accents */
    --hl: var(--brand-gold);
    --hl-ink: #2A1E05;

    /* Sidebar (white on navy) */
    --side-text: rgba(255, 255, 255, .86);
    --side-mut: rgba(255, 255, 255, .62);
    --side-line: rgba(255, 255, 255, .09);
    --side-hover: rgba(255, 255, 255, .07);
    --side-field: rgba(255, 255, 255, .07);

    /* Content */
    --app-bg: var(--brand-offwhite);
    --surface: #FFFFFF;
    --accent: var(--brand-teal);
    --accent-700: #0B5C56;
    --accent-tint: #E9F6F4;
    --accent-line: #BFE3DD;
    --navy: var(--brand-navy);
    --navy-2: #1F4268;
    --pos: #15803D;
    --pos-tint: #EEF7F0;
    --neg: #B91C1C;
    --neg-tint: #FBEEEE;
    --warn: #B45309;
    --warn-tint: #FDF4E7;
    --gold: var(--brand-gold);
    --gold-tint: #FBF3E2;
    --purple: #7C3AED;
    --blue: #2563EB;
    /* Charts (MIS): earlier periods sit back, the chosen one is --accent; split parts = one-hue ordinal ramp (checked with the dataviz validator) */
    --chart-muted: #9ACFC7;
    --chart-grid: #E8EDF3;
    --ord-1: #6CC0B4;
    --ord-2: #1E9A8C;
    --ord-3: var(--accent-700);
    /* Signals on the navy band */
    --pos-on-dark: #5EE0B5;
    --neg-on-dark: #FCA5A5;

    --ink: var(--brand-navy);
    --ink-2: #334155;
    --ink-3: #475569;
    --mut: var(--brand-slate);
    --mut-2: #94A3B8;
    --line: #E2E8F0;
    --line-soft: #EEF2F6;
    --line-2: #CBD5E1;
    --bg: #F8FAFC;
    --bg-2: #EEF2F7;

    --radius: 12px;
    --radius-sm: 9px;
    --radius-pill: 999px;
    --shadow: 0 1px 2px rgba(22, 49, 79, .06), 0 4px 14px rgba(22, 49, 79, .05);
    --shadow-h: 0 4px 10px rgba(22, 49, 79, .10), 0 14px 30px rgba(22, 49, 79, .10);

    --sidebar-w: 240px;
    --sidebar-w-min: 64px;
    --topbar-h: 48px;
    --gutter: 16px;
    --bottom-nav-h: 58px;

    /* Bootstrap remap: content accents are teal, not red */
    --bs-body-font-family: var(--app-font);
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--ink);
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: var(--accent-700);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-focus-ring-color: rgba(15, 118, 110, .25);
}

html { font-stretch: 87.5%; }
html, body { background-color: var(--app-bg); }
html, body, .app-shell, .btn, .form-control, .form-select, .table, input, select, textarea, button {
    font-family: var(--app-font);
}
body {
    margin: 0;
    font-size: .86rem;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.num, .table .num, td.num, th.num { font-family: var(--num); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
a { color: var(--accent); }
a:hover { color: var(--accent-700); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- App shell (navy sidebar with accordion sections + sticky navy topbar; brand band runs across the top) ---------- */
body.preload *, body.preload *::before, body.preload *::after { transition: none !important; animation: none !important; }
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--chrome) 0%, #142D49 60%, var(--chrome-dark) 100%);
    color: #fff;
    box-shadow: 4px 0 16px rgba(11, 28, 48, .18);
    transition: width .2s ease, transform .2s ease;
    overflow: hidden;
}
/* Brand block: same height and colour as the topbar, so mark + wordmark read as one band (brand sheet "Topbar / App Shell") */
.sidebar-brand {
    position: relative; display: flex; align-items: center; gap: .6rem; flex: 0 0 auto;
    height: var(--topbar-h); padding: 0 .85rem;
    color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden;
    background: var(--chrome-darker);
    border-bottom: 1px solid var(--chrome-line);
}
.sidebar-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--brand-teal-bright) 0%, var(--brand-teal) 45%, transparent 100%); opacity: .8; }
.sidebar-brand:hover { color: #fff; }
.brand-logo { flex: 0 0 auto; width: 30px; height: 30px; display: block; transition: transform .3s ease; }
.sidebar-brand:hover .brand-logo { transform: translateY(-1px) scale(1.04); }
.brand-divider { flex: 0 0 auto; width: 1px; height: 26px; background: rgba(255, 255, 255, .22); }
.sidebar-brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; min-width: 0; }
.brand-line-1 { font-size: .98rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.brand-line-1 .brand-accent, .brand-accent { color: var(--brand-teal-bright); }
.brand-line-2 { font-size: .54rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--side-mut); overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.sidebar-search {
    display: flex; align-items: center; gap: .4rem; flex: 0 0 auto;
    margin: .6rem .65rem .25rem; padding: .32rem .55rem;
    background: var(--side-field); border: 1px solid rgba(255, 255, 255, .08); border-radius: 7px;
    transition: background .14s, border-color .14s;
}
.sidebar-search:focus-within { background: rgba(255, 255, 255, .12); border-color: rgba(34, 165, 150, .7); }
.sidebar-search i { color: rgba(255, 255, 255, .6); font-size: .8rem; flex-shrink: 0; }
.sidebar-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font-size: .76rem; padding: 0; }
.sidebar-search input::placeholder { color: rgba(255, 255, 255, .5); }
.sidebar-search button { display: none; background: transparent; border: 0; color: rgba(255, 255, 255, .75); padding: 0 .15rem; font-size: .7rem; cursor: pointer; }
.sidebar-search button:hover { color: #fff; }
.sidebar-search.has-text button { display: inline-block; }

.sidebar-menu {
    flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: .3rem 0 .8rem;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; overscroll-behavior: contain;
}
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 4px; }
.sidebar-menu .nav { margin: 0; padding: 0; list-style: none; flex-wrap: nowrap; }
.sidebar-menu li { list-style: none; }

.sidebar-link {
    position: relative; display: flex; align-items: center; gap: .5rem;
    padding: .34rem .8rem; color: var(--side-text); text-decoration: none;
    font-size: .78rem; line-height: 1.25; white-space: nowrap;
    transition: background .14s, color .14s;
}
.sidebar-link i { flex: 0 0 auto; width: 1.05rem; text-align: center; font-size: .88rem; color: rgba(255, 255, 255, .72); }
.sidebar-link span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sidebar-link:hover { background: var(--side-hover); color: #fff; }
.sidebar-link:hover i { color: var(--brand-teal-bright); }
/* Active item: teal pill, white text (brand sheet) */
.sidebar-link.active { background: var(--cta-grad); color: #fff; font-weight: 700; box-shadow: 0 2px 10px rgba(15, 118, 110, .45), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sidebar-link.active i { color: #fff; }
.sidebar-menu > .nav > .nav-item:not(.sidebar-section) > .sidebar-link { margin: .1rem .5rem; padding: .42rem .6rem; border-radius: 7px; font-size: .82rem; font-weight: 600; color: #fff; }
.sidebar-menu > .nav > .nav-item:not(.sidebar-section) > .sidebar-link.active { color: #fff; }
.nav-badge {
    margin-left: auto; min-width: 1.25rem; padding: 0 .35rem; border-radius: var(--radius-pill);
    background: var(--brand-gold-grad); color: var(--hl-ink); font-size: .64rem; font-weight: 800; line-height: 1.1rem; text-align: center;
}
.sidebar-link.active .nav-badge { background: #fff; color: var(--cta-darker); }

/* Sections: muted uppercase header (icon, name, count, chevron) + nested items on a thin rail */
.sidebar-section { margin-top: .3rem; padding-top: .2rem; border-top: 1px solid var(--side-line); }
.sidebar-section-header {
    display: flex; align-items: center; gap: .45rem; width: 100%;
    padding: .34rem .8rem; margin: 0; border: 0; background: transparent;
    color: rgba(255, 255, 255, .66); font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-align: left;
    cursor: pointer; transition: color .14s, background .14s;
}
.sidebar-section-header:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.sidebar-section-header:focus-visible { outline: 2px solid var(--brand-teal-bright); outline-offset: -2px; }
.sidebar-section.has-active > .sidebar-section-header, .sidebar-section:not(.collapsed) > .sidebar-section-header { color: #fff; }
.sidebar-section-icon { flex: 0 0 auto; width: 1.05rem; text-align: center; font-size: .82rem; color: rgba(255, 255, 255, .8); }
.sidebar-section.has-active .sidebar-section-icon { color: var(--brand-teal-bright); }
.sidebar-section-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-section-count { flex: 0 0 auto; padding: 1px 6px; border-radius: 7px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .85); font-size: .58rem; font-weight: 700; line-height: 1.5; letter-spacing: 0; }
.sidebar-section-alert { flex: 0 0 auto; padding: 0 5px; border-radius: 7px; background: var(--brand-gold-grad); color: var(--hl-ink); font-size: .6rem; font-weight: 800; line-height: 1.5; letter-spacing: 0; }
.sidebar-section-chevron { flex: 0 0 auto; font-size: .6rem; color: rgba(255, 255, 255, .55); transition: transform .18s; }
.sidebar-section.collapsed .sidebar-section-chevron { transform: rotate(-90deg); }
.sidebar-section-items {
    margin: .05rem 0 .25rem 1.25rem; padding: .1rem 0; list-style: none;
    border-left: 2px solid rgba(255, 255, 255, .1); overflow: hidden;
}
.sidebar-section-items .sidebar-link { padding: .3rem .6rem; border-radius: 0 6px 6px 0; margin-right: .45rem; }
.sidebar-section.collapsed .sidebar-section-items { display: none; }
.search-hidden { display: none !important; }
.sidebar-no-match { padding: 1rem .9rem; color: rgba(255, 255, 255, .7); font-size: .74rem; text-align: center; }

.sidebar-footer {
    display: flex; align-items: center; gap: .5rem; flex: 0 0 auto;
    padding: .5rem .75rem; border-top: 1px solid var(--side-line);
    background: rgba(0, 0, 0, .14);
    color: #fff; font-size: .74rem; font-weight: 600; overflow: hidden;
}
.sidebar-footer form { margin: 0 0 0 auto; }
.sidebar-username { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-username small { font-size: .62rem; font-weight: 400; color: var(--side-mut); overflow: hidden; text-overflow: ellipsis; }
.btn-sidebar {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; font-size: .9rem;
}
.btn-sidebar:hover { background: #fff; color: var(--chrome); border-color: #fff; }
.user-avatar.sm { width: 28px; height: 28px; font-size: .7rem; background: var(--brand-offwhite); color: var(--chrome); flex: 0 0 auto; }

.app-main { flex: 1 1 auto; min-width: 0; margin-left: var(--sidebar-w); transition: margin-left .2s ease; display: flex; flex-direction: column; }

/* Topbar: navy band (brand sheet), white text, teal / gold accents */
.topbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: .55rem;
    height: var(--topbar-h); padding: 0 var(--gutter);
    background: linear-gradient(90deg, var(--chrome-darker) 0%, var(--chrome-dark) 40%, var(--chrome) 100%);
    color: #fff;
    border-bottom: 1px solid var(--chrome-line);
    box-shadow: 0 2px 10px rgba(11, 28, 48, .18);
}
.topbar-brand { display: none; flex: 0 0 auto; align-items: center; gap: .4rem; color: #fff; text-decoration: none; }
.topbar-brand img { width: 26px; height: 26px; display: block; }
.topbar-heading { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.topbar-crumb { flex: 0 0 auto; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .6); white-space: nowrap; }
.topbar-crumb i { color: var(--brand-teal-bright); }
.topbar-crumb::after { content: "/"; margin-left: .5rem; color: rgba(255, 255, 255, .28); font-weight: 400; }
.topbar-title { font-weight: 700; font-size: .95rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1 1 auto; }
.btn-icon {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 36px; height: 36px; margin-left: -6px;
    border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-2); font-size: 1.2rem;
}
.btn-icon:hover { background: var(--bg-2); color: var(--accent); }
.topbar .btn-icon { color: rgba(255, 255, 255, .88); }
.topbar .btn-icon:hover { background: rgba(255, 255, 255, .1); color: #fff; }
/* Company group in force - styled like the brand sheet's project selector */
.tenant-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .2rem .7rem; border-radius: var(--radius-pill);
    background: var(--accent-tint); color: var(--accent-700); border: 1px solid var(--accent-line);
    font-size: .74rem; font-weight: 600; white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis;
}
.topbar .tenant-badge { background: rgba(255, 255, 255, .07); color: #fff; border-color: rgba(255, 255, 255, .14); }
.topbar .tenant-badge i { color: var(--brand-teal-bright); font-size: .85rem; }
.tenant-badge.platform, .topbar .tenant-badge.platform { background: rgba(200, 146, 31, .14); color: var(--brand-gold-light); border-color: rgba(230, 177, 74, .45); }
.topbar .tenant-badge.platform i { color: var(--brand-gold-light); }
.version-badge {
    align-items: center; gap: .3rem; padding: .16rem .6rem; border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .06); color: var(--brand-gold-light); border: 1px solid rgba(255, 255, 255, .12);
    font-family: Consolas, "Courier New", monospace; font-size: .68rem; font-weight: 700; white-space: nowrap;
}
.topbar .btn-outline-accent { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .3); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--cta); --bs-btn-hover-border-color: var(--cta); background: transparent; }
.user-chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; border: 0; background: none; color: var(--ink-2); font-size: .8rem; font-weight: 600; }
.topbar .user-chip { color: #fff; }
.topbar .user-chip.dropdown-toggle::after { color: rgba(255, 255, 255, .7); }
.user-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: .72rem; }
.topbar .user-avatar { background: var(--brand-offwhite); color: var(--chrome); box-shadow: 0 0 0 2px rgba(34, 165, 150, .55); }

.app-content { flex: 1 1 auto; padding: 12px var(--gutter) 18px; max-width: 1680px; width: 100%; }

/* Thin teal / gold progress line while the next page loads */
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; pointer-events: none; opacity: 0; overflow: hidden; }
.nav-progress::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, var(--brand-teal-bright), var(--brand-gold-light)); }
body.navigating .nav-progress { opacity: 1; }
body.navigating .nav-progress::before { animation: nav-progress 1s ease-in-out infinite; }
@keyframes nav-progress { 0% { left: -40%; } 100% { left: 100%; } }

/* Collapsed (icon) mode - desktop: section headers and items show icons only; every item stays reachable */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-min); }
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-min); }
body.sidebar-collapsed .sidebar .sidebar-brand-text,
body.sidebar-collapsed .sidebar .brand-divider,
body.sidebar-collapsed .sidebar .sidebar-link span,
body.sidebar-collapsed .sidebar .nav-badge,
body.sidebar-collapsed .sidebar .sidebar-search,
body.sidebar-collapsed .sidebar .sidebar-section-name,
body.sidebar-collapsed .sidebar .sidebar-section-count,
body.sidebar-collapsed .sidebar .sidebar-section-alert,
body.sidebar-collapsed .sidebar .sidebar-section-chevron,
body.sidebar-collapsed .sidebar .sidebar-username,
body.sidebar-collapsed .sidebar .sidebar-footer form { display: none; }
body.sidebar-collapsed .sidebar .sidebar-brand { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar .sidebar-link { justify-content: center; padding-left: 0; padding-right: 0; margin-right: 0; border-radius: 0; }
body.sidebar-collapsed .sidebar .sidebar-menu > .nav > .nav-item:not(.sidebar-section) > .sidebar-link { margin: .1rem .4rem; }
body.sidebar-collapsed .sidebar .sidebar-section-header { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .sidebar .sidebar-section-items { margin-left: 0; border-left: 0; }
body.sidebar-collapsed .sidebar .sidebar-footer { justify-content: center; }

.sidebar-overlay { display: none; }

/* Phone / small tablet: sidebar becomes a slide-in drawer */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: min(84vw, 280px); box-shadow: var(--shadow-h); }
    .app-main, body.sidebar-collapsed .app-main { margin-left: 0; }
    body.sidebar-collapsed .sidebar { width: min(84vw, 280px); }
    body.sidebar-collapsed .sidebar .sidebar-brand-text,
    body.sidebar-collapsed .sidebar .brand-divider,
    body.sidebar-collapsed .sidebar .sidebar-link span,
    body.sidebar-collapsed .sidebar .nav-badge,
    body.sidebar-collapsed .sidebar .sidebar-search,
    body.sidebar-collapsed .sidebar .sidebar-section-name,
    body.sidebar-collapsed .sidebar .sidebar-section-count,
    body.sidebar-collapsed .sidebar .sidebar-section-chevron,
    body.sidebar-collapsed .sidebar .sidebar-username,
    body.sidebar-collapsed .sidebar .sidebar-footer form { display: revert; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(15, 23, 42, .45); }
    .sidebar-link, .sidebar-section-header { padding-top: .5rem; padding-bottom: .5rem; font-size: .86rem; }
    .sidebar-section-header { font-size: .7rem; }
    .user-chip .user-name { display: none; }
    .topbar-crumb { display: none; }
    .topbar-brand { display: inline-flex; }
    .tenant-badge { padding: .12rem .5rem; font-size: .7rem; }
    .app-content { padding: 10px 10px calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); }
    .topbar { padding: 0 10px; gap: .35rem; }
    .topbar-title { font-size: .92rem; }
}

/* ---------- Page header / toolbar ---------- */
.page-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem;
    margin: 0 0 .7rem; padding: 0 0 .55rem; border-bottom: 1px solid var(--line);
}
.page-head > div:first-child { flex: 1 1 14rem; min-width: 0; }
.page-head h1 { font-size: 1.08rem; margin: 0; line-height: 1.25; font-weight: 800; letter-spacing: -.015em; color: var(--navy); }
.page-head .sub { color: var(--mut); font-size: .74rem; line-height: 1.35; margin-top: .1rem; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
@media (max-width: 575.98px) {
    .page-head > div:first-child { flex-basis: 0; }
    .page-head h1 { font-size: 1rem; }
    .page-head .sub { font-size: .7rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.section-label { font-size: .64rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--mut); margin: 0 0 .35rem; }

/* ---------- Buttons ---------- */
.btn { font-size: .8rem; font-weight: 500; border-radius: 7px; min-height: 31px; padding: .25rem .75rem; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.btn-sm { font-size: .74rem; min-height: 26px; padding: .15rem .55rem; border-radius: 6px; }
.btn-lg { font-size: .92rem; min-height: 38px; }
.btn i { line-height: 1; }
.btn-primary { --bs-btn-bg: var(--cta); --bs-btn-border-color: var(--cta); --bs-btn-hover-bg: var(--cta-dark); --bs-btn-hover-border-color: var(--cta-dark); --bs-btn-active-bg: var(--cta-darker); --bs-btn-active-border-color: var(--cta-darker); --bs-btn-disabled-bg: var(--cta); --bs-btn-disabled-border-color: var(--cta); font-weight: 600; background-image: linear-gradient(180deg, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, 0) 100%); box-shadow: 0 1px 2px rgba(15, 118, 110, .3); }
.btn-primary:hover { box-shadow: 0 3px 10px rgba(15, 118, 110, .3); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--bg-2); --bs-btn-hover-border-color: var(--line-2); --bs-btn-active-bg: var(--line); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--line-2); background: var(--surface); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-700); --bs-btn-hover-border-color: var(--accent-700); --bs-btn-active-bg: var(--accent-700); }
.btn-outline-accent { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--line-2); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); background: var(--surface); }
.btn-pos { --bs-btn-color: #fff; --bs-btn-bg: var(--pos); --bs-btn-border-color: var(--pos); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #116632; --bs-btn-hover-border-color: #116632; }
.btn-neg { --bs-btn-color: #fff; --bs-btn-bg: var(--neg); --bs-btn-border-color: var(--neg); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #991818; --bs-btn-hover-border-color: #991818; }
.btn-excel { --bs-btn-color: #fff; --bs-btn-bg: var(--pos); --bs-btn-border-color: var(--pos); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #116632; --bs-btn-hover-border-color: #116632; }
/* Bigger touch targets only on phones / tablets (a touch-screen laptop keeps the compact desktop size) */
@media (pointer: coarse) and (max-width: 991.98px) { .btn { min-height: 40px; } .btn-sm { min-height: 34px; } }

/* ---------- Forms ---------- */
.form-control, .form-select { font-size: .8rem; border-color: var(--line-2); border-radius: 6px; min-height: 30px; padding: .22rem .55rem; color: var(--ink); background-color: var(--surface); }
.form-select { padding-right: 1.8rem; background-position: right .5rem center; background-size: 12px 10px; }
textarea.form-control { min-height: 58px; }
.form-control-sm, .form-select-sm { font-size: .74rem; min-height: 26px; padding-top: .12rem; padding-bottom: .12rem; }
.form-control[readonly], .form-control:disabled, .form-select:disabled { background: var(--bg); color: var(--ink-3); }
.form-control:hover:not(:focus):not([readonly]), .form-select:hover:not(:focus) { border-color: var(--mut-2); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .18rem rgba(15, 118, 110, .16); }
.form-control::placeholder { color: var(--mut-2); }
.form-label { font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-3); margin-bottom: .15rem; }
.form-text { font-size: .66rem; color: var(--mut); margin-top: .1rem; line-height: 1.3; }
.form-check { min-height: 1.3rem; font-size: .8rem; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-switch .form-check-input:focus { border-color: var(--accent); }
.input-group-text { font-size: .78rem; padding: .2rem .55rem; background: var(--bg-2); border-color: var(--line-2); color: var(--ink-3); }
.invalid-feedback { font-size: .68rem; }
.row.g-2 { --bs-gutter-y: .55rem; }
/* Dynamic forms (_DynamicForm): sections side by side on wide screens, fields flow in as many columns as fit */
.form-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; align-items: start; }
@media (min-width: 1200px) { .form-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-sections > .sec-wide, .form-sections > .form-section:only-child { grid-column: 1 / -1; } }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .55rem .75rem; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
@media (min-width: 576px) { .field-wide { grid-column: span 2; } }
.field-switch { display: flex; align-items: flex-end; padding-bottom: .2rem; }
/* Save bar: stays in view at the bottom of long forms (above the phone navigation) */
.form-actions {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
    margin: .4rem calc(-1 * var(--gutter)) 0; padding: .5rem var(--gutter);
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 14px rgba(15, 42, 82, .05);
}
@media (max-width: 991.98px) { .form-actions { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); margin: .25rem -10px 0; padding: .5rem 10px; } .form-actions .btn-primary { flex: 1 1 auto; } }
@media (pointer: coarse) and (max-width: 991.98px) { .form-control, .form-select { min-height: 40px; font-size: 16px; } }

/* ---------- Cards / KPI ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header {
    display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
    background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%); border-bottom: 1px solid var(--line-soft);
    font-weight: 700; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; padding: .42rem .75rem; color: var(--navy);
}
.card-header:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card-header > .bi:first-child { color: var(--accent); font-size: .85rem; }
.card-header .btn, .card-header .form-control, .card-header .form-select, .card-header .pill, .card-header a, .card-header .badge { text-transform: none; letter-spacing: 0; }
.card-body { padding: .65rem .75rem; }
.card-footer { background: var(--bg); border-top: 1px solid var(--line-soft); font-size: .76rem; padding: .45rem .75rem; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .55rem; margin-bottom: .8rem; }
@media (max-width: 575.98px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; } }
.kpi {
    position: relative; padding: .55rem .7rem .5rem .85rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--kpi-accent, var(--accent)); }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--kpi-accent, var(--accent)); opacity: .06; pointer-events: none; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-h); }
.kpi-label { font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 1.32rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; margin-top: .12rem; }
.kpi-foot { font-size: .68rem; color: var(--mut); margin-top: .1rem; }
@media (max-width: 575.98px) { .kpi-value { font-size: 1.15rem; } }
.kpi.navy { --kpi-accent: var(--navy); }
.kpi.gold { --kpi-accent: var(--gold); }
.kpi.purple { --kpi-accent: var(--purple); }
.kpi.blue { --kpi-accent: var(--blue); }
/* Optional icon tile (brand sheet KPI cards): <i class="kpi-ico bi bi-..."></i> as the first child */
.kpi-ico {
    position: absolute; top: .5rem; right: .55rem; display: grid; place-items: center;
    width: 1.95rem; height: 1.95rem; border-radius: .6rem; font-size: 1rem;
    color: var(--kpi-accent, var(--accent)); background: color-mix(in srgb, var(--kpi-accent, var(--accent)) 12%, #fff);
}
.kpi-ico + .kpi-label { margin-right: 2.2rem; }
.kpi:has(.kpi-ico)::after { display: none; }
.kpi.pos { --kpi-accent: var(--pos); }
.kpi.neg { --kpi-accent: var(--neg); }
.kpi.warn { --kpi-accent: var(--warn); }
.kpi a.stretched-link { color: inherit; }

/* ---------- Report table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 var(--radius) var(--radius); }
.table { --bs-table-hover-bg: var(--accent-tint); }
.table-report { margin: 0; font-size: .76rem; --bs-table-bg: transparent; }
.table-report > :not(caption) > * > * { padding: .36rem .65rem; border-bottom-color: var(--line-soft); vertical-align: middle; }
.table-report tbody tr:nth-child(even) > * { background: var(--bg); }
.table-report a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table-report a.row-link:hover { color: var(--accent); text-decoration: underline; }
.table-report thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--navy); color: #fff;
    font-size: .62rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; border-bottom: 0;
}
.table-report tfoot td, .table-report tfoot th { background: var(--bg-2); font-weight: 800; color: var(--navy); border-top: 2px solid var(--line-2); }
.table-report tbody tr:hover > * { background: var(--accent-tint); }
.table-report .muted { color: var(--mut); }
.table-report td.col-wide { min-width: 190px; }
.table-report code { color: var(--navy-2); font-size: .72rem; }
.table-report .btn-sm { min-height: 24px; padding: .08rem .5rem; font-size: .7rem; }

/* Phone: list rows become compact cards. First cell = title; other cells = label over value, two per line;
   empty cells (class is-empty) are hidden; a.row-link in the title makes the whole card tappable;
   td.actions-open (a plain "Open" button) is then hidden. */
@media (max-width: 575.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody { display: block; width: 100%; }
    .table-stack tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .75rem; margin: 0 0 .45rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
    .card > .table-wrap > .table-stack { padding: .45rem; }
    .table-stack.table-report > :not(caption) > * > * { padding: 0; border: 0; }
    .table-stack td { display: block; min-width: 0; text-align: left; overflow-wrap: anywhere; }
    .table-stack td.num { text-align: left; }
    .table-stack td::before { content: attr(data-label); display: block; font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut-2); line-height: 1.3; }
    .table-stack td:first-child { grid-column: 1 / -1; font-size: .86rem; font-weight: 700; padding-right: 4.5rem; }
    .table-stack td:first-child::before { content: none; }
    .table-stack td.is-empty, .table-stack td:empty { display: none; }
    .table-stack td.pin { position: absolute; top: .5rem; right: .6rem; }
    .table-stack td.pin::before { content: none; }
    .table-stack td.col-wide { min-width: 0; }
    .table-stack td.actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
    .table-stack td.actions::before { content: none; }
    .table-stack td.actions-open { display: none; }
    .table-stack a.row-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-sm); }
    .table-stack tr:has(a.row-link):active { background: var(--accent-tint); }
}

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: var(--radius-pill); font-size: .7rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.pill-good { background: var(--pos); color: #fff; }
.pill-watch { background: var(--warn-tint); color: var(--warn); border-color: #F3D9B5; }
.pill-alert { background: var(--neg-tint); color: var(--neg); border-color: #F1C7C7; }
.pill-neutral { background: var(--bg-2); color: var(--ink-3); border-color: var(--line); }
.pill-info { background: var(--accent-tint); color: var(--accent-700); border-color: var(--accent-line); }

/* ---------- Filter chips ---------- */
.chip-strip { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
@media (max-width: 575.98px) {
    .chip-strip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -.25rem; margin-right: -.25rem; padding: 0 .25rem .1rem; }
    .chip-strip::-webkit-scrollbar { display: none; }
    .chip-strip .chip { white-space: nowrap; flex: 0 0 auto; }
}
.chip {
    display: inline-flex; align-items: center; gap: .3rem; min-height: 27px;
    padding: .12rem .65rem; border-radius: var(--radius-pill);
    border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
    font-size: .72rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .count { font-family: var(--num); font-variant-numeric: tabular-nums; opacity: .8; }
@media (pointer: coarse) and (max-width: 991.98px) { .chip { min-height: 38px; } }

/* ---------- Tooltips: Title -> Formula -> Source -> Meaning ---------- */
.tooltip { --bs-tooltip-bg: var(--ink); --bs-tooltip-max-width: 320px; --bs-tooltip-font-size: .74rem; font-family: var(--app-font); }
.tooltip .tt-title { font-weight: 700; margin-bottom: .2rem; }
.tooltip .tt-formula { color: var(--gold); font-family: var(--num); }
.tooltip .tt-row { text-align: left; }
[data-bs-toggle="tooltip"][title], [data-bs-toggle="tooltip"][data-bs-original-title] { text-decoration: underline dotted var(--mut-2); text-underline-offset: 3px; cursor: help; }

/* ---------- Empty state / banners / flash ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 1.5rem 1rem; color: var(--mut); text-align: center; font-size: .82rem; }
.empty-state i { font-size: 1.6rem; color: var(--mut-2); }
.data-banner { display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem; margin-bottom: .75rem; border-radius: var(--radius-sm); background: var(--accent-tint); color: var(--accent-700); font-size: .78rem; }
.data-banner.is-warn { background: var(--warn-tint); color: var(--warn); border: 1px solid #F3D9B5; }
.flash { border-radius: var(--radius-sm); font-size: .84rem; padding: .6rem .9rem; }
.flash-ok { background: var(--pos-tint); color: var(--pos); border: 1px solid #CBE7D3; }
.flash-err { background: var(--neg-tint); color: var(--neg); border: 1px solid #F1C7C7; }

/* ---------- Skeleton (loading) ---------- */
.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, var(--line-soft) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; min-height: 1em; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Login / auth pages (brand sheet "Login Screen": construction hero + white panel on navy) ---------- */
.auth-body {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: var(--gutter);
    background-color: var(--chrome-darker);
    background-image: url("/img/brand/skyline-light.svg"), radial-gradient(900px 520px at 88% -5%, rgba(34, 165, 150, .24) 0%, transparent 62%), linear-gradient(160deg, var(--chrome) 0%, var(--chrome-darker) 100%);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: right bottom, center, center;
    background-size: auto 30vh, cover, cover;
}
.auth-card {
    width: 100%; max-width: 900px; min-height: 520px;
    display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    background: var(--surface); border-radius: 18px; overflow: hidden;
    box-shadow: 0 24px 70px rgba(4, 12, 24, .5), 0 0 0 1px rgba(255, 255, 255, .06);
}
.auth-hero {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: .8rem;
    padding: 1.6rem 4.5rem 1.7rem 1.5rem; color: #fff;
    background-color: var(--chrome);
    background-image: url("/img/brand/auth-swoosh.svg"), linear-gradient(180deg, rgba(11, 28, 48, 0) 30%, rgba(11, 28, 48, .5) 64%, rgba(11, 28, 48, .9) 100%), url("/img/brand/auth-site.svg");
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: calc(100% + 1px) 0, center, center bottom;
    background-size: 106px 100%, cover, cover;
    margin-right: -1px;
}
.auth-hero-kicker { font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-gold-light); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.auth-features { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.auth-features li { display: flex; align-items: center; gap: .7rem; font-size: .9rem; font-weight: 600; line-height: 1.15; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.auth-features li > span {
    display: grid; place-items: center; flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%;
    background: rgba(15, 118, 110, .88); border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 3px 10px rgba(0, 0, 0, .35); font-size: 1.05rem; text-shadow: none;
}
.auth-panel { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.auth-head { padding: 1.7rem 1.75rem .2rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-logo { display: block; width: 58px; height: 58px; border-radius: 14px; box-shadow: 0 8px 18px rgba(22, 49, 79, .28); }
.auth-wordmark { margin-top: .6rem; font-size: 1.55rem; font-weight: 700; letter-spacing: .045em; line-height: 1; color: var(--brand-navy); }
.auth-wordmark .brand-accent { color: var(--brand-teal); }
.auth-tagline { display: flex; align-items: center; gap: .45rem; margin-top: .4rem; font-size: .54rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; color: var(--brand-slate); white-space: nowrap; }
.auth-tagline::before, .auth-tagline::after { content: ""; flex: 0 0 auto; width: 1.1rem; height: 2px; background: var(--brand-teal); }
.auth-body-inner { flex: 1 1 auto; padding: 1.1rem 1.75rem 1.4rem; }
.auth-body-inner > h1 { text-align: center; font-size: 1.12rem; color: var(--brand-navy); }
.auth-body-inner > h1 + p { text-align: center; }
.auth-body .form-control, .auth-body .form-select { min-height: 38px; font-size: .86rem; border-radius: 8px; }
.auth-body .btn-primary { min-height: 40px; font-size: .9rem; border-radius: 8px; background-image: var(--cta-grad); }
.auth-body .btn-primary .bi-arrow-right { transition: transform .15s ease; }
.auth-body .btn-primary:hover .bi-arrow-right { transform: translateX(3px); }
.auth-foot { padding: .7rem 1.75rem; background: var(--surface); border-top: 1px solid var(--line-soft); font-size: .72rem; color: var(--mut); display: flex; gap: .4rem; align-items: center; }
.auth-foot i { color: var(--brand-teal); }
/* Field with a leading icon (and an optional show / hide button for passwords - js/shell.js) */
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--mut); font-size: .95rem; pointer-events: none; }
.input-icon > .form-control { padding-left: 2.2rem; }
.input-icon > .form-control.has-reveal { padding-right: 2.4rem; }
.input-icon > .reveal { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 6px; background: none; color: var(--mut); font-size: 1rem; }
.input-icon > .reveal:hover { color: var(--accent); background: var(--bg-2); }
@media (max-width: 767.98px) {
    .auth-body { align-items: flex-start; padding: 12px; background-size: auto 22vh, cover, cover; }
    .auth-card { grid-template-columns: minmax(0, 1fr); max-width: 440px; min-height: 0; }
    .auth-hero {
        min-height: 128px; padding: .9rem 1rem; justify-content: flex-end;
        background-image: linear-gradient(180deg, rgba(11, 28, 48, 0) 20%, rgba(11, 28, 48, .85) 100%), url("/img/brand/auth-site.svg");
        background-repeat: no-repeat, no-repeat; background-position: center, center 70%; background-size: cover, cover;
        border-bottom: 3px solid var(--brand-teal-bright);
    }
    .auth-features { display: none; }
    .auth-head { padding-top: 1.1rem; }
    .auth-body-inner { padding: .9rem 1.1rem 1.1rem; }
    .auth-foot { padding: .6rem 1.1rem; }
}
.otp-input { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; padding-left: .5em; }
.device-state { text-align: center; padding: .4rem 0 .2rem; }
.device-state .icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 1.8rem; margin-bottom: .6rem; }
.device-state.pending .icon { background: var(--warn-tint); color: var(--warn); }
.device-state.blocked .icon { background: var(--neg-tint); color: var(--neg); }
.device-state .msg { font-size: 1.02rem; font-weight: 700; color: var(--ink); }
.device-state.blocked .msg { color: var(--neg); }
.device-state.sent .icon { background: var(--accent-tint); color: var(--accent); }
/* Sign-in link: "or get a one-tap sign-in link" divider, email / WhatsApp buttons side by side, tips on the "check your ..." page */
.auth-or { display: flex; align-items: center; gap: .6rem; margin: .9rem 0 .6rem; color: var(--mut); font-size: .7rem; font-weight: 600; letter-spacing: .02em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.auth-link-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; }
.auth-link-row .btn { min-height: 38px; font-weight: 600; border-radius: 8px; }
.link-tips { list-style: none; margin: 0 0 1rem; padding: .6rem .75rem; display: grid; gap: .4rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: .76rem; color: var(--ink-2); }
.link-tips li { display: flex; gap: .5rem; align-items: flex-start; line-height: 1.35; }
.link-tips i { color: var(--accent); flex: 0 0 auto; margin-top: .05rem; }

/* ---------- Offline page ---------- */
.offline-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); text-align: center; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .sidebar-overlay, .no-print { display: none !important; }
    .app-main { margin: 0 !important; }
    .card, .kpi { box-shadow: none; }
    body { background: #fff; }
}

/* ---- Modules (Stage 0.4) ---- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem; }
.module-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .75rem; display: flex; flex-direction: column; gap: .45rem; box-shadow: var(--shadow); }
.module-card.is-on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.module-card-head { display: flex; align-items: flex-start; gap: .55rem; }
.module-icon { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: .55rem; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-700); font-size: 1rem; }
.module-card:not(.is-on) .module-icon { background: var(--bg-2); color: var(--mut); }
.module-name { font-weight: 700; font-size: .88rem; line-height: 1.2; }
.module-desc { color: var(--mut); font-size: .74rem; line-height: 1.3; }
.text-truncate-wrap { min-width: 0; }
.module-links { display: flex; flex-wrap: wrap; gap: .2rem .7rem; font-size: .72rem; color: var(--ink-3); }
.module-meta { font-size: .7rem; color: var(--mut-2); }
.module-switch { display: flex; gap: .35rem; margin-top: auto; }
.module-switch .form-control { min-width: 0; }
.module-switch .btn { white-space: nowrap; }

/* ---- Phone bottom navigation (Stage 0.5) ---- */
.bottom-nav { display: none; }
@media (max-width: 991.98px) {
    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1032;
        display: grid; grid-template-columns: repeat(4, 1fr);
        height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .97); backdrop-filter: saturate(1.4) blur(8px);
        border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15, 42, 82, .06);
    }
    .bottom-nav a, .bottom-nav button {
        position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
        border: 0; background: none; color: var(--ink-3); font-size: .66rem; font-weight: 600; text-decoration: none;
    }
    .bottom-nav i { font-size: 1.2rem; line-height: 1; }
    .bottom-nav .active { color: var(--accent); }
    .bottom-nav .active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand-teal-bright); }
    .bottom-nav .badge-dot { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 1.1rem; padding: 0 .3rem; border-radius: var(--radius-pill); background: var(--brand-gold-grad); color: var(--hl-ink); font-size: .62rem; font-weight: 800; line-height: 1.1rem; text-align: center; }
    body.sidebar-open .bottom-nav { display: none; }
}

/* ---- Dashboard module tiles (Stage 0.5) ---- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; }
.tile { display: flex; align-items: center; gap: .55rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .82rem; text-decoration: none; box-shadow: var(--shadow); }
.tile i { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: .5rem; background: var(--accent-tint); color: var(--accent-700); font-size: 1rem; flex: 0 0 auto; }
.tile:hover { border-color: var(--accent); color: var(--accent-700); }
@media (max-width: 575.98px) { .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Document line grids (Stage 4) ---- */
.table-lines td { vertical-align: top; }
.table-lines select[data-name$="ItemId"] { min-width: 15rem; }
.table-lines input[data-name$="Quantity"], .table-lines input[data-name$="Rate"] { min-width: 6.5rem; }
/* Wide line grids (booking applicants): boxes keep a readable width on desktop; the table scrolls sideways instead of squeezing */
@media (min-width: 768px) { .table-lines-wide td .form-control, .table-lines-wide td .form-select { min-width: 8.5rem; } }
@media (max-width: 575.98px) {
    .table-lines td[data-line-no] { display: none; }
    .table-lines td[data-label="Item"] { grid-column: 1 / -1; }
    .table-lines select[data-name$="ItemId"] { min-width: 0; }
}

/* ---- Printable documents (purchase order, ...) ---- */
.print-page { background: var(--app-bg); }
.print-sheet { max-width: 210mm; margin: 1rem auto; padding: 14mm 12mm; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.print-sheet .table { font-size: .74rem; }
.print-sheet thead th { background: var(--bg-2); }
@media print { html:has(> body.print-page), .print-page { background: #fff !important; } .print-sheet { margin: 0; padding: 0; border: 0; box-shadow: none; max-width: none; } }
/* _PrintLayout: letterhead, status band, signatures, footer (every printed document) */
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: .6rem; margin-bottom: .8rem; border-bottom: 2px solid var(--navy); }
.print-company { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.print-address { font-size: .78rem; color: var(--ink-2); white-space: pre-line; }
.print-title { font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--navy); }
.print-status { margin: 0 0 .8rem; padding: .3rem .6rem; border: 1px solid var(--warn); background: var(--warn-tint); color: var(--warn); font-size: .78rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.print-sheet .print-block { font-size: .8rem; margin-bottom: .8rem; }
.print-sheet .print-words { font-size: .78rem; font-style: italic; margin: .2rem 0 .6rem; }
.print-sheet .print-note { font-size: .78rem; white-space: pre-line; }
.print-sheet .print-fill { min-height: 3rem; border-bottom: 1px solid var(--line-2); margin-bottom: .6rem; }
.print-signs { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3.2rem; font-size: .78rem; }
.print-signs > div { flex: 1; text-align: center; border-top: 1px solid var(--ink-3); padding-top: .3rem; }
.print-foot { margin-top: 1.2rem; padding-top: .4rem; border-top: 1px solid var(--line); font-size: .68rem; color: var(--mut); text-align: center; }
@media print { .print-head { break-inside: avoid; } .print-signs { break-inside: avoid; } .print-sheet tr { break-inside: avoid; } }
/* A document's total row prints once, at the end - not at the foot of every page (browsers repeat a table's tfoot). */
@media print { .print-sheet .table > tfoot { display: table-row-group; } }
.lh-copy { display: inline-block; margin-bottom: .25rem; padding: .05rem .45rem; border: 1px solid currentColor; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lh-primary, var(--navy)); }
.print-copy-next { margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--line-2); }
@media print { .print-copy-next { margin-top: 0; padding-top: 0; border-top: 0; break-before: page; } }

/* Company letterhead (Configuration > Letterhead): colours come from the company's letterhead (--lh-primary / --lh-accent);
   header and footer repeat on every printed page, the document prints between them in a smaller font. */
.lh-sheet { --lh-text: color-mix(in srgb, var(--lh-primary) 78%, #000); --lh-accent-text: color-mix(in srgb, var(--lh-accent) 82%, #000);
    position: relative; display: flex; flex-direction: column; min-height: 297mm; padding: 7mm 12mm; overflow: hidden; font-size: 8.5pt; line-height: 1.35; color: var(--ink); }
.lh-sheet .table { font-size: 8pt; line-height: 1.3; margin-bottom: .5rem; }
.lh-sheet .table > :not(caption) > * > * { padding: .18rem .3rem; }
.lh-sheet .print-block, .lh-sheet .print-note { font-size: 8.5pt; margin-bottom: .5rem; }
.lh-sheet .print-words { font-size: 8pt; }
.lh-sheet .print-signs { margin-top: 2.4rem; font-size: 8pt; }
.lh-sheet .print-foot { margin-top: .6rem; font-size: 6.5pt; }
.lh-sheet .print-status { font-size: 8pt; padding: .2rem .5rem; margin-bottom: .5rem; }
.lh-sheet .section-label { font-size: 7pt; }
.lh-head { position: relative; z-index: 1; }
.lh-head-row { display: flex; align-items: center; gap: 4mm; height: 14mm; }
.lh-logo { height: 14mm; width: auto; }
.lh-brand { min-width: 0; }
.lh-name { font-family: Cambria, Georgia, "Times New Roman", serif; font-weight: 700; line-height: 1.1; letter-spacing: .01em; white-space: nowrap; color: var(--lh-primary); }
.lh-tagline { margin-top: 1.2mm; font-family: Calibri, Carlito, var(--app-font); font-size: 6.5pt; font-weight: 700; letter-spacing: .26em; white-space: nowrap; color: var(--lh-accent-text); }
.lh-dot { margin: 0 .55em; font-size: .8em; color: var(--lh-accent); }
.lh-rule-a { margin-top: 2mm; border-top: 2pt solid var(--lh-accent); }
.lh-rule-b { margin-top: 1.1mm; border-top: .6pt solid var(--lh-primary); }
.lh-frame { position: relative; z-index: 1; width: 100%; border-collapse: collapse; }
.lh-frame > thead > tr > td, .lh-frame > tfoot > tr > td, .lh-frame > tbody > tr > td { padding: 0; border: 0; }
.lh-frame > tbody > tr { break-inside: auto; }
.lh-docband { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 1.5mm 0 1.5mm; margin-bottom: 2.5mm; border-bottom: .6pt solid var(--line-2); }
.lh-docband .print-title { font-size: 11pt; color: var(--lh-primary); }
.lh-ids, .lh-no { font-size: 8pt; color: var(--ink-2); }
.lh-docband .small { font-size: 8pt; }
.lh-foot { position: relative; z-index: 1; margin-top: auto; padding-top: 4mm; font-family: Calibri, Carlito, var(--app-font); font-size: 7pt; line-height: 1.25; color: var(--lh-text); }
.lh-foot-rule { margin-bottom: 1.5mm; border-top: 1.5pt solid var(--lh-accent); }
.lh-offices { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8mm; }
.lh-office-title { font-size: 6.8pt; font-weight: 700; letter-spacing: .08em; color: var(--lh-accent-text); }
.lh-office { white-space: pre-line; }
.lh-band { margin-top: 1.4mm; padding: .9mm 2mm; font-weight: 700; letter-spacing: .03em; text-align: center; color: #fff; background: var(--lh-primary);
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lh-watermark { position: absolute; z-index: 0; top: 50%; left: 50%; width: 140mm; max-width: 80%; transform: translate(-50%, -50%); pointer-events: none; }
.lh-watermark-faded { opacity: .07; }
.lh-paper .lh-sheet { padding-top: var(--lh-top); padding-bottom: var(--lh-bottom); }
.lh-pic { display: flex; align-items: center; justify-content: center; height: 5.5rem; padding: .4rem; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); }
.lh-pic img { max-height: 100%; max-width: 100%; }
@media screen { .lh-space-top, .lh-space-bottom { display: none; } .lh-frame + .lh-frame { margin-top: 8mm; border-top: 1px dashed var(--line-2); } .lh-frame + .lh-frame > tbody > tr > td { padding-top: 4mm; } }
@media print {
    .print-sheet.lh-sheet { display: block; min-height: 0; padding: 0 19mm; overflow: visible; }
    .lh-paper .print-sheet.lh-sheet { padding: 0 19mm; }
    .lh-space-top { height: var(--lh-top); }
    .lh-space-bottom { height: var(--lh-bottom); }
    .lh-printed .lh-head { position: fixed; top: 0; left: 19mm; right: 19mm; padding-top: 7mm; }
    .lh-printed .lh-foot { position: fixed; bottom: 0; left: 19mm; right: 19mm; padding: 0 0 7mm; }
    .lh-watermark { position: fixed; max-width: none; }
    .lh-frame + .lh-frame { break-before: page; }
    .lh-docband { break-after: avoid; }
}

/* ---- Budget use meter and tree rows (Stage 7 costing) ---- */
.use-meter { display: inline-flex; align-items: center; gap: .4rem; }
.use-meter .bar { width: 4.5rem; height: 6px; border-radius: var(--radius-pill); background: var(--bg-2); overflow: hidden; }
.use-meter .bar > span { display: block; height: 100%; max-width: 100%; background: var(--accent); }
.use-meter.near .bar > span { background: var(--warn); }
.use-meter.over .bar > span { background: var(--neg); }
.use-meter .pct { font-family: var(--num); font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; font-size: .72rem; color: var(--ink-3); }
.use-meter.over .pct { color: var(--neg); font-weight: 700; }
.tree-1 { padding-left: 1.4rem !important; }
.tree-2 { padding-left: 2.4rem !important; }
.tree-3 { padding-left: 3.4rem !important; }
@media (max-width: 575.98px) { .tree-1, .tree-2, .tree-3 { padding-left: .75rem !important; } }

/* ---- Date-range filter in a page head: one compact row, also on phones ---- */
.period-filter { display: flex; flex-wrap: nowrap; gap: .3rem; align-items: center; }
.period-filter .form-control { flex: 1 1 0; min-width: 0; max-width: 10.5rem; }
.period-filter .btn { flex: 0 0 auto; }
@media (max-width: 575.98px) {
    .page-head .period-filter { flex: 1 1 100%; margin-left: 0; }
    .page-head .period-filter .form-control { max-width: none; }
}
.card.period-filter { flex-direction: row; } /* Bootstrap's .card is a flex column: keep a filter card on one row */

/* ---- List toolbar inside a card: status chips left, search right; pager in the footer (Email queue) ---- */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; border-bottom: 1px solid var(--line-soft); }
.list-toolbar .chip-strip { margin-bottom: 0; }
.list-search { display: flex; align-items: center; gap: .3rem; flex: 0 1 24rem; min-width: 0; }
.list-search .form-control { flex: 1 1 auto; min-width: 0; }
.list-search .btn { flex: 0 0 auto; }
@media (max-width: 575.98px) { .list-search { flex: 1 1 100%; } }
/* ---- Table search (wwwroot/js/table-search.js): a "Search this list" box above every list / report table ---- */
.table-search { display: flex; align-items: center; gap: .45rem; padding: .4rem .6rem; border-bottom: 1px solid var(--line-soft); }
.table-search > i { color: var(--mut); font-size: .8rem; flex: 0 0 auto; }
.table-search .form-control { flex: 0 1 22rem; min-width: 0; }
.table-search.has-text .form-control { border-color: var(--accent-line); background: var(--accent-tint); }
.table-search-count { margin-left: auto; font-size: .72rem; color: var(--mut); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-search .btn { flex: 0 0 auto; }
form.table-search { margin: 0; }
.list-search-clear { font-size: .74rem; white-space: nowrap; color: var(--accent); text-decoration: none; }
.list-search-clear:hover { text-decoration: underline; }
.table-search-none { padding: .75rem; text-align: center; color: var(--mut); font-size: .8rem; }
@media (max-width: 575.98px) { .table-search .form-control { flex: 1 1 auto; } }
@media print { .table-search, .table-search-none { display: none !important; } }
.list-pager { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.list-pager > span:first-child { margin-right: auto; }
.card-header .header-switch { display: inline-flex; align-items: center; gap: .3rem; min-height: 0; padding-left: 2.2em; }
.card-header .header-switch .form-check-label { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .74rem; color: var(--ink-2); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 992px) {
    .email-queue .eq-to { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .email-queue .eq-subject { min-width: 14rem; }
    .email-queue .eq-error { min-width: 16rem; max-width: 26rem; }
}
.email-queue .actions .btn { white-space: nowrap; }

/* ---- Email & WhatsApp (report schedulers, WhatsApp Bridge) ---- */
.btn-wa { color: var(--pos); border: 1px solid var(--pos); background: var(--surface); }
.btn-wa:hover, .btn-wa:focus { color: #fff; background: var(--pos); border-color: var(--pos); }
.wa-qr { width: 220px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 6px; }
.wa-bubble { max-width: 28rem; background: var(--pos-tint); border: 1px solid var(--line); border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm); padding: .55rem .7rem; font-size: .82rem; line-height: 1.45; }
.wa-file { margin-top: .45rem; padding: .35rem .5rem; border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: .76rem; }
.report-frame { display: block; width: 100%; height: 72vh; border: 0; background: var(--bg-2); }
.chip-sm { min-height: 22px; padding: .05rem .5rem; font-size: .7rem; font-weight: 500; cursor: default; }
.chip-warn { border-color: var(--warn); color: var(--warn); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable[data-dir="asc"]::after { content: " \25B2"; font-size: .6rem; }
th.sortable[data-dir="desc"]::after { content: " \25BC"; font-size: .6rem; }

/* ---- Land & Legal: stage chips, inline edit panels ---- */
.chip-done { background: var(--pos-tint); border-color: var(--pos); color: var(--pos); }
details.inline-edit > summary { list-style: none; display: inline-block; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
details.inline-edit[open] { min-width: 16rem; }
details > summary { cursor: pointer; }
.check-matrix th, .check-matrix td { text-align: center; }
.check-matrix th:first-child, .check-matrix td:first-child { text-align: left; }

/* ---------- Bidding: vendor bid page (public link) and buyer screens ---------- */
.bid-body { background: var(--app-bg); }
.bid-top { background: linear-gradient(90deg, var(--chrome-darker) 0%, var(--chrome) 100%); color: #fff; padding: .75rem 1rem; border-bottom: 3px solid var(--brand-teal-bright); }
.bid-top-inner { max-width: 760px; margin: 0 auto; }
.bid-top .t1 { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.bid-top .t2 { font-size: .76rem; opacity: .9; }
.bid-main { max-width: 760px; margin: 0 auto; padding: .75rem .75rem 2rem; }
.bid-title { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.bid-status-row { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; margin-top: .6rem; }
.bid-clock { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.45rem; color: var(--navy); line-height: 1.1; }
.bid-clock-late { color: var(--neg); }
.bid-overall { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--line-soft); }
.rank-chip { display: inline-block; min-width: 2.7rem; text-align: center; padding: .18rem .55rem; border-radius: var(--radius-pill); font-weight: 800; font-size: .82rem; background: var(--bg-2); color: var(--mut); }
.rank-chip.r1 { background: var(--pos-tint); color: var(--pos); }
.rank-chip.r2 { background: var(--warn-tint); color: var(--warn); }
.rank-chip.r4 { background: var(--neg-tint); color: var(--neg); }
.bid-item { padding: .7rem .8rem; margin-bottom: .5rem; border-left: 3px solid var(--line); }
.bid-item-quoted { border-left-color: var(--accent); }
.bid-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .45rem; }
.bid-item-foot { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .4rem; }
.bid-rate { font-weight: 700; }
.bid-submit { position: sticky; bottom: 0; z-index: 5; margin: 0 -.75rem; padding: .55rem .75rem .6rem; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(15, 42, 82, .08); }
.bid-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; font-family: var(--num); }
.bid-total b { font-size: 1.1rem; color: var(--navy); }
.bid-foot { text-align: center; margin-top: 1rem; line-height: 1.5; }
.vendor-pick { max-height: 18rem; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .15rem .9rem; }
.vendor-pick-item { display: flex; align-items: center; gap: .45rem; font-size: .82rem; padding: .25rem 0; cursor: pointer; }
.bid-board td .pill { font-size: .64rem; }

/* ---------- Projects: project cards, availability board, unit cost sheet ---------- */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem; }
.project-card { display: block; padding: .8rem .9rem; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); color: inherit; }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.pc-code { font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--mut); font-weight: 700; }
.pc-name { font-weight: 800; font-size: 1rem; color: var(--ink); letter-spacing: -.01em; }
.pc-bar { display: flex; height: .45rem; border-radius: var(--radius-pill); background: var(--accent-tint); overflow: hidden; margin: .6rem 0 .5rem; }
.pc-bar .seg { display: block; height: 100%; }
.pc-bar .seg-sold { background: var(--navy); }
.pc-bar .seg-blocked { background: var(--warn); }
.pc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; margin-bottom: .35rem; }
.pc-stats div { display: flex; flex-direction: column; }
.pc-stats b { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 1.05rem; color: var(--navy); }
.pc-stats span { font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; padding: .5rem .9rem; border-top: 1px solid var(--line-soft); font-size: .84rem; }
.list-plain li:first-child { border-top: 0; }
.list-plain li .pill { margin-left: auto; }
.dl-compact { display: grid; grid-template-columns: 8.5rem 1fr; gap: .3rem .75rem; margin: 0; font-size: .84rem; }
.dl-compact dt { color: var(--mut); font-weight: 600; }
.dl-compact dd { margin: 0; }
.ub-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .74rem; color: var(--ink-3); margin: .2rem 0 .6rem; }
.ub-legend span::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -.1rem; border: 1px solid var(--line-2); }
.ub-legend .l-available::before { background: var(--accent-tint); border-color: var(--accent-line); }
.ub-legend .l-blocked::before { background: var(--warn-tint); border-color: #F3D9B5; }
.ub-legend .l-booked::before { background: #DCE6F3; border-color: #BFD0E6; }
.ub-legend .l-sold::before { background: var(--navy); border-color: var(--navy); }
.ub-legend .l-notforsale::before { background: var(--bg-2); }
.unit-board { overflow-x: auto; padding: .6rem .7rem .7rem; }
.ub-floor { display: flex; align-items: stretch; gap: .35rem; margin-bottom: .35rem; min-width: max-content; }
.ub-label { width: 2.4rem; flex: 0 0 2.4rem; display: flex; align-items: center; justify-content: center; font-family: var(--num); font-weight: 700; font-size: .74rem; color: var(--mut); background: var(--bg); border-radius: var(--radius-sm); }
.ub-tile { width: 5.6rem; padding: .32rem .4rem; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--ink); line-height: 1.15; position: relative; }
.ub-tile:hover { box-shadow: var(--shadow-h); color: var(--ink); }
.ub-tile .no { display: block; font-weight: 800; font-size: .8rem; }
.ub-tile .meta { display: block; font-size: .64rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ub-tile .plc { position: absolute; top: .25rem; right: .3rem; font-size: .6rem; color: var(--gold); }
.ub-available { background: var(--accent-tint); border-color: var(--accent-line); }
.ub-blocked { background: var(--warn-tint); border-color: #F3D9B5; }
.ub-booked { background: #DCE6F3; border-color: #BFD0E6; }
.ub-sold { background: var(--navy); border-color: var(--navy); color: #fff; }
.ub-sold .meta { color: #C9D6EA; }
.ub-sold:hover { color: #fff; }
.ub-notforsale { background: repeating-linear-gradient(135deg, var(--bg-2), var(--bg-2) 6px, var(--surface) 6px, var(--surface) 12px); color: var(--mut); }
.sheet-total td { font-weight: 800; color: var(--navy); border-top: 2px solid var(--line-2); }
.ub-star { color: var(--gold); }
.ub-legend .l-none::before { display: none; }
.boq-heading td { background: var(--bg); font-weight: 700; }
.kpi-value.small-value { font-size: .95rem; font-family: inherit; letter-spacing: 0; word-break: break-all; }
/* ---------- Site: schedule progress, inspection choices ---------- */
.progress-mini { display: inline-block; width: 3.5rem; height: .4rem; margin-right: .35rem; vertical-align: middle; border-radius: var(--radius-pill); background: var(--bg-2); overflow: hidden; }
.progress-mini span { display: block; height: 100%; background: var(--accent); }
.check-item { padding: .65rem .8rem; border-left: 3px solid var(--line); }
.check-critical { border-left-color: var(--warn); }
.check-choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.check-choice { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; border: 1px solid var(--line-2); border-radius: var(--radius-pill); font-size: .82rem; font-weight: 600; cursor: pointer; background: var(--surface); }
.check-choice input { accent-color: var(--accent); }
.check-choice.check-pass:has(input:checked) { background: var(--pos-tint); border-color: var(--pos); color: var(--pos); }
.check-choice.check-fail:has(input:checked) { background: var(--neg-tint); border-color: var(--neg); color: var(--neg); }
.check-choice.check-notapplicable:has(input:checked) { background: var(--bg-2); border-color: var(--mut-2); color: var(--ink-3); }
.text-neg { color: var(--neg) !important; }
.text-pos { color: var(--pos) !important; }

/* Stage 11 sales: KPI tiles as links, printed letters (allotment, demand, receipt) */
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { box-shadow: var(--shadow-h); }
.letter .card-body { padding: 1.5rem; line-height: 1.5; }
.letter p { margin-bottom: .75rem; }
@media print { .letter { border: 0; box-shadow: none; } .letter .card-body { padding: 0; } }

/* ---------- portal for customers, brokers and vendors (Stage 14) ---------- */
.portal-body { min-height: 100vh; }
.portal-wrap { max-width: 1100px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.portal-top { background: linear-gradient(90deg, var(--chrome-darker) 0%, var(--chrome) 100%); color: #fff; padding: .55rem 0; border-bottom: 3px solid var(--brand-teal-bright); }
.portal-brand { color: #fff; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: .45rem; }
.portal-brand:hover { color: #fff; }
.portal-mark { display: block; width: 1.8rem; height: 1.8rem; }
.portal-nav { background: var(--surface); border-bottom: 1px solid var(--line); padding: .4rem 0; }
.portal-login { max-width: 420px; margin: 2rem auto; }
.mis-bar { height: .55rem; border-radius: var(--radius-pill); background: var(--accent); min-width: 2px; }
.mis-bar-track { background: var(--bg-2); border-radius: var(--radius-pill); }
@media print { .portal-top, .portal-nav, footer { display: none !important; } }

/* ---------- approval bar and notifications bell (Stage 15) ---------- */
.approval-bar { border-left: 4px solid var(--accent); position: sticky; top: calc(var(--topbar-h) + 4px); z-index: 20; }
.bell { position: relative; text-decoration: none; }
.bell-count { position: absolute; top: -2px; right: -4px; min-width: 1.1rem; height: 1.1rem; padding: 0 .25rem; border-radius: var(--radius-pill); background: var(--brand-gold-grad); color: var(--hl-ink); font-size: .62rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--chrome-dark); }
.note-unread { border-left: 3px solid var(--accent); }
.photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* ---------- Setup pages (Email setup, WhatsApp Bridge activation) ---------- */
.text-accent { color: var(--accent) !important; }
.setup-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .55rem; }
.setup-status .kpi-value.small-value { font-size: .92rem; font-weight: 800; word-break: normal; overflow-wrap: anywhere; }
.setup-status .kpi-foot { line-height: 1.3; }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; align-items: start; }
@media (min-width: 1200px) { .setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.setup-grid > .form-actions { grid-column: 1 / -1; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: .55rem; }
.steps > li { counter-increment: step; position: relative; padding: .1rem 0 .1rem 2.3rem; font-size: .8rem; line-height: 1.45; }
.steps > li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 800; font-size: .78rem;
}
.steps > li.done::before { content: "\2713"; background: var(--pos); }
.steps > li b { color: var(--navy); }
.steps code { font-size: .74rem; background: var(--bg-2); padding: .05rem .3rem; border-radius: 4px; }
.qr-wait { display: grid; place-items: center; gap: .35rem; min-height: 230px; border: 2px dashed var(--line-2); border-radius: var(--radius); color: var(--mut); text-align: center; padding: 1rem; font-size: .8rem; }
.qr-wait > i { font-size: 2.2rem; color: var(--mut-2); }
.qr-wait form { margin: 0; }

/* ---------- Dashboard welcome band ---------- */
.hero {
    position: relative; overflow: hidden;
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
    margin-bottom: .8rem; padding: .9rem 1.1rem; border-radius: var(--radius);
    background-color: var(--navy);
    background-image: url("/img/brand/skyline-light.svg"), linear-gradient(120deg, var(--chrome-darker) 0%, var(--navy) 38%, var(--navy-2) 68%, var(--accent-700) 100%);
    background-repeat: no-repeat, no-repeat; background-position: right bottom, center; background-size: auto 100%, cover;
    color: #fff; box-shadow: var(--shadow);
}
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--brand-gold-light) 0%, var(--brand-gold) 22%, var(--brand-teal-bright) 60%, transparent 100%); pointer-events: none; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .05); pointer-events: none; }
.hero-text { flex: 1 1 18rem; min-width: 0; position: relative; z-index: 1; }
.hero-kicker { font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.hero h1 { margin: .1rem 0 .15rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.hero-sub { font-size: .76rem; color: rgba(255, 255, 255, .82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .4rem; position: relative; z-index: 1; }
.hero-btn {
    display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .7rem; border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: .76rem; font-weight: 600; text-decoration: none;
}
.hero-btn:hover { background: #fff; color: var(--navy); }
.hero-btn b { min-width: 1.2rem; padding: 0 .3rem; border-radius: var(--radius-pill); background: var(--brand-gold-grad); color: var(--hl-ink); font-size: .64rem; text-align: center; }

/* ---------- Company setup (master codes, automatic chart) ---------- */
.card-header .header-hint { font-size: .68rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--mut); }
.setup-switch { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.setup-switch > div { flex: 1 1 20rem; min-width: 0; }
.code-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .72rem; color: var(--ink-3); }
.code-legend code { font-size: .7rem; background: var(--bg-2); padding: 0 .25rem; border-radius: 4px; }
.code-table select { min-width: 12.5rem; }
.code-table input[name="format"] { min-width: 9rem; max-width: 14rem; }
.note-box { min-width: 16rem; }
.bridge-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.bridge-controls form { margin: 0; }

/* Required fields (wwwroot/js/forms.js marks the label or the line-grid column heading of every [required] field) */
.is-required::after { content: " *"; color: var(--neg); font-weight: 700; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--neg); }

/* ---------- Pop-up messages (dialog.js): replace the browser's "localhost says" boxes ---------- */
.erp-dialog { padding: 0; border: 0; background: transparent; max-width: min(480px, calc(100vw - 24px)); width: 100%; overflow: visible; }
.erp-dialog::backdrop { background: rgba(11, 28, 48, .55); backdrop-filter: blur(3px); }
.erp-dialog[open] { animation: erp-dialog-in .16s ease-out; }
.erp-dialog.closing { animation: erp-dialog-out .12s ease-in forwards; }
@keyframes erp-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes erp-dialog-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
.erp-dialog-card { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(11, 28, 48, .35), 0 0 0 1px rgba(22, 49, 79, .08); }
.erp-dialog-card::before { content: ""; display: block; height: 4px; background: var(--dlg-accent, var(--brand-teal)); }
.erp-dialog-head { display: flex; align-items: flex-start; gap: .8rem; padding: 1.05rem 1.1rem .35rem; }
.erp-dialog-icon { flex: 0 0 auto; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; font-size: 1.35rem; color: var(--dlg-accent, var(--brand-teal)); background: var(--dlg-tint, var(--accent-tint)); }
.erp-dialog-headtext { flex: 1 1 auto; min-width: 0; padding-top: .1rem; }
.erp-dialog-kicker { font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dlg-accent, var(--brand-teal)); }
.erp-dialog-title { margin: .1rem 0 0; font-size: 1.08rem; font-weight: 800; line-height: 1.25; color: var(--brand-navy); overflow-wrap: anywhere; }
.erp-dialog-x { flex: 0 0 auto; display: grid; place-items: center; width: 2rem; height: 2rem; margin: -.2rem -.3rem 0 0; border: 0; border-radius: 8px; background: none; color: var(--mut); }
.erp-dialog-x:hover { background: var(--bg-2); color: var(--ink); }
.erp-dialog-body { padding: .35rem 1.1rem .9rem calc(1.1rem + 2.6rem + .8rem); }
.erp-dialog-msg { margin: 0 0 .45rem; font-size: .9rem; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.erp-dialog-details { list-style: none; margin: .35rem 0 0; padding: .5rem .65rem; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-soft); display: grid; gap: .25rem; }
.erp-dialog-details li { display: flex; gap: .2rem; align-items: flex-start; font-size: .76rem; line-height: 1.4; color: var(--ink-3); }
.erp-dialog-details li i { color: var(--dlg-accent, var(--brand-teal)); font-size: 1rem; line-height: 1; margin-top: -.05rem; }
.erp-dialog-copy { display: flex; gap: .4rem; margin-top: .5rem; }
.erp-dialog-copy .form-control { font-family: Consolas, "Courier New", monospace; font-size: .76rem; min-height: 36px; }
.erp-dialog-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; padding: .75rem 1.1rem; background: var(--bg); border-top: 1px solid var(--line-soft); }
.erp-dialog-foot .btn { min-width: 6.5rem; min-height: 36px; font-weight: 600; border-radius: 8px; }
.erp-dialog.tone-success { --dlg-accent: var(--pos); --dlg-tint: var(--pos-tint); }
.erp-dialog.tone-warn { --dlg-accent: var(--warn); --dlg-tint: var(--warn-tint); }
.erp-dialog.tone-danger, .erp-dialog.tone-error { --dlg-accent: var(--neg); --dlg-tint: var(--neg-tint); }
.erp-dialog.tone-info { --dlg-accent: var(--brand-navy); --dlg-tint: #E8EEF5; }
@media (max-width: 575.98px) {
    .erp-dialog { margin: auto auto 0; max-width: 100vw; }
    .erp-dialog-card { border-radius: 16px 16px 0 0; }
    .erp-dialog-body { padding-left: 1.1rem; }
    .erp-dialog-foot { padding-bottom: calc(.75rem + env(safe-area-inset-bottom)); }
    .erp-dialog-foot .btn { flex: 1 1 0; }
}
.erp-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2100; display: grid; gap: .5rem; max-width: min(380px, calc(100vw - 32px)); }
.erp-toast { display: flex; align-items: flex-start; gap: .55rem; padding: .65rem .85rem; border-radius: 12px; background: var(--brand-navy); color: #fff; font-size: .82rem; line-height: 1.35; box-shadow: 0 10px 30px rgba(11, 28, 48, .3); animation: erp-dialog-in .18s ease-out; border-left: 4px solid var(--brand-teal-bright); }
.erp-toast i { font-size: 1.05rem; color: var(--brand-teal-bright); }
.erp-toast.tone-warn, .erp-toast.tone-error, .erp-toast.tone-danger { border-left-color: var(--brand-gold-light); }
.erp-toast.tone-warn i, .erp-toast.tone-error i, .erp-toast.tone-danger i { color: var(--brand-gold-light); }
.erp-toast.closing { animation: erp-dialog-out .25s ease-in forwards; }
@media (max-width: 991.98px) { .erp-toasts { bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom)); left: 16px; right: 16px; } }
/* Error log detail: the full exception / stack, scrollable */
.error-detail { margin: 0; max-height: 28rem; overflow: auto; padding: .7rem .8rem; border-radius: var(--radius-sm); background: #0F1E31; color: #DCE6F2; font-family: Consolas, "Courier New", monospace; font-size: .72rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.error-ref { display: inline-flex; align-items: center; gap: .35rem; margin: .2rem 0 .8rem; padding: .25rem .6rem; border-radius: var(--radius-pill); background: var(--bg-2); color: var(--ink-2); font-family: Consolas, "Courier New", monospace; font-size: .72rem; }
/* Finance day book: vouchers of a day, each with its ledger lines (compact on phones) */
.daybook-voucher { padding: .55rem .9rem .5rem; border-top: 1px solid var(--line-soft); }
.daybook-voucher:first-of-type { border-top: 0; }
.daybook-voucher.is-reversal { background: var(--warn-tint); }
.daybook-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; font-size: .82rem; }
.daybook-head .daybook-amount { margin-left: auto; font-family: var(--num); font-weight: 600; color: var(--ink); }
.daybook-narration { font-size: .76rem; color: var(--ink-3); margin: .1rem 0 .3rem; overflow-wrap: anywhere; }
.daybook-lines { margin: 0; font-size: .76rem; }
.daybook-lines td { padding: .18rem .35rem; border-color: var(--line-soft); vertical-align: top; }
.daybook-lines td.num { width: 7.5rem; white-space: nowrap; font-family: var(--num); }
.daybook-lines tr.is-picked td { background: var(--gold-tint); font-weight: 600; }
.daybook-lines tr.daybook-total td { font-weight: 600; border-top: 1px solid var(--line-2); }
.daybook-day-total { display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: flex-end; padding: .45rem .9rem; background: var(--bg); border-top: 1px solid var(--line); font-size: .78rem; font-weight: 600; font-family: var(--num); }
@media (max-width: 575.98px) {
    .daybook-voucher { padding: .5rem .65rem; }
    .daybook-lines td.num { width: 5.6rem; }
}
/* Nominees / transfer applicants side by side */
.party-swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: start; }
.party-swap .swap-arrow { align-self: center; color: var(--accent); font-size: 1.3rem; }
@media (max-width: 767.98px) { .party-swap { grid-template-columns: 1fr; } .party-swap .swap-arrow { transform: rotate(90deg); justify-self: center; } }

/* Phone notifications (Web Push): switch card on the Notifications page + one-time prompt on the dashboard */
.push-row { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.push-ico { color: var(--accent); font-size: 1.35rem; line-height: 1; margin-top: .1rem; }
.push-text { flex: 1 1 16rem; min-width: 0; }
.push-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.push-why { color: var(--warn); }
.push-prompt { border-left: 4px solid var(--accent); }

/* ---------- GST e-invoice / e-way bill (IRN block with the signed QR on prints, TEST stamp of the Sandbox) ---------- */
.gst-block { display: flex; gap: 1rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem; margin: .75rem 0; background: var(--surface); break-inside: avoid; }
.gst-block .gst-qr { width: 132px; height: 132px; flex: 0 0 auto; image-rendering: pixelated; }
.gst-block .gst-lines { font-size: .78rem; line-height: 1.45; min-width: 0; }
.gst-irn { font-family: Consolas, "Courier New", monospace; font-size: .72rem; word-break: break-all; }
.gst-test { display: inline-block; margin: .25rem 0; padding: .15rem .5rem; border: 2px solid var(--neg); color: var(--neg); background: var(--neg-tint); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .72rem; }
.gst-cancelled { color: var(--neg); font-weight: 700; text-transform: uppercase; }
.gst-json { max-height: 28rem; overflow: auto; font-size: .7rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; white-space: pre; }
.gst-qr-large { width: 220px; height: 220px; image-rendering: pixelated; }
.ewb-items input { min-width: 4.5rem; }
@media (max-width: 575.98px) { .gst-block { flex-direction: column; } }

/* ---------- Users page: sign-in link (one / ticked users), session state, Sign out (24-Nov-2026) ---------- */
.users-bulk { padding: .45rem .75rem; }
.users-bulk-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.table-report .col-check { width: 2.2rem; text-align: center; }
.session-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 600; color: var(--mut); }
.session-chip .bi { font-size: .5rem; }
.session-chip.on { color: var(--accent-700); }
.session-chip.on .bi { color: var(--brand-teal-bright); }
.user-actions { display: inline-flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.user-actions form { margin: 0; }
@media (max-width: 767.98px) { .user-actions { justify-content: flex-start; } .table-report .col-check { width: auto; text-align: left; } }

/* ---------- Management dashboard, pro look (MIS, 24-Nov-2026): band + headline figures, section chips, panels, column / split charts ---------- */
.mis-hero { display: block; padding: 1rem 1.15rem 1.05rem; margin-bottom: .55rem; }
.mis-hero-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; position: relative; z-index: 1; }
.mis-hero-top .hero-text { flex: 1 1 16rem; }
.mis-hero .hero-sub { display: flex; flex-wrap: wrap; gap: .15rem .9rem; }
.mis-hero .hero-sub .bi { opacity: .75; margin-right: .2rem; }
.mis-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .45rem; position: relative; z-index: 1; }
.mis-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .45rem; margin: 0; }
.mis-filter label { display: block; font-size: .58rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .66); margin-bottom: .18rem; }
.mis-filter .form-select {
    min-width: 11rem; font-weight: 600; color: #fff; background-color: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .24);
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.mis-filter .form-select:hover { background-color: rgba(255, 255, 255, .16); }
.mis-filter .form-select:focus { border-color: var(--brand-teal-bright); box-shadow: 0 0 0 .2rem rgba(34, 165, 150, .35); }
.mis-filter .form-select option { color: var(--ink); background: var(--surface); }
.mis-filter .mis-company { min-width: 15rem; max-width: 22rem; }
.mis-month { display: flex; align-items: stretch; }
.mis-month .form-select { border-radius: 0; min-width: 8.5rem; }
.mis-step { display: grid; place-items: center; width: 2rem; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .24); text-decoration: none; }
.mis-step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.mis-step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.mis-step:hover { background: #fff; color: var(--navy); }
.mis-step.disabled { opacity: .35; pointer-events: none; }
.mis-tools .hero-btn { padding: .38rem .75rem; }
.mis-heads { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-top: .95rem; }
.mis-head {
    position: relative; display: block; min-width: 0; padding: .55rem .7rem .55rem .85rem; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; text-decoration: none;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background .15s ease, transform .15s ease;
}
.mis-head::before { content: ""; position: absolute; left: 0; top: .6rem; bottom: .6rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--mis-head-accent, rgba(255, 255, 255, .45)); }
.mis-head.pos { --mis-head-accent: var(--pos-on-dark); }
.mis-head.neg { --mis-head-accent: var(--neg-on-dark); }
.mis-head.navy, .mis-head.gold { --mis-head-accent: var(--brand-gold-light); }
a.mis-head[href]:hover { background: rgba(255, 255, 255, .17); color: #fff; transform: translateY(-1px); }
.mis-head-label > span { overflow: hidden; text-overflow: ellipsis; }
.mis-head-label { display: flex; align-items: center; gap: .35rem; font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .74); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mis-head-label .bi { font-size: .8rem; color: var(--mis-head-accent, rgba(255, 255, 255, .8)); }
.mis-head-value { display: block; margin-top: .15rem; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.mis-head-foot { display: block; margin-top: .12rem; font-size: .66rem; color: rgba(255, 255, 255, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Section chips: one per area, sticky under the top bar; the one in view is navy (mis.js) */
.mis-nav {
    position: sticky; top: var(--topbar-h); z-index: 15; display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none;
    margin: 0 0 .6rem; padding: .4rem 0; background: color-mix(in srgb, var(--app-bg) 90%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.mis-nav::-webkit-scrollbar { display: none; }
.mis-nav a {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .7rem; border-radius: var(--radius-pill);
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .74rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.mis-nav a .bi { color: var(--accent); }
.mis-nav a:hover { border-color: var(--accent-line); color: var(--accent-700); }
.mis-nav a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.mis-nav a.active .bi { color: var(--brand-teal-bright); }
.mis-nav-alert { min-width: 1.05rem; height: 1.05rem; padding: 0 .28rem; border-radius: var(--radius-pill); background: var(--neg); color: #fff; font-size: .6rem; font-weight: 800; display: inline-grid; place-items: center; }

/* Panels: wide ones (charts / tables or more than three figures) take the full row, small ones pair up */
.mis-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; grid-auto-flow: row dense; }
@media (min-width: 1200px) { .mis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mis-panel.wide { grid-column: 1 / -1; } }
.mis-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: calc(var(--topbar-h) + 3.3rem); }
.mis-panel-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line-soft); }
.mis-panel-ico {
    flex: 0 0 auto; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .65rem; font-size: 1rem; color: #fff;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); box-shadow: inset 0 -2px 0 var(--brand-teal-bright);
}
.mis-panel-title { margin: 0; font-size: .92rem; font-weight: 800; line-height: 1.15; color: var(--navy); }
.mis-panel-sub { font-size: .68rem; color: var(--mut); }
.mis-panel-flag { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: var(--radius-pill); font-size: .68rem; font-weight: 700; white-space: nowrap; background: var(--neg-tint); color: var(--neg); }
.mis-panel-flag.ok { background: var(--pos-tint); color: var(--pos); }
.mis-panel-body { padding: .75rem .8rem .8rem; }
.mis-split-body { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .mis-split-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }

/* Figures */
.mis-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .55rem; }
.mis-split-body .mis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mis-split-body .mis-kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.mis-kpi { display: block; color: inherit; text-decoration: none; padding: .6rem .7rem .5rem .85rem; box-shadow: none; background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.mis-kpi .kpi-label { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; min-height: 2.6em; margin-right: 2.3rem; }
.mis-kpi .kpi-value { font-size: 1.4rem; font-variant-numeric: normal; margin-top: .2rem; }
.mis-kpi .kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-height: 1.1rem; }
.mis-go { flex: 0 0 auto; margin-left: auto; color: var(--mut-2); font-size: .8rem; transition: transform .15s ease, color .15s ease; }
a.mis-kpi[href]:hover .mis-go, a.mis-kpi[href]:focus-visible .mis-go { color: var(--accent); transform: translateX(2px); }

/* Chart / table cards inside a panel */
.mis-visuals { display: grid; gap: .65rem; min-width: 0; }
.mis-visual { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.mis-visual-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .5rem .7rem .25rem; }
.mis-visual-title { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--navy); }
.mis-visual-title a { color: inherit; text-decoration: none; }
.mis-visual-title a:hover { color: var(--accent); }
.mis-visual-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem; margin-left: auto; font-size: .7rem; color: var(--mut); }
.mis-visual-stats b { color: var(--ink); font-size: .82rem; }
.mis-delta { display: inline-flex; align-items: center; gap: .15rem; font-weight: 700; color: var(--ink-3); }
.mis-delta.good { color: var(--pos); }
.mis-delta.bad { color: var(--neg); }
.mis-view-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--mut); border-radius: var(--radius-sm); width: 1.7rem; height: 1.55rem; display: inline-grid; place-items: center; font-size: .8rem; padding: 0; }
.mis-view-toggle:hover { color: var(--accent); border-color: var(--accent-line); }
.mis-visual-body { padding: .3rem .7rem .6rem; }
.mis-visual .mis-table-view { display: none; }
.mis-visual.is-table .mis-chart-view { display: none; }
.mis-visual.is-table .mis-table-view { display: block; }
.mis-visual .table-wrap { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.mis-visual .table-report td.num, .mis-visual .table-report th.num { font-variant-numeric: tabular-nums; }

/* Column chart: thin columns from one baseline, the chosen period in teal, a hairline grid */
.mis-cols { --h: 170px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .45rem; margin: 1.15rem 0 0; }
.mis-cols-y { position: relative; height: var(--h); min-width: 2.1rem; font-size: .6rem; color: var(--mut); text-align: right; font-variant-numeric: tabular-nums; }
.mis-cols-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.mis-cols-body { position: relative; min-width: 0; }
.mis-cols-grid { position: absolute; left: 0; right: 0; top: 0; height: var(--h); pointer-events: none; }
.mis-cols-grid i { position: absolute; left: 0; right: 0; height: 1px; background: var(--chart-grid); }
.mis-cols-grid i.base { background: var(--line-2); }
.mis-cols-row { position: relative; display: flex; }
.mis-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; border-radius: 6px; outline: none; }
.mis-col[data-bs-toggle], .mis-part[data-bs-toggle] { text-decoration: none; cursor: default; } /* the hover lift is the cue; no dotted underline under chart text */
.mis-col-area { position: relative; width: 100%; height: var(--h); display: flex; justify-content: center; align-items: flex-end; border-radius: 6px 6px 0 0; transition: background .12s ease; }
.mis-col:hover .mis-col-area, .mis-col:focus-visible .mis-col-area { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.mis-col:focus-visible { box-shadow: 0 0 0 2px var(--accent-line); }
.mis-col-bar { width: min(24px, 56%); border-radius: 4px 4px 0 0; background: var(--chart-muted); }
.mis-col.is-current .mis-col-bar { background: var(--accent); }
.mis-col-val { position: absolute; left: 0; right: 0; margin-bottom: 3px; text-align: center; font-size: .68rem; font-weight: 700; color: var(--ink); white-space: nowrap; pointer-events: none; }
.mis-col-x { margin-top: .3rem; font-size: .64rem; color: var(--mut); white-space: nowrap; }
.mis-col.is-current .mis-col-x { color: var(--ink); font-weight: 700; }
.mis-empty { display: flex; align-items: center; gap: .4rem; padding: .9rem .2rem; font-size: .76rem; color: var(--mut); }

/* Split bar: one whole in parts (28 px, 2 px gaps, count inside when it fits - mis.js hides what does not) */
.mis-split { padding: .45rem 0 .1rem; }
.mis-split-bar { display: flex; gap: 2px; height: 28px; }
.mis-part { flex: 0 1 0; min-width: 3px; display: flex; align-items: center; padding: 0 .45rem; border-radius: 4px; font-size: .74rem; font-weight: 800; white-space: nowrap; outline: none; }
.mis-part:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.mis-part.is-tight b { visibility: hidden; }
.mis-part.step1, .mis-legend i.step1 { background: var(--ord-1); color: var(--chrome-darker); }
.mis-part.step2, .mis-legend i.step2 { background: var(--ord-2); color: var(--chrome-darker); }
.mis-part.step3, .mis-legend i.step3 { background: var(--ord-3); color: #fff; }
.mis-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem; font-size: .72rem; color: var(--ink-3); }
.mis-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -.05rem; background: var(--chart-muted); }
.mis-legend b { color: var(--ink); }

.mis-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin-top: .9rem; padding: .55rem .8rem; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); font-size: .74rem; color: var(--ink-3); }
.mis-foot > .bi { color: var(--accent); font-size: .95rem; }
.mis-foot a { font-weight: 600; }

@media (max-width: 991.98px) { .mis-tools { width: 100%; } }
@media (max-width: 575.98px) {
    .mis-hero { padding: .8rem .85rem .85rem; }
    .mis-filter, .mis-filter > div { width: 100%; }
    .mis-filter .form-select, .mis-filter .mis-company { min-width: 0; max-width: none; width: 100%; }
    .mis-month .form-select { flex: 1 1 auto; width: auto; }
    .mis-tools .hero-btn { flex: 1 1 auto; justify-content: center; }
    .mis-heads { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .mis-head-value { font-size: 1.15rem; }
    .mis-kpis, .mis-split-body .mis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
    .mis-kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    .mis-kpi .kpi-value { font-size: 1.12rem; }
    .mis-cols { --h: 120px; }
    .mis-panel-body { padding: .6rem .6rem .7rem; }
}
@media print {
    .mis-nav, .mis-tools, .mis-view-toggle, .mis-foot { display: none !important; }
    .mis-hero, .mis-panel-ico, .mis-col-bar, .mis-part { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .mis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mis-panel.wide { grid-column: 1 / -1; }
    .mis-panel { break-inside: avoid; box-shadow: none; }
}

/* ---------- Form tabs (purchase order header: Order / Commercial terms / Freight & T&C, 24-Nov-2026) ---------- */
.form-tabs { flex-wrap: nowrap; gap: .1rem; overflow-x: auto; scrollbar-width: none; padding: .3rem .5rem 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.form-tabs::-webkit-scrollbar { display: none; }
.form-tabs .nav-link { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; padding: .5rem .85rem .45rem; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--mut); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.form-tabs .nav-link .bi { color: var(--mut-2); }
.form-tabs .nav-link:hover { color: var(--accent-700); }
.form-tabs .nav-link.active { color: var(--navy); background: none; border-bottom-color: var(--brand-teal-bright); }
.form-tabs .nav-link.active .bi { color: var(--accent); }
.form-tabs-card > .tab-content > .tab-pane:focus { outline: none; }

/* ---------- Searchable drop-down (combo.js, 24-Nov-2026): a text box in front of a hidden <select data-combo> ---------- */
.combo { position: relative; min-width: 0; }
.combo .combo-native { display: none !important; }
.combo-input { padding-right: 1.7rem; text-overflow: ellipsis; }
.combo-caret { position: absolute; top: 0; right: 0; bottom: 0; width: 1.6rem; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--mut); font-size: .68rem; }
.combo-caret:hover { color: var(--accent); }
.combo-list { position: fixed; z-index: 1080; overflow-y: auto; padding: .25rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: var(--shadow-h); font-size: .78rem; }
.combo-opt { display: flex; align-items: baseline; gap: .6rem; padding: .32rem .5rem; border-radius: 6px; cursor: pointer; color: var(--ink); }
.combo-opt .combo-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.combo-opt .combo-hint { flex: 0 1 auto; max-width: 50%; color: var(--mut); font-size: .68rem; text-align: right; }
.combo-opt.is-active, .combo-opt:hover { background: var(--accent-tint); color: var(--accent-700); }
.combo-opt.is-active .combo-hint { color: var(--accent-700); }
.combo-sep { margin-top: .2rem; padding: .35rem .5rem .15rem; border-top: 1px solid var(--line-soft); font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut-2); }
.combo-none { padding: .4rem .5rem; color: var(--mut); font-size: .72rem; }
@media (pointer: coarse) and (max-width: 991.98px) { .combo-opt { padding: .55rem .6rem; font-size: .9rem; } }
.field-counter { margin-top: .1rem; text-align: right; font-size: .64rem; color: var(--mut-2); font-variant-numeric: tabular-nums; }
.field-counter.is-near { color: var(--warn); }

/* ---------- Voucher entry (Finance > Vouchers > New / Edit, 24-Nov-2026) ---------- */
.vch-head .vch-title { display: flex; align-items: center; gap: .65rem; }
.vch-ico { flex: 0 0 auto; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem; border: 1px solid var(--accent-line); background: var(--accent-tint); color: var(--accent); font-size: 1.2rem; }
.vch-pick { display: inline-flex; align-items: center; gap: .4rem; min-height: 31px; padding: .15rem .6rem; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); font-size: .76rem; color: var(--ink-2); }
.vch-pick .bi { color: var(--accent); }
.vch-pick strong { color: var(--navy); }
.vch-pick .form-select { min-height: 0; max-width: 18rem; padding-top: 0; padding-bottom: 0; padding-left: .1rem; border: 0; box-shadow: none; font-weight: 600; background-color: transparent; }
.vch-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem .85rem; }
.vch-f { min-width: 0; }
.vch-f-wide { grid-column: span 2; }
@media (max-width: 1199.98px) { .vch-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .vch-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vch-f-wide { grid-column: 1 / -1; } }
.vch-templates { min-width: 19rem; padding: .5rem .6rem; }
.vch-templates .muted { color: var(--mut); }
.vch-template { display: flex; align-items: center; gap: .25rem; }
.vch-template .dropdown-item { flex: 1 1 auto; min-width: 0; padding: .3rem .45rem; border-radius: 6px; font-size: .78rem; }
.vch-paste { padding: .6rem .75rem; border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.vch-lines td { vertical-align: top; }
.vch-lines td.vch-ledger { min-width: 17rem; }
.vch-lines td[data-label="Cost centre"], .vch-lines td[data-label="Project"] { min-width: 10rem; }
.vch-lines td[data-label^="Debit"], .vch-lines td[data-label^="Credit"] { width: 9.5rem; min-width: 8rem; }
.vch-lines td.actions { width: 1%; white-space: nowrap; text-align: center; }
.vch-party { margin-top: .3rem; }
.vch-party.needs-party .combo-input { border-color: var(--warn); background: var(--warn-tint); }
.btn-icon-line { width: 28px; padding: 0; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); }
.btn-icon-line:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon-line.is-danger { color: var(--neg); }
.btn-icon-line.is-danger:hover { border-color: var(--neg); background: var(--neg); color: #fff; }
.vch-lines tfoot td { border-top: 1px solid var(--accent-line); background: var(--accent-tint); font-weight: 700; color: var(--navy); }
.vch-lines tfoot .vch-bank-row td { border-top: 1px dashed var(--line-2); background: var(--bg); font-weight: 600; color: var(--ink-2); }
.vch-lines tfoot .vch-bank-row .bi { color: var(--accent); }
.vch-sum { display: inline-block; min-width: 7.5rem; padding: .22rem .5rem; border-radius: 6px; background: color-mix(in srgb, var(--accent) 14%, #fff); font-family: var(--num); font-variant-numeric: tabular-nums; }
.vch-status { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem; border-top: 1px solid var(--line-soft); font-size: .78rem; }
.vch-state { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.vch-state.is-good { color: var(--pos); }
.vch-state.is-bad { color: var(--neg); }
.vch-state.is-warn { color: var(--warn); }
.vch-state.is-idle { color: var(--mut); font-weight: 500; }
.vch-mini { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vch-actions .btn { white-space: nowrap; }
@media (max-width: 575.98px) {
    .vch-head .vch-ico { display: none; }
    .vch-lines tfoot { display: none; }
    .vch-lines td.vch-ledger, .vch-lines td[data-label="Cost centre"], .vch-lines td[data-label="Project"] { grid-column: 1 / -1; min-width: 0; }
    .vch-lines td[data-label^="Debit"], .vch-lines td[data-label^="Credit"] { width: auto; min-width: 0; }
    .vch-lines td.actions { width: auto; }
    .vch-actions { flex-wrap: nowrap; gap: .35rem; }
    .vch-actions > .flex-grow-1 { display: none; }
}

/* ---------- Purchase requisition / order pages (24-Nov-2026): line details, catalogue, files, send-to-vendor box ---------- */
.line-hint { display: block; margin-top: .2rem; font-size: .66rem; line-height: 1.3; color: var(--mut); }
.line-hint:empty { display: none; }
/* Price agreement flag of an order / requisition line (26-Nov-2026): as agreed, above, below, none, ceiling passed. */
.line-flag { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.line-flag:empty { display: none; }
.line-flag .pill { font-size: .64rem; padding: .05rem .4rem; white-space: normal; text-align: left; }
.vch-lines input.vch-per { min-width: 3.2rem; max-width: 4.5rem; }
.rate-cell .pill { display: inline-block; margin-top: .15rem; font-size: .64rem; }
.list-plain li .bi { color: var(--accent); }
.list-plain li .meta { color: var(--mut); font-size: .72rem; }
.list-plain li .push { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.list-plain li .push form { margin: 0; }
.catalogue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .2rem .8rem; max-height: 16rem; overflow-y: auto; padding: .2rem; }
.catalogue-item { display: flex; align-items: baseline; gap: .4rem; padding: .25rem .4rem; border-radius: 6px; font-size: .76rem; cursor: pointer; }
.catalogue-item:hover { background: var(--accent-tint); }
.catalogue-item[hidden] { display: none; }
.send-po { width: min(22rem, 92vw); }
.vch-lines td [data-gst-shown]:empty { display: none; }

/* Platform > Database status: needs-attention list, copyable fix lines, usage bars */
.attention { display: grid; gap: .4rem; }
.attention > .flash, .attention > .data-banner { display: flex; align-items: flex-start; gap: .5rem; margin: 0; }
.attention .bi { margin-top: .1rem; }
.fix-text { display: block; margin-top: .2rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .72rem; color: var(--ink-3); overflow-wrap: anywhere; user-select: all; }
.usage-bar { height: .4rem; margin-top: .25rem; min-width: 4rem; border-radius: var(--radius-pill); background: var(--bg-2); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: var(--accent); }
.usage-bar.is-high > span { background: var(--warn); }
.usage-bar.is-full > span { background: var(--neg); }
