/* ====================================================================
   Future ERP — modern web shell theme (Fiori / Odoo-inspired).
   RTL is handled by loading bootstrap.rtl.min.css + the [dir] rules below.
   ==================================================================== */
:root {
    /* Brand = ERP-template blue (#1a56db) on the Tabler/Bootstrap shell (the "mix"). */
    --tblr-primary: #1a56db;
    --tblr-primary-rgb: 26, 86, 219;
    --tblr-primary-fg: #ffffff;
    --tblr-border-radius: .375rem;
    --tblr-body-bg: #f4f5f7;
    --tblr-border-color: #d1d9e6;
    /* Inter is the template's signature UI face; keep system fonts as the offline fallback.
       'Noto Sans Arabic' sits DIRECTLY AFTER Inter, and that position is the whole point: neither Inter
       nor JetBrains Mono has a single Arabic glyph, and font fallback is resolved per character - so
       Latin keeps Inter and every Arabic character drops to a face designed for it instead of the
       browser's last-resort pick, which is what made Arabic labels barely legible. Dubai/Segoe/Tahoma
       follow for a machine that cannot reach the Google font. */
    --erp-sans: 'Inter', 'Noto Sans Arabic', 'Segoe UI', 'Dubai', 'Tahoma', system-ui, -apple-system, sans-serif;
    --tblr-font-sans-serif: var(--erp-sans);
    /* Monospace numerics for that enterprise/ledger feel (from the template). Arabic never reaches the
       mono face on purpose (ledger figures are Latin digits), but an Arabic word inside a code cell
       still needs somewhere to land. */
    --erp-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, 'Noto Sans Arabic', 'Courier New', monospace;
    /* ERP-template palette */
    --f-primary: #1a56db;
    --f-primary-dark: #1648b0;
    --f-accent: #1a56db;
    --f-sidebar-bg: #111827;       /* dark navy sidebar (template) */
    --f-sidebar-fg: #d1d9e6;
    --f-sidebar-fg-muted: #8a93a6;
    --f-sidebar-active: #1a56db;
    --f-sidebar-hover: #1f2937;
    --f-sidebar-border: #1f2937;
    --f-surface: #ffffff;
    --f-bg: #f4f5f7;
    --f-border: #d1d9e6;
    --f-secondary: #e8edf5;        /* template "secondary" — icon chips, subtle fills */
    --f-text: #0f1117;
    --f-muted: #5a6476;
    --sidebar-w: 256px;
    --topbar-h: 48px;
}

* { box-sizing: border-box; }

body.app-body {
    margin: 0;
    background: var(--f-bg);
    color: var(--f-text);
    font-family: var(--erp-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Shell layout ---- */
.app-shell { display: flex; min-height: calc(100vh / var(--erp-zoom, 1)); }

.app-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--f-sidebar-bg);
    color: var(--f-sidebar-fg);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 1040;
    transition: transform .2s ease;
    border-inline-end: 1px solid var(--f-border);
}

.app-main {
    flex: 1 1 auto;
    margin-inline-start: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- Brand ---- */
.app-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    height: var(--topbar-h);
    padding-inline: 1.25rem;
    border-bottom: 1px solid var(--f-border);
}
.app-brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: var(--f-accent);
    color: #fff; font-weight: 700; border-radius: 9px;
}
.app-brand-text { font-weight: 600; font-size: 1.05rem; color: var(--f-text); }

/* ---- Navigation ---- */
.app-nav { padding: .75rem .5rem; overflow-y: auto; }
.app-nav-heading {
    text-transform: uppercase;
    font-size: .68rem; letter-spacing: .08em;
    color: var(--f-sidebar-fg-muted);
    padding: 1rem .85rem .4rem;
}
.app-nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .85rem;
    margin-bottom: .15rem;
    color: var(--f-sidebar-fg);
    text-decoration: none;
    border-radius: 8px;
    font-size: .92rem;
}
.app-nav-link:hover { background: rgba(0,0,0,.05); color: var(--f-primary-dark); }
.app-nav-link.active { background: var(--f-sidebar-active); color: #fff; }
.app-nav-link.disabled { color: var(--f-sidebar-fg-muted); cursor: default; }
.app-nav-icon { width: 18px; text-align: center; opacity: .9; }
.app-nav-text { flex: 1 1 auto; }
.app-nav-badge {
    font-size: .6rem; text-transform: uppercase;
    background: rgba(0,0,0,.06); color: var(--f-sidebar-fg-muted);
    padding: .12rem .4rem; border-radius: 6px;
}
.app-nav-parent { cursor: pointer; }
.app-nav-caret { transition: transform .15s ease; opacity: .7; }
.app-nav-group.open .app-nav-caret { transform: rotate(180deg); }
.app-nav-children { display: none; margin-inline-start: .9rem; border-inline-start: 1px solid rgba(0,0,0,.08); padding-inline-start: .4rem; }
.app-nav-group.open .app-nav-children { display: block; }
.app-nav-child { font-size: .88rem; padding-block: .45rem; }

/* ---- Topbar ---- */
.app-topbar {
    height: var(--topbar-h);
    background: var(--f-surface);
    border-bottom: 1px solid var(--f-border);
    display: flex; align-items: center; gap: 1rem;
    padding-inline: 1.25rem;
    position: sticky; top: 0; z-index: 1030;
}
.app-page-title { font-size: 1.1rem; font-weight: 600; margin: 0; flex: 1 1 auto; }
.app-topbar-actions { display: flex; align-items: center; gap: .6rem; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--f-primary); color: #fff;
    display: grid; place-items: center; font-size: .8rem; font-weight: 600;
}
.lang-switch { margin: 0; }

/* ---- Content ---- */
.app-content { padding: 1rem 1.1rem; flex: 1 1 auto; }
.content-card {
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}
.welcome-card { background: linear-gradient(120deg, #f7f9ff, #eef3ff); }
.stat-card { display: flex; align-items: center; gap: 1rem; }
.stat-icon {
    width: 46px; height: 46px; border-radius: 10px;
    background: #eaf0ff; color: var(--f-primary);
    display: grid; place-items: center; font-size: 1.3rem;
}
.stat-label { font-size: .8rem; color: #6b7689; }
.stat-value { font-size: 1.15rem; font-weight: 600; }

/* ---- Responsive: collapsible sidebar ---- */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    [dir="rtl"] .app-sidebar { transform: translateX(100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-inline-start: 0; }
}

/* ====================================================================
   Auth (login) screen — styled after the "Future ERP" company/product
   profile cover: a soft blue gradient canvas with a faint constellation
   web, cyan rounded-square confetti and a dot grid, carrying an inset
   near-white panel that holds the brand lock-up + the sign-in card.
   ==================================================================== */
body.auth-body {
    margin: 0; min-height: calc(100vh / var(--erp-zoom, 1));
    font-family: var(--erp-sans);
    -webkit-font-smoothing: antialiased;
    color: #17324f;
    background-color: #dceafa;
    background-image:
        radial-gradient(1250px 860px at 44% 46%, #ffffff 0%, rgba(255,255,255,.42) 52%, rgba(255,255,255,0) 78%),
        linear-gradient(135deg, #bed7f0 0%, #dbeaf8 20%, #eaf3fc 46%, #e3eefa 70%, #cde1f4 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

/* Decorative layer 1 — the faint node/line "constellation" web. */
body.auth-body::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 1080' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%2390b8e2' stroke-width='1.3' opacity='.8'%3E%3Cpath d='M-40 236 L180 118 L420 208 L612 62 L842 152'/%3E%3Cpath d='M180 118 L246 -30'/%3E%3Cpath d='M420 208 L392 430 L152 472 L-40 388'/%3E%3Cpath d='M612 62 L702 262 L392 430'/%3E%3Cpath d='M842 152 L900 330 L702 262'/%3E%3Cpath d='M1290 44 L1498 172 L1758 88 L1960 196'/%3E%3Cpath d='M1498 172 L1452 402 L1706 520 L1960 430'/%3E%3Cpath d='M1452 402 L1186 470 L1120 250 L1290 44'/%3E%3Cpath d='M120 762 L332 884 L246 1102'/%3E%3Cpath d='M332 884 L614 946 L560 1102'/%3E%3Cpath d='M1560 764 L1804 836 L1930 1010'/%3E%3Cpath d='M1804 836 L1700 1100'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.8'%3E%3Ccircle cx='180' cy='118' r='7'/%3E%3Ccircle cx='420' cy='208' r='5'/%3E%3Ccircle cx='612' cy='62' r='6'/%3E%3Ccircle cx='842' cy='152' r='4'/%3E%3Ccircle cx='392' cy='430' r='6'/%3E%3Ccircle cx='152' cy='472' r='4'/%3E%3Ccircle cx='702' cy='262' r='4'/%3E%3Ccircle cx='900' cy='330' r='3'/%3E%3Ccircle cx='1498' cy='172' r='7'/%3E%3Ccircle cx='1452' cy='402' r='5'/%3E%3Ccircle cx='1758' cy='88' r='4'/%3E%3Ccircle cx='1706' cy='520' r='6'/%3E%3Ccircle cx='1120' cy='250' r='5'/%3E%3Ccircle cx='332' cy='884' r='6'/%3E%3Ccircle cx='614' cy='946' r='4'/%3E%3Ccircle cx='1804' cy='836' r='5'/%3E%3C/g%3E%3Cg fill='%2359c4ef' opacity='.55'%3E%3Ccircle cx='1290' cy='44' r='4'/%3E%3Ccircle cx='1186' cy='470' r='3.5'/%3E%3Ccircle cx='120' cy='762' r='4'/%3E%3Ccircle cx='1560' cy='764' r='3.5'/%3E%3C/g%3E%3C/svg%3E");
}

/* Decorative layer 2 — cyan rounded-square confetti in the far corners. */
body.auth-body::after {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-repeat: no-repeat, no-repeat;
    background-position: right -22px top -34px, left -30px bottom -18px;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='440' viewBox='0 0 340 440'%3E%3Cg fill='none' stroke='%237fd0f4' stroke-width='3'%3E%3Crect x='196' y='-26' width='78' height='78' rx='20'/%3E%3Crect x='96' y='58' width='56' height='56' rx='15'/%3E%3Crect x='242' y='98' width='62' height='62' rx='16'/%3E%3Crect x='232' y='238' width='96' height='96' rx='24'/%3E%3Crect x='300' y='372' width='70' height='70' rx='18'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg fill='none' stroke='%237fd0f4' stroke-width='3'%3E%3Crect x='34' y='26' width='96' height='96' rx='24'/%3E%3Crect x='108' y='152' width='72' height='72' rx='18'/%3E%3Crect x='-26' y='198' width='84' height='84' rx='21'/%3E%3C/g%3E%3C/svg%3E");
}

.auth-wrap {
    position: relative; z-index: 1;
    min-height: calc(100vh / var(--erp-zoom, 1));
    padding: clamp(10px, calc(2.6vh / var(--erp-zoom, 1)), 40px) clamp(10px, 2.6vw, 52px);
    display: flex;
}

/* The inset "slide" panel that both auth screens sit inside. */
.auth-split {
    flex: 1 1 auto;
    display: flex;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(255,255,255,.74) 0%, rgba(240,246,253,.9) 55%, rgba(255,255,255,.8) 100%);
    border: 1px solid rgba(255,255,255,.92);
    box-shadow: 0 30px 80px rgba(23,68,130,.13), inset 0 1px 0 rgba(255,255,255,.8);
    overflow: hidden;
}

/* Left brand / promo panel (hidden on small screens) */
.auth-brand {
    flex: 1 1 55%;
    display: none;
    flex-direction: column; justify-content: center;
    position: relative;
    padding: clamp(2rem, 4.2vw, 4.5rem);
    color: #17456f;
}
/* dot grid, like the one beside the cover's image collage */
.auth-brand::after {
    content: ''; position: absolute; pointer-events: none;
    inset-inline-end: clamp(1.5rem, 5vw, 5rem); bottom: clamp(4rem, calc(14vh / var(--erp-zoom, 1)), 8rem);
    width: 168px; height: 96px;
    background-image: radial-gradient(#3fbdf0 1.7px, transparent 1.8px);
    background-size: 21px 21px;
    opacity: .55;
}
.auth-brand .brand-logo {
    display: block; width: min(320px, 60%); height: auto;
    margin-bottom: clamp(1.5rem, calc(5vh / var(--erp-zoom, 1)), 3.25rem);
}
.auth-brand .brand-title {
    font-size: clamp(2.6rem, 5.4vw, 4.75rem);
    font-weight: 800; letter-spacing: -.02em; line-height: 1;
    margin: 0 0 .7rem; color: #1a56db;
}
.auth-brand .brand-title span { color: #29b6f0; }
.auth-brand .brand-tagline {
    font-size: clamp(1.05rem, 2vw, 1.9rem); font-weight: 600; line-height: 1.35;
    color: #2b6cb8; margin: 0 0 clamp(1.25rem, calc(3.5vh / var(--erp-zoom, 1)), 2.4rem); max-width: 30ch;
}
.auth-brand .brand-kicker {
    display: flex; align-items: center; gap: .95rem;
    font-size: .82rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
    color: #1f95d4; margin: 0;
}
.auth-brand .brand-kicker::before {
    content: ''; flex: 0 0 3px; width: 3px; height: 2.3em; border-radius: 2px; background: #29b6f0;
}
.auth-brand .brand-contact {
    display: flex; align-items: center; gap: .8rem;
    margin-top: clamp(1.75rem, calc(6vh / var(--erp-zoom, 1)), 3.5rem);
    color: #1f4d7a; font-size: 1rem;
}
.auth-brand .contact-badge {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
    background: #29b6f0; color: #fff; display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(41,182,240,.38);
}
.auth-brand .contact-badge svg { width: 20px; height: 20px; }
.auth-brand .brand-contact a { color: inherit; text-decoration: none; }
.auth-brand .brand-contact a:hover { color: #1a56db; text-decoration: underline; }

/* Right panel holds the login card */
.auth-panel {
    flex: 1 1 45%;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(1rem, 3vw, 2.5rem);
}
.login-card {
    width: 100%; max-width: 420px;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(23,68,130,.16), 0 2px 6px rgba(23,68,130,.06);
    padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.4rem, 2.6vw, 2.25rem);
}
/* brand mark inside the card — only where the brand panel is hidden */
.login-card .login-brand-mark { display: block; height: 54px; width: auto; margin: 0 auto 1.1rem; }
.login-card .login-logo {
    width: 56px; height: 56px; margin: 0 auto 1rem;
    background: linear-gradient(135deg, #1a56db 0%, #29b6f0 100%); color: #fff;
    border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; font-weight: 700;
}
.login-card h3 {
    text-align: center; letter-spacing: .12em; font-size: 1.15rem; font-weight: 700;
    color: var(--f-text); margin: 0 0 .25rem;
}
.login-sub { text-align: center; color: #6b7689; font-size: .85rem; margin: 0 0 1.5rem; }

/* Icon input groups (FocusX style) */
.login-field { margin-bottom: 1rem; }
/* Chrome's built-in password reveal button inflates the field's intrinsic
   width and wraps it under the icon — keep the group on one line. */
.login-field .input-group { flex-wrap: nowrap; }
.login-field .input-group .form-control { min-width: 0; }
.login-field .input-group-text {
    background: #eef5fd; border: 1px solid #d5e3f4; border-inline-end: 0;
    color: var(--f-primary); width: 44px; justify-content: center;
}
.login-field .form-control {
    border: 1px solid #d5e3f4; padding-block: .6rem;
}
.login-field .form-control:focus {
    border-color: var(--f-primary); box-shadow: none;
}
.login-icon { width: 18px; height: 18px; }
.login-btn {
    width: 100%; padding: .6rem; font-weight: 600; letter-spacing: .03em; margin-top: .25rem;
    border: 0; border-radius: 10px;
    background: linear-gradient(135deg, #1a56db 0%, #2f9de3 100%);
    box-shadow: 0 10px 22px rgba(26,86,219,.26);
}
.login-btn:hover, .login-btn:focus {
    background: linear-gradient(135deg, #1648b0 0%, #1f8bd2 100%);
}
.login-footer { text-align: center; color: #9aa3b5; font-size: .8rem; margin-top: 1.5rem; }
.lang-toggle .btn { --bs-btn-padding-y: .25rem; }

@media (min-width: 992px) {
    .auth-brand { display: flex; }
    .login-card .login-brand-mark { display: none; }
}

.btn-primary { --bs-btn-bg: var(--f-primary); --bs-btn-border-color: var(--f-primary); --bs-btn-hover-bg: var(--f-primary-dark); --bs-btn-hover-border-color: var(--f-primary-dark); }

/* ====================================================================
   FocusX accents applied to content + form pages
   ==================================================================== */
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--f-accent);
    box-shadow: 0 0 0 .15rem rgba(52,196,249,.25);
}
.form-check-input:checked { background-color: var(--f-primary); border-color: var(--f-primary); }
a { color: var(--f-primary-dark); }
.btn-outline-primary {
    --bs-btn-color: var(--f-primary-dark); --bs-btn-border-color: var(--f-primary);
    --bs-btn-hover-bg: var(--f-primary); --bs-btn-hover-border-color: var(--f-primary);
}
.content-card { box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.welcome-card { background: linear-gradient(120deg, #e8f8ff, #f4fbff) !important; }
.stat-icon { background: #e6f7fe !important; color: var(--f-primary) !important; }
/* Data tables — ERP-template look: uppercase tinted header, striped + hover rows. */
.table thead th {
    background: color-mix(in srgb, var(--f-border) 35%, var(--f-surface, #ffffff));
    /* Readable at a glance: larger, heavier, and near-body text instead of the muted grey (was .68rem / 600 / muted). */
    color: color-mix(in srgb, var(--f-text) 72%, var(--f-muted)); font-weight: 700;
    text-transform: uppercase; font-size: .78rem; letter-spacing: .03em;
    border-bottom: 1px solid var(--f-border);
}
.table tbody tr { transition: background-color .12s ease; }
.table-hover tbody tr:hover > * { background-color: color-mix(in srgb, var(--f-primary) 6%, var(--f-surface, #ffffff)); }
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: color-mix(in srgb, var(--f-border) 14%, var(--f-surface, #ffffff));
}
/* table-light header rows (tree parents, totals) get a faint brand tint */
.table-light, .table .table-light > * { background-color: color-mix(in srgb, var(--f-primary) 5%, var(--f-surface, #ffffff)) !important; }

/* Journal/voucher entry grid: a light brand-blue wash on odd line-rows (with a slightly deeper
   hover) makes long debit/credit grids easier to scan. Kept light to match the software palette. */
#linesTable tbody tr.line-row:nth-child(odd) > * {
    background-color: color-mix(in srgb, var(--f-primary) 5%, var(--f-surface, #ffffff));
}
#linesTable tbody tr.line-row:hover > * {
    background-color: color-mix(in srgb, var(--f-primary) 9%, var(--f-surface, #ffffff));
}

/* ---- Finance dashboard ---- */
.dash-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.dash-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.dash-period { color: #6b7689; font-size: .85rem; }
/* KPI cards — ERP-template layout: label+value on the left, a small secondary-tinted
   icon chip on the right; dark mono value, no colored accent. */
/* KPI cards wear the Financial-Analysis chip look: light surface fill, thin
   border, small sentence-case label and a coloured mono value. Each card
   carries an accent (--kpi-accent) that drives the value and the icon tile. */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.kpi-card {
    background: var(--tblr-bg-surface-secondary, #f8fafc);
    border: 1px solid var(--f-border); border-radius: .5rem;
    padding: .85rem 1rem; display: flex; flex-direction: column;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.kpi-card:hover { border-color: var(--kpi-accent, var(--f-primary)); box-shadow: 0 4px 14px rgba(26,86,219,.10); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.kpi-body { min-width: 0; }
.kpi-trend { display: flex; align-items: center; gap: .3rem; margin-top: .6rem; font-size: .72rem; font-weight: 600; }
.kpi-trend svg { width: 13px; height: 13px; flex: 0 0 auto; }
.kpi-trend.pos { color: #0e9f6e; }
.kpi-trend.neg { color: #c81e1e; }
.kpi-trend.flat { color: var(--f-muted); }
.kpi-trend.flat svg { opacity: .6; }
.kpi-trend-note { color: var(--f-muted); font-weight: 400; }
.kpi-icon {
    width: 32px; height: 32px; border-radius: 6px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--kpi-accent-soft, var(--f-secondary)); color: var(--kpi-accent, var(--f-primary));
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-label { font-size: .72rem; font-weight: 500; color: var(--tblr-secondary, #6b7280); margin: 0 0 .2rem; }
.kpi-value { font-size: 1.4rem; font-weight: 600; color: var(--kpi-accent, var(--f-text)); line-height: 1.15; }

/* Per-metric accents (Tabler palette), used by the value + the icon tile. */
.kpi-card.kpi-green  { --kpi-accent: var(--tblr-green,  #2fb344); --kpi-accent-soft: rgba(47,179,68,.12); }
.kpi-card.kpi-red    { --kpi-accent: var(--tblr-red,    #d63939); --kpi-accent-soft: rgba(214,57,57,.12); }
.kpi-card.kpi-azure  { --kpi-accent: var(--tblr-azure,  #4299e1); --kpi-accent-soft: rgba(66,153,225,.14); }
.kpi-card.kpi-orange { --kpi-accent: var(--tblr-orange, #f76707); --kpi-accent-soft: rgba(247,103,7,.13); }
.kpi-card.kpi-teal   { --kpi-accent: var(--tblr-teal,   #0ca678); --kpi-accent-soft: rgba(12,166,120,.13); }

/* ====================================================================
   The same chip look, on EVERY other dashboard's KPI tiles.
   Those ~55 views all render one of three shapes, and all of them end in
   "small grey label + bold coloured value", so they're matched
   structurally with :has() — no view markup changes, and a new dashboard
   written in the house style picks the look up for free.

     A  .card > .card-body.d-flex.align-items-center > span.avatar
        (52 dashboard/analytics views + the AR/AP settlement snapshots)
     B  .card-sm > .card-body > .row > .col-auto > span.avatar   (HrDashboard)
     C  .card-sm > .card-body > .subheader                       (Sales/Purchase
        invoice + return dashboards)

   Requiring .fw-bold (A) or .subheader (C) is what keeps plain header
   cards out — e.g. Master Data's intro card is shape-A markup but has no
   value, so it stays a normal card.
   ==================================================================== */
.card:has(> .card-body.d-flex.align-items-center > span.avatar):has(.fw-bold),
.card.card-sm:has(> .card-body > .row.align-items-center > .col-auto > span.avatar),
.card.card-sm:has(> .card-body > .subheader) {
    background: var(--tblr-bg-surface-secondary, #f8fafc);
    border: 1px solid var(--f-border);
    border-radius: .5rem;
    box-shadow: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
/* Shorthand for the three shapes above — repeated via :is() below. */
:is(.card:has(> .card-body.d-flex.align-items-center > span.avatar):has(.fw-bold),
    .card.card-sm:has(> .card-body > .row.align-items-center > .col-auto > span.avatar),
    .card.card-sm:has(> .card-body > .subheader)):hover {
    box-shadow: 0 4px 14px rgba(26,86,219,.10);
}
:is(.card:has(> .card-body.d-flex.align-items-center > span.avatar):has(.fw-bold),
    .card.card-sm:has(> .card-body > .row.align-items-center > .col-auto > span.avatar),
    .card.card-sm:has(> .card-body > .subheader)) > .card-body {
    padding: .85rem 1rem;
}
/* Label — small, grey, sentence case (Tabler's .subheader is uppercase). */
:is(.card:has(> .card-body.d-flex.align-items-center > span.avatar):has(.fw-bold),
    .card.card-sm:has(> .card-body > .row.align-items-center > .col-auto > span.avatar),
    .card.card-sm:has(> .card-body > .subheader))
    :is(.text-muted.small, .text-secondary, .subheader) {
    font-size: .72rem; font-weight: 500; letter-spacing: normal; text-transform: none;
    color: var(--tblr-secondary, #6b7280);
}
/* Value — mono, tabular, keeps whatever text-* accent the view assigned. */
:is(.card:has(> .card-body.d-flex.align-items-center > span.avatar):has(.fw-bold),
    .card.card-sm:has(> .card-body > .row.align-items-center > .col-auto > span.avatar),
    .card.card-sm:has(> .card-body > .subheader))
    :is(.h1, .h2, .h3, .h4, h1, h2, h3, h4) {
    font-family: var(--erp-mono); font-variant-numeric: tabular-nums;
    font-size: 1.4rem; font-weight: 600; line-height: 1.15;
}
/* Icon tile — 32px soft-tinted square with an accent glyph, like .kpi-icon.
   --tblr-bg-opacity thins Tabler's solid .bg-* fill; --kpi-accent (declared
   just below) recolours the glyph, which the view marked .text-white. */
:is(.card:has(> .card-body.d-flex.align-items-center > span.avatar):has(.fw-bold),
    .card.card-sm:has(> .card-body > .row.align-items-center > .col-auto > span.avatar))
    span.avatar {
    --tblr-bg-opacity: .13;
    --tblr-avatar-size: 2rem;
    --tblr-avatar-icon-size: 1.15rem;
    --tblr-avatar-font-size: .95rem;
    border-radius: .45rem; box-shadow: none;
    color: var(--kpi-accent, currentColor) !important;
}

/* Accent lookup: declaring a custom property has no effect on its own, so
   these are inert everywhere except the KPI tile rule above. */
.bg-blue      { --kpi-accent: var(--tblr-blue,      #066fd1); }
.bg-azure     { --kpi-accent: var(--tblr-azure,     #4299e1); }
.bg-indigo    { --kpi-accent: var(--tblr-indigo,    #4263eb); }
.bg-purple    { --kpi-accent: var(--tblr-purple,    #ae3ec9); }
.bg-pink      { --kpi-accent: var(--tblr-pink,      #d6336c); }
.bg-red       { --kpi-accent: var(--tblr-red,       #d63939); }
.bg-orange    { --kpi-accent: var(--tblr-orange,    #f76707); }
.bg-yellow    { --kpi-accent: var(--tblr-yellow,    #f59f00); }
.bg-lime      { --kpi-accent: var(--tblr-lime,      #74b816); }
.bg-green     { --kpi-accent: var(--tblr-green,     #2fb344); }
.bg-teal      { --kpi-accent: var(--tblr-teal,      #0ca678); }
.bg-cyan      { --kpi-accent: var(--tblr-cyan,      #17a2b8); }
.bg-primary   { --kpi-accent: var(--tblr-primary,   #1a56db); }
.bg-secondary { --kpi-accent: var(--tblr-secondary, #6b7280); }
.bg-success   { --kpi-accent: var(--tblr-success,   #2fb344); }
.bg-info      { --kpi-accent: var(--tblr-info,      #4299e1); }
.bg-warning   { --kpi-accent: var(--tblr-warning,   #f59f00); }
.bg-danger    { --kpi-accent: var(--tblr-danger,    #d63939); }
.bg-dark      { --kpi-accent: var(--tblr-dark,      #1e293b); }
.bg-light     { --kpi-accent: var(--tblr-secondary, #6b7280); }
.kpi-link { text-decoration: none; color: inherit; display: block; }
.kpi-link:hover { color: inherit; }
.chart-card canvas { max-height: 280px; }

/* ---- Balance Sheet (vertical statement) ---- */
.balance-sheet { max-width: 760px; }
.balance-sheet td { padding: .3rem .6rem; border: none; }
.balance-sheet td.text-end { font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-sheet .bs-section td {
    font-size: 1.02rem; font-weight: 700; color: var(--f-primary-dark, #0f7fb0);
    text-transform: uppercase; letter-spacing: .03em;
    padding-top: 1rem; border-bottom: 2px solid var(--f-primary, #16b4ec);
}
.balance-sheet .bs-group td { font-weight: 600; padding-top: .5rem; }
.balance-sheet .bs-sub td { color: #6b7689; font-size: .9rem; }
.balance-sheet .bs-account td { color: #333; }
.balance-sheet .bs-subtotal td { font-style: italic; color: #6b7689; border-top: 1px dotted var(--f-border, #d9dde6); }
.balance-sheet .bs-grouptotal td { font-weight: 600; border-top: 1px solid var(--f-border, #d9dde6); }
.balance-sheet .bs-sectiontotal td {
    font-weight: 700; font-size: 1.02rem;
    border-top: 2px solid var(--f-primary, #16b4ec); border-bottom: 3px double var(--f-primary, #16b4ec);
}
/* Compared statements (one column per period + change / % change): the table takes the card's width so the
   account names stay on one line, and each change pair sits behind a light divider. */
.balance-sheet.cmp-table { max-width: none; width: 100%; }
.balance-sheet.cmp-table td:first-child { min-width: 16rem; }
.cmp-table .cmp-head th { font-weight: 600; white-space: nowrap; border-bottom: 2px solid var(--f-border, #d9dde6); }
/* The change pair is a tinted band edged on both sides - after the periods by default, or between the two periods
   it compares in the "between periods" layout - so it never reads as one of the period columns. */
.cmp-table .cmp-change, .cmp-table .cmp-pct { background: rgba(22, 180, 236, .06); }
.cmp-table .cmp-change { border-inline-start: 1px solid var(--f-border, #d9dde6); }
.cmp-table .cmp-pct { border-inline-end: 1px solid var(--f-border, #d9dde6); }
.cmp-table td.cmp-pct { font-size: .8rem; }
.cmp-table .cmp-head th { vertical-align: bottom; }
.cmp-table .cmp-vs { font-size: .7rem; font-weight: 400; text-transform: none; color: var(--f-muted, #6b7689); }
[data-bs-theme="dark"] .cmp-table .cmp-change, [data-bs-theme="dark"] .cmp-table .cmp-pct { background: rgba(22, 180, 236, .08); }

/* ====================================================================
   ERP tweaks on top of Tabler — dense, fast data entry. Tabler already
   provides the professional shell/components; we add only ERP-specifics.
   ==================================================================== */
/* Dashboard cards: Inter for all text, JetBrains Mono for the figures (template treatment). */
.kpi-card, .content-card, .card { font-family: var(--erp-sans); }

/* Numeric cells: monospace + digit alignment (ERP-template ledger feel). */
.table .text-end, td.num, th.num,
.balance-sheet td.text-end, .kpi-value,
.fa-metric-value, .kpi-trend span:first-of-type {
    font-family: var(--erp-mono); font-variant-numeric: tabular-nums;
}

/* Compact line-grids inside cards (journal/voucher entry). */
.table td .form-control, .table td .form-select { padding-block: .15rem; }

/* Grid keyboard-navigation focus highlight. */
.table td input:focus, .table td select:focus {
    outline: 2px solid var(--f-primary); outline-offset: -2px; box-shadow: none;
    background: #f0fbff;
}

/* ====================================================================
   Transaction-screen header: strict, aligned 4-column grid.
   Add `txn-header-grid` alongside a header's `row g-3` field container.
   Each Bootstrap col-* field becomes exactly ONE cell (label on top, control
   below); fields fill left→right, top→bottom; trailing cells stay empty.
   Labels are forced to one line so every input in a row shares one baseline.
   Responsive: 4 → 3 → 2 → 1 columns. Line-items table + footer are untouched.

   FOUR, not three. A transaction header is twenty-odd fields; at three across
   that is seven rows of form before the line items start, and the lines - the
   part people came for - begin below the fold. The fourth column takes two
   rows off every one of these screens and costs nothing on a laptop: at the
   1200px step it falls back to three, which is where three belonged.
   The count is FIXED rather than auto-fit on purpose: these screens are read
   in columns, and a grid that silently becomes five on one monitor and four on
   another loses the alignment this rule exists to impose.
   ==================================================================== */
.txn-header-grid {
    display: grid !important;                 /* beats .row's flex regardless of source order */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem 1.25rem;
    align-items: start;
    margin: 0 !important;
}
.txn-header-grid > * {                        /* neutralize Bootstrap col widths/gutters → one cell each */
    width: auto !important;
    max-width: none !important;
    flex: 0 1 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0;
}
.txn-header-grid .form-label {
    margin-bottom: .3rem;
    white-space: nowrap;                      /* keep every label on one line so inputs align */
    overflow: hidden;
    text-overflow: ellipsis;
}
.txn-header-grid .form-control,
.txn-header-grid .form-select,
.txn-header-grid .ts-wrapper,
.txn-header-grid .input-group { width: 100%; }
/* A Design-Screen custom field that asked for Half or Full width (ScreenFieldWidth) spans cells of this
   same grid, so an Additional Fields block shares the header's column edges instead of running its own
   4-up Bootstrap row underneath a 3-up header. A quarter-width field needs no class: one cell is the
   default, which is exactly what a built-in header field gets. */
.txn-header-grid > .scf-w-half { grid-column: span 2; }
.txn-header-grid > .scf-w-full { grid-column: 1 / -1; }

@media (max-width: 1200px) { .txn-header-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 992px) { .txn-header-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px)  {
    .txn-header-grid { grid-template-columns: minmax(0, 1fr); }
    /* One column left: "span 2" would invent a second one, so both wide fields just fill the row. */
    .txn-header-grid > .scf-w-half,
    .txn-header-grid > .scf-w-full { grid-column: 1 / -1; }
}

/* ---- Phase B: forms ---- */
/* Sticky action bar pinned to the bottom of a form/card while editing. */
.form-actions, .card-footer.sticky-actions {
    position: sticky; bottom: 0; z-index: 5;
    background: var(--f-surface); border-top: 1px solid var(--f-border);
    display: flex; gap: .5rem; align-items: center;
    padding: .6rem 1rem; margin-top: 1rem;
}
.card-footer.sticky-actions { margin-top: 0; }
.form-actions .spacer { margin-inline-start: auto; }
/* Per-field validation message */
.field-error, span.field-validation-error { color: var(--tblr-danger, #c81e1e); font-size: .8rem; display: block; margin-top: .15rem; }
.input-validation-error { border-color: var(--tblr-danger, #c81e1e) !important; }

/* Tom Select (searchable pickers) — match Bootstrap/Tabler sizing + stay OPAQUE. */
.ts-control { font-size: .875rem; background-color: #fff !important; }
.ts-wrapper.single .ts-control, .ts-wrapper.focus .ts-control { background-color: #fff !important; }
.table .ts-wrapper { min-width: 180px; }
/* The native <select> Tom Select hides keeps EVERY option (a line's item list: ~1,900). Chrome still laid each one out
   whenever the line table changed, so every hidden picker cost a full re-measure: a 50-line Purchase Order took ~30 s
   to open and ~3 s per added line, and longer documents looked as if they could not be saved. Skipping the rendering
   of the hidden select's contents leaves its value, form posting, validation and focus untouched. */
select.tomselected { content-visibility: hidden; }
/* A transaction line's Description: a readable size, wraps over several lines and grows with its text (Chrome/Edge
   field-sizing; elsewhere it keeps its 2 rows and the user can drag it taller). */
.table textarea.line-desc {
    min-width: 16rem; font-size: .875rem; line-height: 1.35; resize: vertical;
    field-sizing: content; min-height: calc(2lh + .4rem + 2px); max-height: calc(8lh + .4rem + 2px);
    white-space: pre-wrap; overflow-wrap: anywhere;
}
/* Studio "Line No." line column (type lineno): numbered by row, read-only, on the column-caption background. */
.table td.scf-lineno-cell, .table th.scf-lineno-head { width: 3.25rem; min-width: 3.25rem; text-align: center; }
.table td.scf-lineno-cell { background: color-mix(in srgb, var(--f-border) 35%, var(--f-surface, #ffffff)); }
.table td.scf-lineno-cell input.scf-lineno {
    border: 0; background: transparent; box-shadow: none; padding: 0; text-align: center; width: 100%;
    font-weight: 700; color: color-mix(in srgb, var(--f-text) 72%, var(--f-muted)); cursor: default; pointer-events: none;
}
.table .ts-control { min-height: calc(1.3em + .4rem + 2px); padding: .1rem .4rem; }
/* dropdownParent:'body' renders the menu on <body>; force it solid (never see-through). */
.ts-dropdown {
    font-size: .85rem;
    background-color: #fff !important;
    border: 1px solid var(--f-border);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    z-index: 1065;                 /* above topbar (1030) / cards */
    opacity: 1 !important;
}
.ts-dropdown .option { background-color: #fff; }
.ts-dropdown .option.active,
.ts-dropdown .active { background-color: var(--tblr-primary); color: #fff; }
.ts-dropdown .no-results { color: var(--f-muted); }
/* Master picker drop lists (master-picker.js, Studio → Drop-list columns): a header row + one grid row per record. */
.ts-dropdown.mp-dropdown .mp-head {
    display: grid; gap: .5rem; align-items: center;
    padding-block: .35rem; font-size: .75rem; font-weight: 600; color: var(--f-muted);
    border-bottom: 1px solid var(--f-border); background: var(--tblr-bg-surface-secondary, #f6f8fb);
}
/* Header and rows share one horizontal padding, so their grid columns line up. */
.ts-dropdown.mp-dropdown .mp-head, .ts-dropdown.mp-dropdown .option { padding-inline: .75rem; }
.ts-dropdown.mp-dropdown .mp-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.ts-dropdown.mp-dropdown .mp-head .mp-adv { margin-inline-start: .35rem; color: var(--tblr-primary); }
.ts-dropdown .mp-row { display: grid; gap: .5rem; align-items: baseline; }
.ts-dropdown .mp-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.ts-dropdown .mp-cell.mp-code { font-variant-numeric: tabular-nums; color: var(--f-muted); }
.ts-dropdown .option.active .mp-cell.mp-code { color: inherit; }
.ts-dropdown .mp-cell.mp-all { grid-column: 1 / -1; }
.ts-dropdown .mp-found { grid-column: 1 / -1; font-size: .72rem; color: var(--tblr-primary); white-space: normal; }
.ts-dropdown .option.active .mp-found { color: inherit; opacity: .9; }

/* ---- Print: clean report output (hide chrome, show the card only) ---- */
@media print {
    .navbar-vertical,
    .page-wrapper > header.navbar,
    .footer,
    .no-print,
    .card-footer.sticky-actions,
    .form-actions { display: none !important; }
    body, .page, .page-wrapper, .page-body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    .card { border: 0 !important; box-shadow: none !important; }
    .card-body { padding: 0 !important; }
    .table { font-size: 11px; }
    a[href]::after { content: ""; }      /* don't append URLs to links */
    @page { margin: 14mm; }

    /* Company letterhead / footer on printed REPORTS.
       _Layout always emits these blocks; they stay hidden on screen and print only on pages that
       carry a .report-print-head — the marker every HTML report already uses for its title line.
       That way all ~26 report screens (and any future one) print the client's branding without a
       per-view edit, from the same Company Info record the .repx reports read. Print views that
       already include _ReportHeader themselves run Layout=null, so they can't double up. */
    body:has(.report-print-head) .layout-report-brand { display: block !important; }
    body:has(.report-print-head) .layout-report-brand-head { margin-bottom: .35rem; }
    body:has(.report-print-head) .layout-report-brand-foot { margin-top: .5rem; }
}
/* hidden on screen; @media print above opts report pages in */
.layout-report-brand { display: none; }
.report-print-head { font-size: 12px; color: #111; margin-bottom: .5rem; }

/* Brand mark in the Tabler sidebar. */
.brand-mark {
    width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center;
    background: var(--f-accent); color: #fff; font-weight: 800; font-size: 1rem;
}
.navbar-brand .brand-text { font-size: 1.05rem; font-weight: 700; }
.brand-titles { display: flex; flex-direction: column; line-height: 1.15; }
.brand-titles .brand-text { font-size: .98rem; line-height: 1.1; }
.brand-sub { font-size: 10px; font-weight: 400; color: var(--f-sidebar-fg-muted, #8a93a6); letter-spacing: .02em; }

/* Top-header page title / breadcrumb (template style). */
.page-pretitle + .page-title, .page-title-top { font-weight: 600; }
.topbar-crumb { font-size: .9rem; color: var(--f-muted); display: flex; align-items: center; gap: .4rem; min-width: 0; overflow: hidden; white-space: nowrap; }
.topbar-crumb > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-crumb > .sep { flex: 0 0 auto; }
.topbar-crumb .sep { opacity: .5; }
.topbar-crumb .cur { color: var(--f-text); font-weight: 600; }
.topbar-crumb .crumb-link { color: var(--f-muted); text-decoration: none; }
.topbar-crumb .crumb-link:hover { color: var(--tblr-primary, #34c4f9); text-decoration: underline; }

/* ---- Global search box with ⌘K (ERP-template) ---- */
.topbar-search { position: relative; width: 280px; }
.topbar-search > .form-control {
    padding-inline-start: 2rem; padding-inline-end: 2.6rem; font-size: .82rem; height: 34px;
    background: var(--tblr-body-bg, #f4f5f7);
}
.topbar-search-icon {
    position: absolute; inset-inline-start: .6rem; top: 50%; transform: translateY(-50%);
    color: var(--f-muted); font-size: 15px; pointer-events: none;
}
.topbar-search-kbd {
    position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%);
    font-size: 10px; line-height: 1; color: var(--f-muted);
    border: 1px solid var(--f-border); border-radius: 4px; padding: .12rem .3rem; background: #fff;
}
.topbar-search-results {
    position: absolute; inset-inline-start: 0; inset-inline-end: auto; top: calc(100% + 4px);
    min-width: 100%; width: max-content; max-width: min(460px, calc(92vw / var(--erp-zoom, 1)));
    background: #fff; border: 1px solid var(--f-border); border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: .25rem; z-index: 1050;
    max-height: calc(60vh / var(--erp-zoom, 1)); overflow-y: auto; display: none;
}
.topbar-search-results.show { display: block; }
.topbar-search-item {
    display: flex; align-items: center; gap: .55rem; padding: .4rem .55rem; border-radius: 6px;
    font-size: .85rem; color: var(--f-text); cursor: pointer;
}
.topbar-search-item .ti { color: var(--f-muted); font-size: 15px; flex: 0 0 auto; }
.topbar-search-item.active, .topbar-search-item:hover { background: var(--tblr-primary); color: #fff; }
.topbar-search-item.active .ti, .topbar-search-item:hover .ti { color: #fff; }
/* label + (module › sub-group) breadcrumb, stacked and ellipsised */
.topbar-search-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.topbar-search-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search-crumb {
    font-size: .72rem; color: var(--f-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-search-item.active .topbar-search-crumb,
.topbar-search-item:hover .topbar-search-crumb { color: rgba(255, 255, 255, .82); }
.topbar-search-empty { padding: .6rem .55rem; font-size: .82rem; color: var(--f-muted); }

/* Topbar icon buttons (notifications / help) */
.topbar-icon { color: var(--f-muted); font-size: 1.25rem; line-height: 1; display: inline-flex; }
.topbar-icon:hover { color: var(--tblr-primary); }

/* --------------------------------------------------------------------
   Icon-font fallbacks.
   The bundled tabler-icons build predates the "-filled" variants (and a
   few other names), so those classes resolve to NO glyph and the icon
   silently disappears — e.g. the Favorites star vanished on any page the
   user had pinned, because that state renders ti-star-filled. Alias each
   missing name onto the closest glyph the font does ship. Loaded after
   tabler-icons.min.css, so these win.
   -------------------------------------------------------------------- */
.ti-star-filled::before          { content: "\eb2e"; }   /* → ti-star */
.ti-circle-check-filled::before  { content: "\ea67"; }   /* → ti-circle-check */
.ti-point-filled::before         { content: "\eb0c"; }   /* → ti-point */
.ti-diamonds-filled::before      { content: "\eff5"; }   /* → ti-diamonds */
.ti-player-play-filled::before   { content: "\ed46"; }   /* → ti-player-play */
.ti-player-record-filled::before { content: "\ed47"; }   /* → ti-player-record */
.ti-player-stop-filled::before   { content: "\ed4a"; }   /* → ti-player-stop */
.ti-layout-dashboard-off::before { content: "\f02c"; }   /* → ti-layout-dashboard */
.ti-paperclip-off::before        { content: "\eb02"; }   /* → ti-paperclip */
.ti-blueprints::before           { content: "\f043"; }   /* → ti-file-vector */
.ti-rows::before                 { content: "\ead8"; }   /* → ti-layout-rows */

/* The star has no filled glyph here, so pinned vs unpinned reads by colour:
   gold = pinned. Keep it gold over the dark top bar too. */
#favStar.ti-star-filled,
.fav-star .ti-star-filled { color: #f59f00 !important; }

/* ====================================================================
   Dark navy sidebar (ERP-template) layered on Tabler's navbar-vertical.
   ==================================================================== */
.navbar-vertical {
    background: var(--f-sidebar-bg) !important;
    border-inline-end: 1px solid var(--f-sidebar-border) !important;
}
.navbar-vertical .navbar-brand,
.navbar-vertical .brand-text { color: #fff !important; }
.navbar-vertical .navbar-toggler { color: var(--f-sidebar-fg); border-color: var(--f-sidebar-border); }
.navbar-vertical .navbar-nav .nav-link { color: var(--f-sidebar-fg); border-radius: 6px; }
.navbar-vertical .navbar-nav .nav-link:hover { background: var(--f-sidebar-hover); color: #fff; }
.navbar-vertical .nav-item.active > .nav-link,
.navbar-vertical .navbar-nav .nav-link.active { background: var(--f-sidebar-active); color: #fff; }
.navbar-vertical .nav-link .nav-link-icon { color: inherit; opacity: .85; }
.navbar-vertical .nav-link.disabled { color: var(--f-sidebar-fg-muted) !important; opacity: .6; }
/* sub-menu (collapsible) links */
.navbar-vertical .nav-sm .nav-link { color: var(--f-sidebar-fg); font-size: .85rem; padding-block: .3rem; }
.navbar-vertical .nav-sm .nav-link:hover { background: var(--f-sidebar-hover); color: #fff; }
.navbar-vertical .nav-sm .nav-link.active { background: transparent; color: #fff; font-weight: 600; }
.navbar-vertical .nav-sm .nav-link.active::before { background: var(--f-sidebar-active); }
/* section heading + brand divider */
.navbar-vertical .navbar-brand { border-bottom: 1px solid var(--f-sidebar-border); }

/* KPI value uses brand color via --kpi already; keep cards on template surface */
.content-card, .card { --tblr-card-border-color: var(--f-border); }
.card { --tblr-card-border-radius: 10px; }
.card .card-header { border-bottom-color: var(--f-border); }

/* ====================================================================
   Financial Analysis — top health banner + footer card (metric chips + advice).
   ==================================================================== */
/* Top banner: score + overall verdict + the worst 1-2 advice items, links to the card. */
.fa-banner {
    display: flex; align-items: center; gap: 1rem 1.25rem; flex-wrap: wrap;
    background: var(--f-surface); border: 1px solid var(--f-border);
    border-inline-start: 4px solid var(--f-muted);
    border-radius: 8px; padding: .6rem 1rem; margin-bottom: 1rem;
    color: var(--f-text); text-decoration: none;
    transition: box-shadow .12s ease;
}
.fa-banner:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); color: var(--f-text); }
.fa-banner-good { border-inline-start-color: #0e9f6e; }
.fa-banner-warn { border-inline-start-color: #e3a008; }
.fa-banner-bad  { border-inline-start-color: #c81e1e; }
.fa-banner-info { border-inline-start-color: var(--f-primary); }
.fa-banner-score { display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.fa-banner-band { font-weight: 600; font-size: .9rem; }
.fa-banner-advice { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; flex: 1 1 auto; min-width: 12rem; font-size: .82rem; }
.fa-banner-advice > span { display: inline-flex; align-items: center; gap: .35rem; }
.fa-banner-more { margin-inline-start: auto; flex: 0 0 auto; font-size: .82rem; font-weight: 600; color: var(--f-primary); white-space: nowrap; }

.fa-score { font-size: .8rem; font-weight: 600; }
.fa-metrics { display: flex; flex-wrap: wrap; gap: .5rem; }
.fa-metric {
    display: flex; flex-direction: column; min-width: 9rem;
    padding: .4rem .65rem; border: 1px solid var(--f-border, #e5e7eb);
    border-radius: .5rem; background: var(--tblr-bg-surface-secondary, #f8fafc);
}
.fa-metric-label { font-size: .72rem; color: var(--tblr-secondary, #6b7280); }
.fa-metric-value { font-size: 1.05rem; font-weight: 600; }
.fa-advice { display: flex; flex-direction: column; gap: .2rem; }
.fa-advice li { display: flex; gap: .45rem; align-items: flex-start; line-height: 1.4; }
.fa-advice-icon { flex: 0 0 1rem; text-align: center; }

/* ---- Guided tour (Driver.js) ---- */
.driver-popover.app-tour-popover {
    border-radius: 12px;
    box-shadow: 0 12px 38px rgba(15, 23, 42, .28);
    font-family: 'Inter', system-ui, sans-serif;
    max-width: 340px;
}
.driver-popover.app-tour-popover .driver-popover-title { font-weight: 600; font-size: 1.02rem; }
.driver-popover.app-tour-popover .driver-popover-description { line-height: 1.5; }
.driver-popover.app-tour-popover .driver-popover-progress-text { color: #94a3b8; font-size: .8rem; }
.driver-popover.app-tour-popover .driver-popover-next-btn {
    background: var(--tblr-primary, #34c4f9); color: #fff; border: none; text-shadow: none; border-radius: 7px;
}
.driver-popover.app-tour-popover .driver-popover-prev-btn { border-radius: 7px; }
/* ---- Arabic typography ----
   Arabic letterforms carry much of their meaning in marks above and below the baseline, so the pixel
   size that reads comfortably in Latin reads as a smear in Arabic: the dots collide with the line above
   and the loops fill in. A small size bump and a taller line give them room. Applied to the RTL document
   as a whole - labels, inputs, buttons, table cells - rather than to a hand-picked list of elements,
   because a caption that was missed is exactly the one that stays unreadable. */
html[dir="rtl"] body,
html[dir="rtl"] .form-label,
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] .form-check-label,
html[dir="rtl"] .btn,
html[dir="rtl"] .card-title,
html[dir="rtl"] table {
    font-size: 15px;
    line-height: 1.65;
}

/* Inter's tighter tracking on labels and headings is wrong for Arabic at any size: letters within a
   word are joined, so negative letter-spacing pulls them into each other. */
html[dir="rtl"] .form-label,
html[dir="rtl"] .form-check-label,
html[dir="rtl"] .card-title,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
    letter-spacing: 0;
    font-weight: 600;
}

/* An Arabic-name field inside an otherwise English screen (dir="rtl" on the input alone) gets the same
   treatment - the customer screen's "Name (Arabic)" box is the one everybody meets first. */
input[dir="rtl"], textarea[dir="rtl"] { font-size: 15px; line-height: 1.65; }

html[dir="rtl"] .driver-popover.app-tour-popover { direction: rtl; text-align: right; }
html[dir="rtl"] .driver-popover.app-tour-popover .driver-popover-navigation-btns { flex-direction: row-reverse; }

/* ---- Collapsible sidebar (desktop): mini icon-rail to maximise the form, toggle from inside the sidebar ---- */
.sidebar-mini-toggle {
    background: transparent;
    border: 0;
    color: var(--f-sidebar-fg-muted, #8a93a6);
}
.sidebar-mini-toggle:hover { color: #fff; }

@media (min-width: 992px) {
    .navbar-vertical { transition: width .15s ease; }

    /* Collapsed = a narrow rail showing only the module icons. */
    .page.sidebar-mini > .navbar-vertical { width: 64px; }
    .page.sidebar-mini > .page-wrapper { margin-inline-start: 64px; }

    /* Hide labels, the search box, sub-menus, carets and brand in the rail. */
    .page.sidebar-mini > .navbar-vertical .nav-link-title,
    .page.sidebar-mini > .navbar-vertical .navbar-brand,
    .page.sidebar-mini > .navbar-vertical .nav-filter,
    .page.sidebar-mini > .navbar-vertical .nav-link .ms-auto,
    .page.sidebar-mini > .navbar-vertical .nav-link.dropdown-toggle::after,
    .page.sidebar-mini > .navbar-vertical .collapse:not(.navbar-collapse) { display: none !important; }
    .page.sidebar-mini > .navbar-vertical .navbar-nav .nav-link { justify-content: center; padding-inline: 0; }
    .page.sidebar-mini > .navbar-vertical .nav-link-icon { margin: 0 !important; }
    .page.sidebar-mini > .navbar-vertical .sidebar-mini-toggle { margin-inline: auto !important; }
    .page.sidebar-mini .sidebar-mini-toggle .ti { transform: rotate(180deg); }   /* chevrons point ▶ to expand */

    /* Hover the rail to peek the full menu as an overlay (content stays maximised). */
    .page.sidebar-mini > .navbar-vertical:hover { width: var(--sidebar-w, 256px); box-shadow: 0 0 28px rgba(0,0,0,.35); z-index: 1045; }
    .page.sidebar-mini > .navbar-vertical:hover .nav-link-title,
    .page.sidebar-mini > .navbar-vertical:hover .nav-filter { display: revert !important; }
    .page.sidebar-mini > .navbar-vertical:hover .navbar-brand { display: flex !important; }
    .page.sidebar-mini > .navbar-vertical:hover .sidebar-mini-toggle { margin-inline-start: auto !important; }
    .page.sidebar-mini > .navbar-vertical:hover .collapse.show:not(.navbar-collapse) { display: block !important; }
    .page.sidebar-mini > .navbar-vertical:hover .navbar-nav .nav-link { justify-content: flex-start; padding-inline: .5rem; }
}

/* ---- Sidebar menu filter ---- */
.nav-filter .form-control {
    background: rgba(255, 255, 255, .06);
    border-color: var(--f-sidebar-border, #1f2937);
    color: var(--f-sidebar-fg, #d1d9e6);
}
.nav-filter .form-control::placeholder { color: var(--f-sidebar-fg-muted, #8a93a6); }
.nav-filter .input-icon-addon { color: var(--f-sidebar-fg-muted, #8a93a6); }
/* a menu row hidden by the filter */
.navbar-vertical .nav-item.nav-filtered { display: none !important; }

/* ---- Reusable info popover (small .info-pop button → floating data card; DevExpress-free) ---- */
.infopop {
    position: fixed; z-index: 1080; width: 300px; max-width: calc(92vw / var(--erp-zoom, 1));
    background: #fff; border: 1px solid #d7dce5; border-radius: 8px;
    box-shadow: 0 8px 28px rgba(24, 40, 72, .18); padding: 10px 12px;
    font-size: 12.5px; color: #2b3446;
}
.infopop.infopop-wide { width: 460px; line-height: 1.5; }
.infopop-wide ul { padding-inline-start: 18px; margin: 0 0 6px; }
.infopop-wide li { margin-bottom: 4px; }
.infopop-head { font-weight: 700; color: #1f2a44; margin-bottom: 6px; }
.infopop-loading { color: #8a93a6; }
.infopop-row { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; }
.infopop-row > span { color: #6b7488; }
.infopop-muted { font-size: 11px; color: #8a93a6; margin-top: 6px; }

/* Register custom-grid column drag-reorder (reg-col-reorder.js) */
.reg-th-draggable { cursor: grab; user-select: none; }
.reg-th-draggable:active { cursor: grabbing; }
.reg-th-dragging { opacity: .45; }
.reg-th-over { box-shadow: inset 3px 0 0 var(--f-primary, #1a56db); background: var(--f-ring, rgba(26,86,219,.10)); }

/* ---- Master-field label rule (master-quickadd.js) ----
   Any <select data-master="key"> gets a BOLD, clickable label. Clicking it opens that master as a
   sub-screen: add mode when the picker is empty, modify mode on the selected record when it is not.
   The weight is the affordance — it is what tells the user this label is more than text. */
.mqa-label {
    font-weight: 700;
    cursor: pointer;
    color: var(--f-primary, #1a56db);
}
.mqa-label:hover, .mqa-label:focus-visible { text-decoration: underline; }
.mqa-label:focus-visible { outline: 2px solid var(--f-primary, #1a56db); outline-offset: 2px; border-radius: 3px; }
/* Tabler renders required markers via .required::after — keep that working on a master label. */
.mqa-label.required::after { font-weight: 700; }

/* ---- A master picker and its "+" stay on ONE line, at every zoom --------------------------------
   Bootstrap's .input-group is flex-wrap: WRAP. A flex item's default min-width is auto — its
   min-content width — so once the dropdown's own content no longer fits the column, the group can no
   longer fit both children on a line and the button drops underneath the dropdown. Browser zoom is
   exactly what produces that: zooming in keeps the CSS pixel count of the text but shrinks the column
   it has to fit in, so the same form moves the button at one zoom level and not at another. The button
   then sat below the list on some screens and beside it on others.

   nowrap forbids the break, and min-width:0 is what makes nowrap safe: without it the dropdown would
   refuse to shrink below its content and overflow the column instead. The button keeps its natural
   width (flex: 0 0 auto) so it is the dropdown that gives, which is the right way round — a truncated
   list is still usable, a half-width button is not. The same pair already keeps the login field's
   group together.

   Scoped to .mqa-group, the class master-quickadd.js puts on the group it builds (or adopts), so an
   ordinary input-group elsewhere still wraps as Bootstrap intends. */
.input-group.mqa-group { flex-wrap: nowrap; }
.input-group.mqa-group > .form-select,
.input-group.mqa-group > .form-control,
.input-group.mqa-group > .ts-wrapper { min-width: 0; }
.input-group.mqa-group > [data-quickadd] { flex: 0 0 auto; }
/* A long account / customer name stays on one line (ellipsis) so the picker keeps the "+" button's height. */
.input-group.mqa-group > .ts-wrapper.single .ts-control { flex-wrap: nowrap; }
.input-group.mqa-group > .ts-wrapper.single .ts-control > .item { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* =====================================================================================================
   THE DOCUMENT RIBBON on a record screen (_RecordToolbar + record-workflow.js).
   -----------------------------------------------------------------------------------------------------
   ONE strip, not three controls sharing a line:

       [# SQ-2026-06-0001][search]>[159] Sales Inquiry > Quotation Out > Sales Order 15 +1 > ...

   The document's number, the box you jump to another document by, the record's id and the workflow it is
   walking are all answers to "which document is this", so they are drawn as segments of the same ribbon.
   Everything below shares one box, one height and one set of colour variables; the only differences are
   which fill a segment takes and whether it ends in a point.

   HOW A POINT IS MADE
   A segment is an ordinary box - so it can hold text, an input and an inset outline - and its point is
   two stacked CSS triangles. The outer one is drawn in the segment's LINE colour and the inner one,
   pulled back a hair, in its FILL. What stays visible is a thin diagonal of the line colour: the
   separator between two flat segments, and the outlined nose of the current step. One mechanism, both
   jobs. The triangles are half the ribbon's height each, so the height is fixed rather than fluid - a
   point that missed its own edge would be worse than no point - and the outline is an INSET SHADOW
   rather than a border, which would grow the box and shift the triangles off the edge they sit against.

   COLOUR is theme tokens only (--f-*), so the ribbon follows all eleven palettes and dark mode without
   naming a colour of its own. RIGHT-TO-LEFT needs no rule: every property that places or draws a point is
   a logical one, so Arabic turns the whole strip round by itself.
   ===================================================================================================== */
.rb-line { min-width: 0; }
.rb-group { min-width: 0; }

/* ---- the shared segment ---------------------------------------------------------------------------- */
.rb-seg,
.rwf-step {
    --rb-fill: var(--f-secondary, #e8edf5);
    --rb-ink: var(--f-text, #0f1117);
    --rb-line: var(--f-bg, #f4f5f7);

    position: relative;
    display: inline-flex; align-items: center; gap: .35rem;
    height: 1.75rem;
    padding: 0 .6rem;
    background: var(--rb-fill);
    color: var(--rb-ink);
    font-size: .8125rem; line-height: 1;
    white-space: nowrap; text-decoration: none;
    flex: 0 0 auto;
}

/* ---- the point ------------------------------------------------------------------------------------- */
.rb-nose,
.rwf-step { margin-inline-end: 14px; }

.rb-nose::before, .rb-nose::after,
.rwf-step::before, .rwf-step::after {
    content: ''; position: absolute; top: 0; inset-inline-start: 100%;
    width: 0; height: 0;
    border-top: .875rem solid transparent;
    border-bottom: .875rem solid transparent;
}
.rb-nose::before, .rwf-step::before { border-inline-start: 14px solid var(--rb-line); }
.rb-nose::after, .rwf-step::after { border-inline-start: 14px solid var(--rb-fill); margin-inline-start: -1.5px; }

/* The strip's two ends are rounded; everything between is squared into the run. The head is the document
   number when the screen is numbered, and the record id when it is not. */
.rb-group > .rb-seg:first-child,
.rb-line > .rwf-wrap:first-child .rwf-id {
    border-start-start-radius: var(--tblr-border-radius, .375rem);
    border-end-start-radius: var(--tblr-border-radius, .375rem);
}
.rwf-step:last-child {
    margin-inline-end: 0;
    padding-inline-end: .75rem;
    border-start-end-radius: var(--tblr-border-radius, .375rem);
    border-end-end-radius: var(--tblr-border-radius, .375rem);
}
.rwf-step:last-child::before, .rwf-step:last-child::after { content: none; }

/* A screen with a number but no workflow ends at the search box, so its point would aim at nothing.
   record-workflow.js marks the line once it has actually drawn steps to run into. */
.rb-line:not(.rb-has-flow) .rb-nose { margin-inline-end: 0; }
.rb-line:not(.rb-has-flow) .rb-nose::before,
.rb-line:not(.rb-has-flow) .rb-nose::after { content: none; }
.rb-line:not(.rb-has-flow) .rb-group > .rb-seg:last-of-type {
    border-start-end-radius: var(--tblr-border-radius, .375rem);
    border-end-end-radius: var(--tblr-border-radius, .375rem);
}

/* ---- what each segment is -------------------------------------------------------------------------- */

/* The number the user quotes: the head of the strip, and the one thing on it worth the accent. */
.rb-doc {
    --rb-fill: var(--f-surface, #fff);
    --rb-ink: var(--f-primary, #1a56db);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--f-border, #d1d9e6);
}
.rb-doc .ti { opacity: .75; }

/* Jump to another document. A field that lives in the strip rather than a boxed input group. */
.rb-find { --rb-ink: var(--f-muted, #5a6476); }
.rb-input {
    border: 0; background: transparent; padding: 0; margin: 0;
    font: inherit; color: var(--f-text, #0f1117);
    width: 9rem; min-width: 4rem; outline: none;
}
.rb-input::placeholder { color: var(--f-muted, #5a6476); opacity: .8; }
.rb-seg:focus-within { box-shadow: inset 0 0 0 1.5px var(--f-primary, #1a56db); z-index: 1; }
.rb-btn {
    border: 0; background: transparent; padding: 0 .1rem; margin: 0;
    color: var(--f-primary, #1a56db); cursor: pointer; line-height: 1;
}
.rb-btn:hover { color: var(--f-primary-dark, #1648b0); }

/* The record's own key. The number beside it is the DOCUMENT NUMBER from the screen's numbering pattern,
   which is a different thing and often a different value. */
.rwf-id { --rb-ink: var(--f-muted, #5a6476); font-weight: 600; }

/* ---- the workflow steps ---------------------------------------------------------------------------- */
.rwf-wrap { min-width: 0; flex: 0 1 auto; }
.rwf-steps { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; max-width: 100%; }

.rwf-step { --rb-ink: var(--f-muted, #5a6476); }
.rwf-step.rwf-done { --rb-ink: var(--f-text, #0f1117); cursor: pointer; }
.rwf-step.rwf-done:hover { --rb-fill: var(--f-bg, #f4f5f7); --rb-ink: var(--f-primary, #1a56db); }

/* The stage the document is standing on: lifted out of the strip and outlined in the accent. */
.rwf-step.rwf-current {
    --rb-fill: var(--f-surface, #fff);
    --rb-ink: var(--f-text, #0f1117);
    --rb-line: var(--f-primary, #1a56db);
    font-weight: 600;
    box-shadow: inset 0 1.5px 0 var(--rb-line), inset 0 -1.5px 0 var(--rb-line), inset 1.5px 0 0 var(--rb-line);
}

/* A conversion that was undone: the document it created is deliberately still there, so the step stays
   and says what happened instead of disappearing. */
.rwf-step.rwf-reversed { text-decoration: line-through; opacity: .8; }

/* ---- the hover card: what the document at this step IS ---------------------------------------------
   A label/value list, not prose: the eye runs down the values, and the amount closes it off under a rule
   because "what does it come to" is the one figure people are looking for. */
.rwf-card {
    position: absolute; z-index: 1080;
    min-width: 15rem; max-width: 24rem;
    box-shadow: var(--f-card-shadow, 0 .5rem 1rem rgba(0,0,0,.15));
}
.rwf-card .rwf-head {
    font-weight: 600; color: var(--f-text, #0f1117);
    padding-bottom: .25rem; margin-bottom: .25rem;
    border-bottom: 1px solid var(--f-border, #d1d9e6);
}
.rwf-card .rwf-row, .rwf-card .rwf-total { display: flex; gap: .75rem; align-items: baseline; }
.rwf-card .rwf-k { flex: 0 0 auto; min-width: 5.5rem; color: var(--f-muted, #5a6476); }
.rwf-card .rwf-v { flex: 1 1 auto; min-width: 0; color: var(--f-text, #0f1117); overflow-wrap: anywhere; }
.rwf-card .rwf-total {
    margin-top: .3rem; padding-top: .3rem;
    border-top: 1px solid var(--f-border, #d1d9e6);
}
.rwf-card .rwf-amount { flex: 1 1 auto; font-weight: 600; color: var(--f-text, #0f1117); }
.rwf-card .rwf-cur { font-weight: 400; color: var(--f-muted, #5a6476); }

/* ---- quick convert: what is still waiting to reach the next stage ----------------------------------
   A next stage with a quantity left to convert is drawn in the warning colour and carries that quantity
   as a pill, so "is anything left?" is answered before the pointer gets there. Nothing waiting = the
   step keeps its ordinary look; the card says so in words. */
.rwf-step.rwf-has-pending:not(.rwf-current) {
    --rb-fill: var(--tblr-warning-lt, #fff4e0);
    --rb-ink: var(--tblr-warning-text-emphasis, #8a5300);
    font-weight: 600; cursor: pointer;
}
.rwf-step .rwf-qty {
    display: inline-block; padding: .1rem .4rem; border-radius: 999px;
    background: var(--tblr-warning, #f59f00); color: #fff;
    font-size: .7rem; font-weight: 600; line-height: 1.2;
}
.rwf-card .rwf-pend {
    margin-top: .4rem; padding-top: .35rem;
    border-top: 1px solid var(--f-border, #d1d9e6);
}
.rwf-card .rwf-pend-head { font-weight: 600; color: var(--f-text, #0f1117); margin-bottom: .25rem; }
.rwf-card .rwf-pend-row {
    padding: .3rem .45rem; margin-bottom: .3rem;
    border-radius: var(--tblr-border-radius, .375rem);
    border-inline-start: 3px solid transparent;
}
.rwf-card .rwf-pend-row.is-pending {
    background: var(--tblr-warning-lt, #fff4e0);
    border-inline-start-color: var(--tblr-warning, #f59f00);
}
.rwf-card .rwf-pend-row.is-pending .rwf-pend-qty b { color: var(--tblr-warning-text-emphasis, #8a5300); font-size: .9rem; }
.rwf-card .rwf-pend-row.is-done {
    background: var(--tblr-success-lt, #e6f6ec);
    border-inline-start-color: var(--tblr-success, #2fb344);
}
.rwf-card .rwf-pend-row.is-done .rwf-pend-qty { color: var(--tblr-success, #2fb344); }
.rwf-card .rwf-pend-name { font-weight: 600; color: var(--f-text, #0f1117); }
.rwf-card .rwf-pend-of { color: var(--f-muted, #5a6476); }

/* =====================================================================================================
   DRAFT TAPE — a document saved as a Draft (Design Screen → "Save new documents as Draft") carries a strip
   of masking tape: translucent yellow, torn ends, stuck on slightly askew. It is a physical metaphor, so
   it keeps its own colour in every palette and in dark mode (tape is yellow on any desk); the ink is dark
   enough to read on it either way. .draft-tape-sm is the same tape sized for a landing-grid cell.
   The torn ends are a clip-path zig-zag, so the strip needs no image and mirrors cleanly in Arabic.
   ===================================================================================================== */
.draft-tape {
    display: inline-flex; align-items: center; justify-content: center;
    height: 1.75rem;
    padding: 0 1.1rem;
    margin-inline-end: .75rem;
    background: rgba(250, 204, 21, .78);
    background-image: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 45%, rgba(0,0,0,.05));
    color: #5b3d00;
    font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
    line-height: 1; white-space: nowrap;
    transform: rotate(-2.5deg);
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
    clip-path: polygon(0 6%, 3% 0, 6% 10%, 9% 2%, 91% 3%, 94% 0, 97% 9%, 100% 4%,
                       100% 94%, 97% 100%, 94% 91%, 91% 99%, 9% 98%, 6% 90%, 3% 100%, 0 95%,
                       2% 75%, 0 55%, 2% 35%, 0 18%);
    user-select: none;
}
.draft-tape-sm {
    height: 1.25rem; padding: 0 .7rem; margin-inline-end: 0;
    font-size: .68rem; letter-spacing: .1em;
    transform: rotate(-2deg);
}

/* An asp-validation-summary styled as an .alert rendered an empty red bar on every form load: the tag
   helper always emits the element, marked validation-summary-valid until there is something to say.
   Hidden only in that state - client or server errors switch it to validation-summary-errors. */
.alert.validation-summary-valid { display: none; }

/* AI supplier invoice capture (migration 328): a field read with low confidence is outlined for review; a field
   read confidently gets only a faint underline, so the eye goes to what needs checking. The review panel (the
   original document) stays in view while the form scrolls, on wide screens. */
.cap-low { outline: 2px solid var(--tblr-orange, #f76707) !important; outline-offset: 1px; background-color: rgba(247, 103, 7, .06) !important; border-radius: 4px; }
.cap-read { box-shadow: inset 0 -2px 0 rgba(47, 179, 68, .45); }
@media (min-width: 1400px) { .cap-sticky { position: sticky; top: 4.5rem; max-height: calc(calc(100vh / var(--erp-zoom, 1)) - 5rem); overflow-y: auto; } }

/* A field's tooltip (Studio, migration 334): the info icon beside its label; infopop.js shows the text. */
.scf-tip { display: inline-flex; color: var(--tblr-secondary, #8a94a6); cursor: help; margin-inline-start: .2rem; font-size: .9em; vertical-align: middle; }
.scf-tip:hover, .scf-tip:focus { color: var(--tblr-primary, #206bc4); outline: none; }
.infopop-text { white-space: normal; max-width: 320px; }

/* A unit or symbol add-on ("%", "Days", a currency) stays BESIDE its box on a transaction header. The rule above
   gives every header .form-control width:100%, which also hit the box INSIDE an input group: the box then filled the
   whole cell and the add-on wrapped onto a line of its own, pushing the row below down. Inside a group the box
   shares the line, as Bootstrap intends. */
.txn-header-grid .input-group,
[data-record-form] .input-group { flex-wrap: nowrap; }
.txn-header-grid .input-group > .form-control,
.txn-header-grid .input-group > .form-select,
.txn-header-grid .input-group > .ts-wrapper,
[data-record-form] .input-group > .form-control,
[data-record-form] .input-group > .form-select,
[data-record-form] .input-group > .ts-wrapper { width: 1%; flex: 1 1 auto; min-width: 0; }
.txn-header-grid .input-group > .input-group-text,
[data-record-form] .input-group > .input-group-text { white-space: nowrap; }

/* ---- App footer: one thin line, never wrapping (the Tabler footer is 2rem tall per side and wrapped). ---- */
.footer.app-footer { padding: .2rem 0 !important; font-size: .72rem; line-height: 1.3; white-space: nowrap; min-height: 0; }
.footer.app-footer .container-fluid { min-width: 0; }
