/* =========================================================================
   Virah Forex Bureau — Corporate Portal Design System (app.css)
   The live virahforexbureau.com website is the brand source of truth: warm
   paper surfaces, ledger navy, Virah blue, shilling yellow and the local
   Axiforma family. Operational screens keep a denser rhythm than
   the public website while using the same visual language.
   One stylesheet is loaded on every authenticated portal screen. No business
   logic depends on this file.
   ========================================================================= */

/* Self-hosted portal typography. Axiforma is supplied with the portal and
   stays first-party, so no page depends on a font CDN or installed-device
   font. The three practical UI weights avoid loading a full font family on
   every visit; the browser picks the nearest face for intermediate weights. */
@font-face {
    font-family: 'Axiforma';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Axiforma-Regular.otf') format('opentype');
}
@font-face {
    font-family: 'Axiforma';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/Axiforma-SemiBold.otf') format('opentype');
}
@font-face {
    font-family: 'Axiforma';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Axiforma-Bold.otf') format('opentype');
}

/* The desktop rail deliberately preserves its established navigation voice.
   These faces are only used inside .app-sidebar; the rest of the portal stays
   on Axiforma. They remain local, non-blocking assets so this compatibility
   choice does not add a CDN dependency or delay first paint. */
@font-face {
    font-family: 'Lexend';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/lexend-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/source-sans-3-latin.woff2') format('woff2');
}

/* ---------------------------------------------------------------- Tokens */
:root {
    /* Exact public-site brand palette */
    --ledger-navy:    #06324a;
    --ledger-navy-2:  #0a415f;
    --virah-blue:     #0078b0;
    --virah-blue-deep:#006694;
    --shilling-gold:  #f8e810;
    --shilling-gold-soft:#fff8a3;
    --paper:          #faf8f2;
    --paper-deep:     #f1eee4;
    --slate:          #425a66;
    --mist:           #e6eef1;
    --border:         #c7d5da;
    --fresh:          #1e6e4b;
    --danger:         #b42318;

    /* Compatibility aliases used throughout existing portal views */
    --brand:        var(--virah-blue);
    --brand-600:    #0787bd;
    --brand-700:    var(--virah-blue-deep);
    --brand-800:    var(--ledger-navy-2);
    --brand-900:    var(--ledger-navy);
    --brand-050:    #edf7fa;
    --brand-100:    #d5ebf2;
    --brand-200:    #acd6e5;
    --accent:       var(--shilling-gold);
    --accent-600:   #e4d400;

    /* Ink / neutral */
    --ink:      #10212b;
    --ink-2:    #2d4653;
    --muted:    #58717c;
    --muted-2:  #78909b;
    --line:     rgba(6,50,74,.14);
    --line-2:   rgba(6,50,74,.08);

    /* Surfaces */
    --bg:        var(--paper);
    --surface:   #ffffff;
    --surface-2: #fbfcfa;

    /* Feedback tints */
    --ok:      var(--fresh); --ok-bg: #e9f5ef; --ok-line: #badac9;
    --warn:    #7b6600;   --warn-bg: #fffbe0;  --warn-line: #eadf78;
    --err:     var(--danger); --err-bg:#fff0ed; --err-line:#edc4bb;
    --info:    var(--virah-blue-deep); --info-bg:#edf7fa; --info-line:#b9dbe7;

    /* Radii — crisp, banking-grade */
    --r-xs:  5px;
    --r-sm:  10px;
    --r:     12px;
    --r-md:  16px;
    --r-lg:  18px;
    --r-xl:  30px;
    --r-pill: 999px;

    /* Elevation — hairlines first, shadow only where depth means something */
    --shadow-xs: 0 2px 12px rgba(6,50,74,.035);
    --shadow-sm: 0 8px 24px rgba(6,50,74,.08);
    --shadow:    0 12px 34px rgba(6,50,74,.11);
    --shadow-md: 0 20px 48px rgba(6,50,74,.14);
    --shadow-lg: 0 28px 70px rgba(6,50,74,.16);
    --shadow-brand: 0 12px 30px rgba(0,120,176,.20);
    --ring: 0 0 0 4px rgba(0,120,176,.13);

    /* Motion — subtle, 150–300ms, ease-out in / ease-in out */
    --ease:     cubic-bezier(.4, 0, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --t-fast: .12s;
    --t:      .2s;
    --t-slow: .32s;

    /* Layout */
    --sidebar-w: 252px;
    --topbar-h:  76px;

    --font-heading: 'Axiforma', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --font:      'Axiforma', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --font-sidebar-heading: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-sidebar: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

    /* Bootstrap otherwise gives inputs and controls a device-native family.
       Keep those variables aligned with the self-hosted portal typography. */
    --bs-font-sans-serif: var(--font);
    --bs-body-font-family: var(--font);
    --bs-body-font-weight: 400;
    --bs-font-monospace: var(--font-mono);
}

/* Large-cash passport photograph editor — shares the HR file's 35:45 crop pattern. */
.cpe-card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    padding: 18px;
}
.cpe-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.cpe-eyebrow {
    display: block;
    color: var(--brand);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.cpe-title {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 750;
    margin: 2px 0 0;
}
.cpe-status {
    align-items: center;
    border: 1px solid;
    border-radius: 999px;
    display: inline-flex;
    font-size: .7rem;
    font-weight: 750;
    gap: 5px;
    padding: 5px 9px;
    white-space: nowrap;
}
.cpe-status.is-ready { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.cpe-status.is-missing { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.cpe-frame-wrap { margin: 0 auto; max-width: 184px; }
.cpe-frame {
    aspect-ratio: 35 / 45;
    background: var(--brand-050);
    border: 1px solid var(--brand-100);
    border-radius: var(--r-md);
    display: grid;
    overflow: hidden;
    place-items: center;
    position: relative;
}
.cpe-frame img { height: 100%; object-fit: cover; width: 100%; }
.cpe-placeholder {
    align-items: center;
    color: var(--brand-700);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cpe-placeholder i { font-size: 3.4rem; line-height: 1; }
.cpe-placeholder span { font-family: var(--font-mono); font-size: .72rem; font-weight: 700; }
.cpe-corner { border-color: var(--accent); border-style: solid; height: 22px; position: absolute; width: 22px; }
.cpe-corner--tl { border-width: 2px 0 0 2px; left: 8px; top: 8px; }
.cpe-corner--tr { border-width: 2px 2px 0 0; right: 8px; top: 8px; }
.cpe-corner--bl { border-width: 0 0 2px 2px; bottom: 8px; left: 8px; }
.cpe-corner--br { border-width: 0 2px 2px 0; bottom: 8px; right: 8px; }
.cpe-caption { color: var(--muted); font-size: .7rem; line-height: 1.4; padding: 8px 0 0; text-align: center; }
.cpe-actions { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.cpe-actions .btn, .cpe-tools .btn, .cpe-modal .modal-footer .btn { min-height: 44px; }
.cpe-editor {
    align-items: center;
    background: var(--ink);
    border-radius: var(--r-md);
    display: flex;
    justify-content: center;
    min-height: 360px;
    overflow: hidden;
}
.cpe-editor img { display: block; max-height: 60vh; max-width: 100%; }
.cpe-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.cpe-modal .modal-content { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.cpe-modal .modal-header { background: var(--surface); border-bottom: 1px solid var(--line); }
@media (max-width: 575.98px) {
    .cpe-actions { grid-template-columns: 1fr; }
    .cpe-editor { min-height: 280px; }
}

/* ------------------------------------------------------------------ Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
    /* Prevent mobile browsers from applying their own text-size inflation to
       otherwise identical screens. */
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    font-family: var(--font);
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(6,50,74,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6,50,74,.018) 1px, transparent 1px);
    background-size: 48px 48px;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-kerning: normal;
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
/* Bootstrap assigns form controls its system --bs body family by default.
   This later, equal-specificity rule keeps them in the portal family. */
:is(.form-control, .form-select) { font-family: var(--font); }
a { text-decoration: none; color: var(--brand-700); transition: color var(--t) var(--ease); }
a:hover { color: var(--brand); }
::selection { background: rgba(2,122,182,.16); }
h1,h2,h3,h4,h5,h6 {
    color: var(--ink);
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -.03em;
}
.fw-bold { font-weight: 600 !important; }
.fw-semibold { font-weight: 500 !important; }
hr { border-color: var(--line); opacity: 1; }
small, .small { font-size: .84rem; }

.app-skip-link {
    position: fixed; top: 10px; left: 12px; z-index: 2000;
    min-height: 44px; display: inline-flex; align-items: center;
    padding: 10px 16px; border-radius: var(--r-pill);
    background: var(--accent); color: var(--ledger-navy); font-family: var(--font-heading);
    font-size: .82rem; font-weight: 650; box-shadow: var(--shadow-md);
    transform: translateY(-160%); transition: transform var(--t) var(--ease-out);
}
.app-skip-link:focus { color: var(--ledger-navy); transform: translateY(0); }

/* Codes, references, staff/branch numbers — monospace hairline chips.
   Pages mark these with <code> everywhere, so this styles data system-wide. */
code, kbd, samp {
    font-family: var(--font-mono);
    font-size: .78em;
    font-weight: 500;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    padding: .1em .42em;
    white-space: nowrap;
}
code.text-dark { color: var(--ink) !important; }

/* Refined scrollbars */
* { scrollbar-width: thin; scrollbar-color: #c7d2df transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd6e2; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #aebccb; background-clip: content-box; }

/* Keyboard focus is always visible */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* ============================================================= App shell */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    position: fixed; top: 20px; bottom: 20px; left: 20px; width: var(--sidebar-w);
    overflow: hidden; border: 1px solid rgba(6,50,74,.14); border-radius: 22px;
    background: #fff; color: var(--ink); display: flex; flex-direction: column; z-index: 1040;
    box-shadow: 0 20px 46px rgba(6,50,74,.14); font-family: var(--font-sidebar);
    transition: transform .3s var(--ease);
}
.app-main {
    flex: 1; min-width: 0; margin-left: calc(var(--sidebar-w) + 40px); padding-right: 20px;
    display: flex; flex-direction: column; min-height: 100vh;
}
.app-content { flex: 1 0 auto; }

/* Brand block: the full-colour website wordmark lives on its warm paper. */
.sb-brand {
    min-height: 92px; display: flex; align-items: center; gap: 12px;
    padding: 17px 16px; background: rgba(250,248,242,.985);
    border-bottom: 4px solid var(--accent); box-shadow: 0 6px 20px rgba(3,31,48,.2);
}
.sb-brand .logo-mark {
    width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--brand-900);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex: none;
}
.sb-brand .logo-img { width: 168px; height: auto; max-height: 60px; object-fit: contain; display: block; flex: none; }
.sb-brand-identity { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: flex-start; }
.sb-brand .name { font-family: var(--font-sidebar-heading); font-weight: 700; letter-spacing: -.02em; color: var(--ledger-navy); line-height: 1; font-size: 1.08rem; }
.sb-brand .sub { font-size: .63rem; letter-spacing: .18em; text-transform: uppercase; color: var(--virah-blue-deep); margin-top: 5px; font-weight: 700; }
.sb-brand-context { display: block; margin-top: 2px; padding-left: 0; color: var(--slate); font-size: .61rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sb-close {
    display: none; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px;
    margin-left: auto; padding: 0; border: 1px solid rgba(6,50,74,.18); border-radius: 50%;
    background: #fff; color: var(--ledger-navy); cursor: pointer; transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.sb-close:hover { background: var(--paper-deep); border-color: rgba(6,50,74,.3); }
.sb-close:focus-visible { outline: none; box-shadow: var(--ring); }

/* Nav */
.sb-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 12px 12px 20px;
    background:#fff;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.sb-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sb-group { margin: 18px 10px 8px; font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--slate); font-weight: 800; }
.sb-group:first-child { margin-top: 4px; }
.sb-link {
    position: relative; display: flex; align-items: center; gap: 11px;
    min-height: 46px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600;
    margin-bottom: 3px; overflow: hidden; font-size: .91rem;
    transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.sb-link::before { display: none; content: none; }
.sb-link i { font-size: 1.05rem; width: 21px; text-align: center; color: var(--virah-blue-deep); transition: color var(--t) var(--ease); }
.sb-link:hover { background: var(--brand-050); color: var(--ledger-navy); }
.sb-link:hover i { color: var(--virah-blue); }
.sb-link.active { background: var(--virah-blue); color: #fff; font-weight: 600; box-shadow:0 8px 18px rgba(0,120,176,.16); }
.sb-link.active i { color: #fff; }
.sb-link .badge { font-size: .64rem; padding: .3em .5em; }

/* Collapsible nav sections */
.sb-section { margin-bottom: 1px; }
.sb-sec-toggle {
    width: 100%; display: flex; align-items: center; gap: 10px;
    background: transparent; border: 0; color: var(--slate);
    min-height: 46px; padding: 8px 12px; border-radius: 12px; cursor: pointer;
    font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700;
    transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.sb-sec-toggle:hover { background: var(--brand-050); color: var(--ledger-navy); }
.sb-sec-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.sb-sec-ico { font-size: 1rem; width: 20px; text-align: center; color: var(--virah-blue-deep); transition: color var(--t) var(--ease); }
.sb-sec-label { flex: 1; text-align: left; }
.sb-caret { font-size: .74rem; color: var(--slate); transition: transform var(--t) var(--ease); }
.sb-sec-toggle[aria-expanded="true"] { color: var(--ledger-navy); }
.sb-sec-toggle[aria-expanded="true"] .sb-sec-ico { color: var(--virah-blue); }
.sb-sec-toggle[aria-expanded="true"] .sb-caret { transform: rotate(180deg); }
.sb-sec-direct { text-decoration: none; }
.sb-sec-direct.active { background: var(--virah-blue); color: #fff; box-shadow:0 8px 18px rgba(0,120,176,.16); }
.sb-sec-direct.active .sb-sec-ico { color: #fff; }
.sb-direct-arrow { font-size: .78rem; color: var(--slate); }
.sb-sec-badge { font-size: .6rem; padding: .28em .5em; }
.sb-sec-body { padding: 2px 0 6px; }
.sb-sec-body .sb-link { padding-left: 20px; }

/* Sidebar footer */
.sb-foot { border-top: 1px solid rgba(255,255,255,.10); padding: 14px; background: var(--ledger-navy); }
.sb-user { display: flex; align-items: center; gap: 11px; }
.sb-user .avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--virah-blue); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 600;
    border: 1px solid rgba(255,255,255,.14); flex: none; text-transform: uppercase;
}
.sb-user .u-name { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.15; word-break: break-word; }
.sb-user .u-role { color: #7fb0cd; font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
.sb-signout {
  appearance: none;
    display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px;
    width: 100%; min-height: 44px; padding: 9px 14px; border-radius: var(--r-pill); font-family: var(--font-sidebar-heading); font-weight: 600; font-size: .8rem;
    color: #d5e5f0; border: 1px solid rgba(255,255,255,.16); background: transparent;
    transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.sb-signout:hover { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.3); }
.sb-signout:active { transform: translateY(1px); }

/* ================================================================ Topbar */
.app-topbar {
    position: sticky; top: 20px; z-index: 1030; height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
    margin-top:20px; padding: 0 24px; border:1px solid var(--line); border-radius:18px;
    background: rgba(255,255,255,.96); backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
    box-shadow: 0 2px 12px rgba(6,50,74,.03);
    transition: box-shadow var(--t) var(--ease);
}
.app-topbar::after { content: ""; position: absolute; left: 24px; bottom: -1px; width: 42px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.app-topbar.scrolled { box-shadow: 0 8px 24px rgba(6,50,74,.08); }
.topbar-toggle { display: none; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 1.45rem; color: var(--ledger-navy); line-height: 1; cursor: pointer; padding: 0; transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease); }
.topbar-toggle:hover { background: var(--paper-deep); }
.topbar-toggle:active { transform: scale(.92); }
.topbar-mobile-brand { display:none; width:38px; height:38px; flex:0 0 38px; align-items:center; justify-content:center; border-radius:50%; background:#fff; }
.topbar-mobile-brand img { width:34px; height:34px; object-fit:contain; border-radius:50%; }
.topbar-heading { min-width: 0; }
.topbar-kicker { color: var(--virah-blue-deep); font-size: .65rem; font-weight: 800; letter-spacing: .13em; line-height: 1; text-transform: uppercase; }
.topbar-title { margin: 3px 0 0; font-family: var(--font-heading); font-weight: 620; color: var(--ledger-navy); font-size: 1.08rem; line-height: 1.15; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { color: var(--muted); font-size: .78rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.branch-chip {
    display: inline-flex; align-items: center; gap: 7px; min-height: 40px; background: #fff; color: var(--ledger-navy);
    font-weight: 700; font-size: .78rem; padding: 7px 13px; border-radius: var(--r-pill); border: 1px solid var(--line);
    font-family: var(--font-mono);
}
.user-btn {
    display: flex; align-items: center; gap: 9px; min-height: 44px; border: 1px solid var(--line); background: #fff;
    border-radius: var(--r-pill); padding: 4px 13px 4px 5px; cursor: pointer;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.user-btn:hover { border-color: var(--brand-200); box-shadow: var(--shadow-xs); }
.user-btn .avatar {
    position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--ledger-navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .82rem; text-transform: uppercase;
}
.user-btn .u-name { font-family: var(--font-heading); font-weight: 600; font-size: .8rem; color: var(--ink); }

/* Footer bar */
.app-footer {
    position: relative; flex-shrink: 0; border-top: 0; background: var(--ledger-navy); color: rgba(255,255,255,.72);
    font-size: .8rem; padding: 18px 24px; display: flex; flex-wrap: wrap; gap: 8px 22px;
    align-items: center; justify-content: space-between; margin-bottom:20px; border-radius:18px;
}
.app-footer::before { content: ""; position: absolute; top: 0; left: 24px; width: 72px; height: 3px; background: var(--accent); }
.app-footer .sep { color: rgba(255,255,255,.28); }
.app-footer strong { color: #fff; font-family: var(--font-heading); font-weight: 600; }
.app-footer-brand { display: flex; align-items: center; gap: 10px; }
.app-footer-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--ledger-navy); font-family: var(--font-heading); font-size: .78rem; font-weight: 700; }
.app-footer-tagline { color: rgba(255,255,255,.55); }

/* Mobile drawer backdrop */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(5,32,50,.54); z-index: 1035; opacity: 0; visibility: hidden; transition: opacity var(--t) var(--ease); }
.sidebar-backdrop.show { opacity: 1; visibility: visible; }
body.sidebar-open { overflow: hidden; }

/* ============================================================ Components */
/* Cards — hairline first, shadow restrained. No global hover lift: depth
   changes should mean something, not decorate everything. */
.card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card.shadow, .card.shadow-lg { box-shadow: var(--shadow) !important; }
.card .card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line-2);
    font-weight: 600; font-size: .92rem;
    padding: .9rem 1.1rem;
    border-top-left-radius: var(--r-lg) !important;
    border-top-right-radius: var(--r-lg) !important;
}
.card .card-body { padding: 1.05rem 1.1rem; }
.card .card-footer { background: var(--surface); border-top: 1px solid var(--line-2); }

/* Brand header + hero utilities used across pages — flat, no gradients. */
.brand-card-header {
    position: relative; background: var(--ledger-navy) !important;
    color: #fff !important; font-family: var(--font-heading); font-weight: 600; border: 0 !important;
    letter-spacing: -.015em;
}
.brand-card-header::after { content: ""; position: absolute; left: 18px; bottom: 0; width: 34px; height: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }
.cp-hero, .mm-hero, .brand-hero {
    background: var(--ledger-navy) !important;
    color: #fff; border-radius: var(--r-xl); border-bottom: 3px solid var(--accent);
    box-shadow: var(--shadow-sm);
}

/* Buttons — solid means primary; everything else stays quiet. */
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-pill); font-family: var(--font-heading); font-size: .82rem; font-weight: 600; transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 36px; padding-left: .8rem; padding-right: .8rem; font-size: .76rem; }
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
.btn-brand {
    background: var(--ledger-navy) !important; color: #fff !important; border: 1px solid var(--ledger-navy) !important;
}
.btn-brand:hover { background: var(--ledger-navy-2) !important; border-color: var(--ledger-navy-2) !important; color: #fff !important; }
.btn-outline-brand { background: transparent !important; color: var(--brand-700) !important; border: 1px solid var(--brand-200) !important; }
.btn-outline-brand:hover { background: var(--brand-050) !important; color: var(--brand-800) !important; border-color: var(--brand) !important; }
.btn-primary { background-color: var(--ledger-navy); border-color: var(--ledger-navy); }
.btn-primary:hover { background-color: var(--brand-700); border-color: var(--brand-700); }
.btn-outline-primary { color: var(--brand-700); border-color: var(--brand-200); }
.btn-outline-primary:hover { background-color: var(--brand-050); border-color: var(--brand); color: var(--brand-800); }
.btn-outline-secondary { border-color: #d3dbe4; color: var(--ink-2); }
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--ink); border-color: #c3ccd7; }
/* Accent CTA — brand yellow instead of Bootstrap's amber */
.btn-warning { background-color: var(--accent); border-color: var(--accent-600); color: var(--brand-900); }
.btn-warning:hover { background-color: var(--accent-600); border-color: var(--accent-600); color: var(--brand-900); }
/* Semantic outlines follow the token palette, with tinted (not solid) hovers */
.btn-outline-danger { color: var(--err); border-color: var(--err-line); }
.btn-outline-danger:hover { background-color: var(--err-bg); border-color: var(--err); color: var(--err); }
.btn-outline-success { color: var(--ok); border-color: var(--ok-line); }
.btn-outline-success:hover { background-color: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.btn-warning { font-weight: 600; }

/* Forms */
.form-label { font-weight: 800; font-size: .7rem; color: var(--ink-2); margin-bottom: .38rem; letter-spacing: .075em; text-transform: uppercase; }
.form-control, .form-select {
    min-height: 46px; border: 1px solid #bfd0d6; border-radius: 12px; padding: .62rem .82rem; color: var(--ink); background-color: #fff;
    font-size: 1rem;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.form-control:hover, .form-select:hover { border-color: #becbd9; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: var(--ring); }
.form-control::placeholder { color: #607884; opacity: 1; }
.input-group-text { background: var(--surface-2); border-color: #d6dee8; color: var(--muted); border-radius: var(--r-sm); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: var(--ring); }

/* Clear feedback for secure document uploads. Included only on forms that opt
   in with data-upload-progress; it remains usable when JavaScript is off. */
.upload-progress {
    flex: 0 0 100%; margin-top: 2px; padding: 10px 12px;
    border: 1px solid var(--brand-200); border-radius: var(--r-sm);
    background: var(--brand-050); color: var(--ink-2);
}
.upload-progress[hidden] { display: none !important; }
.upload-progress.is-error { border-color: var(--err-line); background: var(--err-bg); color: var(--err); }
.upload-progress__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .76rem; font-weight: 600; }
.upload-progress__value { flex: 0 0 auto; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.upload-progress.is-error .upload-progress__value { color: inherit; }
.upload-progress__track { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #d7e6f1; }
.upload-progress__bar { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brand); transition: width 180ms ease; }
.upload-progress.is-saving .upload-progress__bar { width: 100% !important; animation: uploadPulse 1.05s ease-in-out infinite; }
.upload-progress.is-preparing .upload-progress__bar { width: 36% !important; animation: uploadPulse 1.05s ease-in-out infinite; }
@keyframes uploadPulse { 50% { opacity: .42; } }
@media (prefers-reduced-motion: reduce) { .upload-progress__bar { transition: none; } .upload-progress.is-saving .upload-progress__bar { animation: none; } }

/* Tables — the core financial surface: quiet chrome, legible figures. */
.table { --bs-table-hover-bg: var(--brand-050); color: var(--ink); font-size: .875rem; }
.table > thead th {
    background: var(--paper-deep); color: var(--slate);
    font-weight: 800; font-size: .7rem;
    text-transform: uppercase; letter-spacing: .07em;
    border-bottom: 1px solid var(--line); white-space: nowrap;
    padding-top: .65rem; padding-bottom: .65rem;
}
.table > tbody { font-variant-numeric: tabular-nums; }
.table > tbody > tr { transition: background var(--t-fast) var(--ease); }
.table > tbody > tr > td { border-color: var(--line-2); vertical-align: middle; padding-top: .68rem; padding-bottom: .68rem; }
.table-hover > tbody > tr:hover > * { background: var(--brand-050); }
.table .btn-sm { font-size: .78rem; padding: .28rem .65rem; }

/* Badges — tinted chips with readable text, not saturated blocks. Pages use
   the Bootstrap bg-* utilities everywhere; overriding them here upgrades the
   whole product at once. Meaning is never colour-only (labels always text). */
.badge { font-weight: 600; letter-spacing: .015em; border-radius: var(--r-xs); font-size: .7rem; padding: .34em .55em; }
.badge.rounded-pill { border-radius: var(--r-pill); padding: .38em .7em; }
.badge.bg-success            { background: var(--ok-bg) !important;   color: var(--ok) !important;   border: 1px solid var(--ok-line); }
.badge.bg-danger             { background: var(--err-bg) !important;  color: var(--err) !important;  border: 1px solid var(--err-line); }
.badge.bg-warning            { background: var(--warn-bg) !important; color: var(--warn) !important; border: 1px solid var(--warn-line); }
.badge.bg-warning.text-dark  { color: var(--warn) !important; }
.badge.bg-info               { background: var(--info-bg) !important; color: var(--info) !important; border: 1px solid var(--info-line); }
.badge.bg-info.text-dark     { color: var(--info) !important; }
.badge.bg-secondary          { background: var(--line-2) !important;  color: var(--ink-2) !important; border: 1px solid var(--line); }
.badge.bg-dark               { background: var(--ink) !important;     color: #fff !important; }
.badge.bg-primary            { background: var(--brand-050) !important; color: var(--brand-700) !important; border: 1px solid var(--brand-100); }
.badge.bg-light              { border: 1px solid var(--line) !important; color: var(--ink-2) !important; font-weight: 600; }

/* Alerts use a uniform semantic border; status is not communicated by a
   decorative side rail. */
.alert { border: 1px solid transparent; border-radius: var(--r); box-shadow: none; }
.alert-success { background: var(--ok-bg); border-color: var(--ok-line); color: #115c33; }
.alert-warning { background: var(--warn-bg); border-color: var(--warn-line); color: #7a5408; }
.alert-danger  { background: var(--err-bg); border-color: var(--err-line); color: #992020; }
.alert-info    { background: var(--info-bg); border-color: var(--info-line); color: #0b4a7a; }

/* Dropdowns / modals / popovers */
.dropdown-menu { border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-md); padding: .35rem; font-size: .88rem; }
.dropdown-item { border-radius: var(--r-xs); padding: .48rem .7rem; font-weight: 450; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.dropdown-item:hover { background: var(--brand-050); color: var(--brand-700); }
.dropdown-item.text-danger:hover { background: var(--err-bg); color: var(--err) !important; }
.modal-content { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); }

/* Pagination */
.pagination .page-link { color: var(--brand-700); border-color: var(--line); font-weight: 500; }
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .page-link:focus { box-shadow: var(--ring); }

/* List groups */
.list-group-item { border-color: var(--line-2); }
.list-group-item-action:hover { background: var(--surface-2); }

/* Nav pills / tabs occasionally used on pages */
.nav-pills .nav-link { color: var(--ink-2); font-weight: 500; border-radius: var(--r-sm); }
.nav-pills .nav-link.active { background: var(--brand); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--brand-800); border-bottom-color: var(--brand); font-weight: 600; }

/* Spinners keep brand tone */
.spinner-border, .spinner-grow { color: var(--brand); }

/* ------------------------------------------------- Shared data components */
/* KPI stat card (dashboards, HR, leave). Yellow hairline = the brand accent
   used structurally: a 26px rule, not a background. */
.hr-kpi, .kpi-tile {
    position: relative;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 14px 16px 12px;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.hr-kpi::before, .kpi-tile::before {
    content: ""; position: absolute; top: -1px; left: 14px; width: 26px; height: 3px;
    background: var(--accent); border-radius: 0 0 2px 2px;
}
.hr-kpi:hover, .kpi-tile:hover { border-color: var(--brand-200); box-shadow: var(--shadow-xs); }
.hr-kpi .num, .kpi-tile .num {
    font-size: 1.65rem; font-weight: 600; color: var(--brand-800); line-height: 1.1;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.hr-kpi .lbl, .kpi-tile .lbl { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; margin-top: 4px; }

/* Clickable KPI tiles (used as filter links / shortcuts on list pages) */
a.kpi-tile { display: block; text-decoration: none; color: inherit; }
a.kpi-tile:hover .num { color: var(--brand); }
.kpi-tile.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.kpi-tile .sub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.kpi-tile .num .bi { font-size: 1.05rem; vertical-align: 2px; }

/* Compact chart card used by the analytics widgets */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.chart-card .chart-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px 0;
}
.chart-card .chart-card-title {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--muted); font-weight: 600;
}
.chart-card .chart-card-hint { font-size: .72rem; color: var(--muted); }
.chart-card .chart-card-body { padding: 8px 12px 12px; }

/* Section micro-heading used inside cards */
.hr-section-title {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--muted); font-weight: 600; margin: 14px 0 8px;
    display: flex; align-items: center; gap: 8px;
}
.hr-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* =============================================== Virah corporate page head */
.vfb-page-head {
    position: relative; isolation: isolate; overflow: hidden;
    min-height: 132px; padding: 24px 26px !important;
    border: 1px solid rgba(6,50,74,.14) !important;
    border-bottom: 0 !important; border-radius: var(--r-xl) !important;
    background-color: var(--paper) !important;
    background-image:
        linear-gradient(rgba(6,50,74,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6,50,74,.035) 1px, transparent 1px) !important;
    background-size: 40px 40px !important;
    box-shadow: var(--shadow-sm) !important; color: var(--ink) !important;
}
.vfb-page-head::before {
    content: ""; position: absolute; z-index: -1; right: -54px; bottom: -92px;
    width: 190px; height: 190px; border: 28px solid rgba(248,232,16,.9);
    border-radius: 50%; pointer-events: none;
}
.vfb-page-head::after {
    content: ""; position: absolute; left: 26px; top: 0;
    width: 52px; height: 4px; border-radius: 0 0 4px 4px;
    background: var(--accent);
}
.vfb-page-head h1,
.vfb-page-head h2,
.vfb-page-head h3,
.vfb-page-head h4 {
    position: relative; margin: 0; color: var(--ledger-navy) !important;
    font-family: var(--font-heading); font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    font-weight: 620; letter-spacing: -.035em;
}
.vfb-page-head h1 i,
.vfb-page-head h2 i,
.vfb-page-head h3 i,
.vfb-page-head h4 i { color: var(--virah-blue); }
.vfb-page-head p { position: relative; max-width: 760px; color: var(--slate) !important; font-size: .96rem; }
.vfb-page-head .badge { position: relative; }

/* Customer KYC uses the public website language with operational density. */
body[data-app-area="customer-kyc"] .app-content > .container-fluid { max-width: 1540px; margin-inline: auto; }
body[data-app-area="customer-kyc"] .card { border-color: rgba(6,50,74,.13); }
body[data-app-area="customer-kyc"] .card-header:not(.brand-card-header) { background: var(--paper); }
body[data-app-area="customer-kyc"] .kpi-tile,
body[data-app-area="customer-kyc"] .hr-kpi,
body[data-app-area="customer-kyc"] .fc-kpi { border: 1px solid rgba(6,50,74,.13); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
body[data-app-area="customer-kyc"] .kpi-tile .num,
body[data-app-area="customer-kyc"] .hr-kpi .num,
body[data-app-area="customer-kyc"] .fc-kpi .num { font-family: var(--font-heading); font-weight: 620; color: var(--ledger-navy); }
body[data-app-area="customer-kyc"] .kpi-tile .lbl,
body[data-app-area="customer-kyc"] .hr-kpi .lbl,
body[data-app-area="customer-kyc"] .fc-kpi .lbl { color: var(--slate); font-weight: 800; }
.vfb-customer-identity { position: relative; overflow: hidden; border-radius: var(--r-xl) !important; }
.vfb-customer-identity::after { content: ""; position: absolute; width: 150px; height: 150px; right: -78px; bottom: -92px; border: 22px solid var(--accent); border-radius: 50%; pointer-events: none; }
.vfb-customer-identity .card-body { position: relative; z-index: 1; padding: 1.3rem 1.4rem; }
.vfb-customer-identity h1,
.vfb-customer-identity h2 { color: var(--ledger-navy); font-size: clamp(1.25rem, 2vw, 1.65rem); }
.kyc-results-table { min-width: 880px; }
.cx-reveal {
    min-width: 44px; min-height: 44px; display: inline-flex; align-items: center;
    justify-content: center; border-radius: 50%; touch-action: manipulation;
}
.kyc-scroll-hint { display: none; color: var(--muted); font-size: .76rem; padding: 8px 14px; border-top: 1px solid var(--line-2); }
.table-responsive { scrollbar-color: rgba(6,50,74,.32) transparent; }

@media (max-width: 767.98px) {
    body { font-size: 16px; }
    .vfb-page-head { min-height: 0; padding: 20px !important; border-radius: 22px !important; }
    .vfb-page-head::before { right: -78px; bottom: -112px; opacity: .72; }
    .vfb-page-head::after { left: 20px; }
    .vfb-page-head p { padding-right: 28px; font-size: .9rem; }
    body[data-app-area="customer-kyc"] .app-content > .container-fluid { padding: 14px !important; }
    body[data-app-area="customer-kyc"] .form-control,
    body[data-app-area="customer-kyc"] .form-select { min-height: 48px; font-size: 16px; }
    body[data-app-area="customer-kyc"] .btn:not(.btn-sm),
    body[data-app-area="customer-kyc"] button:not(.btn-close) { min-height: 44px; }
    .kyc-scroll-hint { display: block; }
    .table-responsive { border-radius: 0 0 var(--r-lg) var(--r-lg); }
    .kyc-record-table { width:100%; min-width:0; }
    .kyc-record-table thead { display:none; }
    .kyc-record-table tbody { display:block; padding:8px; }
    .kyc-record-table tbody > tr:not(.pep-no-match) {
        display:block; margin-bottom:9px; padding:11px 12px;
        border:1px solid var(--line); border-radius:14px; background:#fff;
        box-shadow:var(--shadow-xs);
    }
    .kyc-record-table tbody > tr:not(.pep-no-match):last-child { margin-bottom:0; }
    .kyc-record-table tbody > tr:not(.pep-no-match) > td {
        display:grid; grid-template-columns:minmax(108px,.78fr) minmax(0,1.22fr);
        gap:10px; width:100%; padding:6px 0 !important; border:0; text-align:left !important;
        overflow-wrap:anywhere;
    }
    .kyc-record-table tbody > tr:not(.pep-no-match) > td::before {
        content:attr(data-label); color:var(--slate); font-size:.67rem; font-weight:800;
        letter-spacing:.075em; line-height:1.35; text-transform:uppercase;
    }
    .kyc-record-table td[data-label="Action"],
    .kyc-record-table td[data-label="Decision"],
    .kyc-record-table td[data-label="Profile"] { display:block !important; padding-top:10px !important; }
    .kyc-record-table td[data-label="Action"]::before,
    .kyc-record-table td[data-label="Decision"]::before,
    .kyc-record-table td[data-label="Profile"]::before { display:block; margin-bottom:7px; }
    .kyc-record-table td[data-label="Action"] .btn,
    .kyc-record-table td[data-label="Profile"] .btn { min-width:44px; min-height:44px; }
    .kyc-decision-stack { align-items:stretch !important; }
    .kyc-decision-stack form { width:100%; }
    .kyc-decision-stack form.d-flex { flex-wrap:wrap; }
    .kyc-decision-stack input[name="review_notes"],
    .kyc-review-actions input[name="review_notes"] { width:100% !important; max-width:none !important; min-height:44px; }
    .kyc-review-actions form.d-flex { flex:1 1 100%; flex-wrap:wrap; }
    .kyc-review-actions form.d-flex .btn { flex:1 1 auto; }
}

@media (max-width: 575.98px) {
    .kyc-results-table { min-width: 0; width: 100%; }
    .kyc-results-table thead { display: none; }
    .kyc-results-table tbody,
    .kyc-results-table tr,
    .kyc-results-table td { display: block; width: 100%; }
    .kyc-results-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .kyc-results-table tr:last-child { border-bottom: 0; }
    .kyc-results-table td { display: grid; grid-template-columns: minmax(96px,.72fr) minmax(0,1.28fr); gap: 12px; padding: 5px 0 !important; border: 0; text-align: left !important; }
    .kyc-results-table td::before { content: attr(data-label); color: var(--slate); font-size: .68rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
    .kyc-results-table td:first-child { display: block; padding-bottom: 10px !important; color: var(--ledger-navy); font-family: var(--font-heading); font-size: 1rem; }
    .kyc-results-table td:first-child::before { display: none; }
    .kyc-results-table td:last-child { display: block; padding-top: 10px !important; }
    .kyc-results-table td:last-child::before { display: none; }
    .kyc-results-table td:last-child .btn { width: 100%; }
}

/* Avatars (employee file header + registry thumbnails) */
.hr-avatar {
    width: 72px; height: 72px; border-radius: var(--r); background: var(--brand-050); color: var(--brand-700);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.6rem;
    overflow: hidden; border: 1px solid var(--brand-100);
}
.hr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hr-avatar-sm {
    width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--brand-050); color: var(--brand-700);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem;
    overflow: hidden; border: 1px solid var(--brand-100);
}
.hr-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* Definition-list metadata (employee file) */
.hr-meta dt { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 600; }
.hr-meta dd { font-weight: 500; color: var(--ink); margin-bottom: .55rem; }

/* =============================================================== Motion */
@keyframes appFade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
    /* Dropdowns fade only (no transform) so Bootstrap's Popper positioning,
       which sets an inline transform, is left untouched. */
    .dropdown-menu.show { animation: appFade .15s var(--ease) both; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =========================================================== Responsive */
@media (max-width: 991.98px) {
    /* A modal drawer preserves a visible dismissal strip on even the smallest
       phone, rather than taking over the whole screen. */
    html.js-ready .app-sidebar {
        top: 0;
        bottom: 0;
        left: 0;
        width: min(var(--sidebar-w), calc(100vw - 56px));
        max-width: calc(100vw - 56px);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        overflow: hidden;
        overscroll-behavior: contain;
        touch-action: pan-y;
        transform: translate3d(-105%, 0, 0);
        box-shadow: 0 18px 48px rgba(0,0,0,.42);
        border-radius: 0 24px 24px 0;
        will-change: transform;
    }
    html.js-ready .app-sidebar.show { transform: translate3d(0, 0, 0); }
    @supports (height: 100dvh) {
        html.js-ready .app-sidebar { height: 100dvh; bottom: auto; }
    }
    html.js-ready .app-sidebar .sb-scroll {
        min-height: 0;
        padding: 10px 12px 16px;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    html.js-ready .sb-brand { gap: 8px; padding: 14px 16px 12px; }
    html.js-ready .sb-brand .logo-img { width: 140px; max-width: 100%; }
    html.js-ready .sb-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
    html.js-ready .sb-close { flex-basis: 48px; width: 48px; height: 48px; touch-action: manipulation; }
    html.js-ready .sb-link,
    html.js-ready .sb-sec-toggle { min-height: 48px; touch-action: manipulation; }
    .sidebar-backdrop { touch-action: manipulation; }
    /* Fixed-body locking prevents iOS from scrolling the page underneath the
       drawer. Other modal surfaces retain their own scroll-lock behaviour. */
    body.sidebar-open:not(.modal-open):not(.ui-drawer-open) {
        position: fixed; left: 0; right: 0; top: var(--sidebar-scroll-offset, 0px); width: 100%;
    }
    .app-main { margin-left: 0; padding-right:0; }
    .app-topbar { top:0; margin-top:0; border-width:0 0 1px; border-radius:0; }
    .topbar-mobile-brand { display:inline-flex; }
    .app-footer { margin-bottom:0; border-radius:0; }
    html.js-ready .topbar-toggle, html.js-ready .sb-close { display: inline-flex; }
    html:not(.js-ready) .topbar-toggle { display: none; }
    .branch-chip .lbl { display: none; }
    /* Keep the portal navigable if app.js is blocked or fails before marking
       the enhanced mobile drawer as ready. */
    html:not(.js-ready) .app-shell { display: block; }
    html:not(.js-ready) .app-sidebar {
        position: static; width: auto; min-height: 0; max-height: none; transform: none; box-shadow: none;
    }
    html:not(.js-ready) .app-sidebar .sb-scroll { overflow: visible; }
    html:not(.js-ready) .app-sidebar .collapse {
        display: block !important; height: auto !important; visibility: visible !important;
    }
}
@media (max-width: 575.98px) {
    .user-btn .u-name { display: none; }
    .app-topbar { height: 70px; padding: 0 14px; gap: 10px; }
    .app-topbar::after { left: 14px; }
    .topbar-kicker { display: none; }
    .topbar-title { font-size: 1rem; }
    .branch-chip { display: none; }
    .topbar-actions { gap: 6px; }
    .app-footer { padding: 18px 16px; align-items: flex-start; flex-direction: column; }
    .app-footer::before { left: 16px; }
}
@media (max-width: 359.98px) {
    .topbar-mobile-brand { display:none; }
}

/* =================================================== Payments shell reset
   The staff portal now shares the same information architecture as the
   SmartRemit Payments product: one global brand bar, a 244px identity rail
   on desktop and four clear, touch-sized destinations on mobile. This block
   intentionally sits after the legacy shell rules while pages are migrated,
   keeping every server-rendered route and existing Bootstrap interaction
   available. */

.topbar-brand { display: inline-flex; align-items: center; flex: 0 0 auto; min-width: 190px; }
.topbar-brand img { display:block; width:170px; height:46px; object-fit:contain; object-position:left center; }

@media (min-width: 992px) {
    .app-shell {
        display: flex;
        align-items: flex-start;
        gap: 24px;
        min-height: 100vh;
        padding: calc(var(--topbar-h) + 24px) 24px 24px;
    }
    .app-sidebar {
        position: sticky;
        top: calc(var(--topbar-h) + 16px);
        left: auto;
        bottom: auto;
        width: 244px;
        height: calc(100vh - var(--topbar-h) - 40px);
        flex: 0 0 244px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: var(--r-lg);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }
    .app-main { min-width:0; margin-left:0; padding-right:0; }
    .app-topbar {
        position: fixed;
        inset: 0 0 auto;
        z-index: 1030;
        width:100%;
        height:var(--topbar-h);
        margin:0;
        padding:0 28px;
        border:0;
        border-top:4px solid var(--accent);
        border-bottom:1px solid var(--line);
        border-radius:0;
        background:rgba(255,253,250,.98);
        box-shadow:0 2px 12px rgba(6,50,74,.045);
        backdrop-filter: blur(12px) saturate(130%);
        -webkit-backdrop-filter: blur(12px) saturate(130%);
    }
    .app-topbar::after { display:none; }
    .app-topbar.scrolled { box-shadow:0 7px 22px rgba(6,50,74,.09); }
    .app-footer { margin:24px 0 0; border-radius:var(--r-lg); }
}

/* Desktop identity header: it replaces the old logo-at-top/dark-footer
   split and mirrors the Payments account rail. */
.sb-identity {
    display:flex;
    align-items:center;
    gap:11px;
    min-height:104px;
    padding:18px 16px;
    background:var(--ledger-navy);
    color:#fff;
}
.sb-identity-avatar {
    width:44px;
    height:44px;
    flex:0 0 44px;
    display:grid;
    grid-template-areas:"avatar";
    place-items:center;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.24);
    border-radius:50%;
    background:var(--virah-blue);
    color:#fff;
    font-family:var(--font-heading);
    font-size:.78rem;
    font-weight:650;
    letter-spacing:.03em;
    text-transform:uppercase;
}
.portal-avatar-fallback { grid-area:avatar; display:grid; width:100%; height:100%; place-items:center; }
.sb-identity-avatar img { grid-area:avatar; width:100%; height:100%; object-fit:cover; }
.sb-identity-copy { min-width:0; }
.sb-identity-kicker {
    color:rgba(255,255,255,.62);
    font-size:.62rem;
    font-weight:700;
    letter-spacing:.1em;
    line-height:1.2;
    text-transform:uppercase;
}
.sb-identity-name {
    margin-top:3px;
    overflow:hidden;
    color:#fff;
    font-family:var(--font-heading);
    font-size:.84rem;
    font-weight:600;
    line-height:1.25;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.sb-identity-branch {
    display:flex;
    align-items:center;
    gap:5px;
    margin-top:4px;
    overflow:hidden;
    color:#a9cbde;
    font-size:.68rem;
    font-weight:600;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.sb-identity-branch i { color:var(--accent); }
.sb-identity-branch svg { width:13px; height:13px; color:var(--accent); stroke-width:2; }
.sb-scroll { padding:11px 10px 15px; }
.sb-section { padding:2px 0; }
.sb-sec-toggle {
    min-height:44px;
    padding:8px 10px;
    border-radius:10px;
    color:var(--muted);
    font-size:.65rem;
    letter-spacing:.09em;
}
.sb-sec-toggle:hover { background:var(--brand-050); color:var(--brand-800); }
.sb-sec-toggle[aria-expanded="true"] { color:var(--ink); }
.sb-sec-direct.active { box-shadow:none; }
.sb-sec-body { padding:3px 0 7px; }
.sb-sec-body .sb-link { padding-left:15px; }
.sb-link {
    min-height:44px;
    margin-bottom:2px;
    padding:8px 10px;
    border-radius:10px;
    color:var(--ink-2);
    font-size:.86rem;
    font-weight:600;
}
.sb-link svg { width:19px; height:19px; flex:0 0 19px; color:var(--virah-blue-deep); stroke-width:2; }
.sb-link.active svg { color:#fff; }
.sb-sec-ico { width:18px; height:18px; flex:0 0 18px; }
.sb-caret, .sb-direct-arrow { width:15px; height:15px; flex:0 0 15px; }
.sb-link::before { display:none; }
.sb-link.active, .sb-sec-direct.active { background:var(--virah-blue); box-shadow:none; }
.sb-foot {
    display:grid;
    gap:5px;
    padding:10px;
    border-top:1px solid var(--line-2);
    background:var(--surface);
}
.sb-settings, .sb-signout {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:42px;
    padding:8px 12px;
    border-radius:10px;
    font-family:var(--font-heading);
    font-size:.77rem;
    font-weight:600;
    text-decoration:none;
}
.sb-settings svg, .sb-signout svg { width:16px; height:16px; stroke-width:2; }
.sb-settings { border:1px solid transparent; color:var(--ink-2); }
.sb-settings:hover { background:var(--brand-050); color:var(--brand-800); }
.sb-signout {
    margin:0;
    border:1px solid var(--line);
    background:var(--surface);
    color:var(--muted);
}
.sb-signout:hover { border-color:var(--err-line); background:var(--err-bg); color:var(--err); }

/* The top bar contains the official wordmark on desktop; personal identity is
   duplicated only as a compact, accessible account control. */
.topbar-heading { display:flex; flex-direction:column; justify-content:center; }
.topbar-kicker { color:var(--muted); font-size:.62rem; letter-spacing:.1em; }
.topbar-title { font-size:1rem; }
.topbar-sub { font-size:.75rem; }
.branch-chip { min-height:38px; background:var(--brand-050); border-color:var(--brand-100); color:var(--brand-800); }
.user-btn { border-color:transparent; background:transparent; padding:4px; }
.user-btn:hover { border-color:var(--brand-100); background:var(--brand-050); box-shadow:none; }
.user-btn .avatar { width:36px; height:36px; overflow:hidden; background:var(--ledger-navy); }
.user-btn .avatar img { width:100%; height:100%; object-fit:cover; }

/* Payments-style content surfaces. A light icon/number tile creates the
   hierarchy formerly supplied by dark headers and decorative yellow dashes. */
body .brand-card-header {
    display:flex;
    align-items:center;
    gap:10px;
    min-height:60px;
    padding:14px 17px !important;
    border-bottom:1px solid var(--line-2) !important;
    background:var(--surface) !important;
    color:var(--ink) !important;
    font-family:var(--font-heading);
    font-size:.86rem;
    font-weight:600;
    letter-spacing:0;
}
body .brand-card-header::after { display:none !important; }
body .brand-card-header > i:first-child,
body .brand-card-header > span:first-child > i:first-child {
    width:28px;
    height:28px;
    flex:0 0 28px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin:0 !important;
    border-radius:9px;
    background:var(--brand-050);
    color:var(--virah-blue-deep);
    font-size:.9rem;
}
body .brand-card-header__copy { min-width:0; display:grid; flex:1; grid-template-columns:28px minmax(0,1fr); column-gap:10px; align-items:center; }
body .brand-card-header__copy > i:first-child { grid-row:1 / span 2; }
body .brand-card-header__copy strong { grid-column:2; color:var(--ink); font-size:.86rem; font-weight:600; line-height:1.22; }
body .brand-card-header__copy small { grid-column:2; margin-top:2px; overflow:hidden; color:var(--muted); font-family:var(--font); font-size:.7rem; font-weight:500; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
body .brand-card-header .badge { margin-left:auto; }
body .hr-kpi, body .kpi-tile, body .fc-kpi {
    min-height:96px;
    padding:15px 16px;
    border:1px solid var(--line) !important;
    border-radius:var(--r) !important;
    background:var(--surface) !important;
    box-shadow:var(--shadow-xs) !important;
}
body .hr-kpi::before, body .kpi-tile::before { display:none !important; }
body .hr-kpi .num, body .kpi-tile .num, body .fc-kpi .num {
    color:var(--ink) !important;
    font-family:var(--font-heading);
    font-size:1.45rem;
    font-weight:620;
}
body .hr-kpi .lbl, body .kpi-tile .lbl, body .fc-kpi .lbl {
    color:var(--muted) !important;
    font-size:.66rem;
    font-weight:700;
    letter-spacing:.08em;
}
.metric-card-icon {
    position:absolute;
    top:14px;
    right:14px;
    width:32px;
    height:32px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:var(--brand-050);
    color:var(--virah-blue-deep);
}
.metric-card-icon svg, .metric-card-icon i { width:16px; height:16px; font-size:16px; stroke-width:2; }
.vfb-section-heading {
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:15px 18px;
    border-bottom:1px solid var(--line-2);
}
.vfb-section-heading__icon {
    width:28px;
    height:28px;
    flex:0 0 28px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:var(--brand-050);
    color:var(--virah-blue-deep);
    font-size:.86rem;
}
.vfb-section-heading h2, .vfb-section-heading h3 { margin:0; color:var(--ink); font-size:.88rem; font-weight:600; }
.vfb-section-heading p { margin:2px 0 0; color:var(--muted); font-size:.76rem; line-height:1.35; }

/* This legacy class appears on the former oversized KYC banners. It now
   degrades to an unobtrusive context row while each page is simplified. */
body .vfb-page-head {
    min-height:0;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
}
body .vfb-page-head::before, body .vfb-page-head::after { display:none !important; }
body .vfb-page-head h1, body .vfb-page-head h2, body .vfb-page-head h3, body .vfb-page-head h4 { font-size:1rem; }
.page-context {
    display:flex;
    align-items:center;
    gap:9px;
    min-height:40px;
    margin-bottom:14px;
    color:var(--muted);
    font-size:.8rem;
}
.page-context__icon {
    width:30px;
    height:30px;
    flex:0 0 30px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:var(--brand-050);
    color:var(--virah-blue-deep);
}
.page-context__end { margin-left:auto; }

.mobile-bottom-nav { display:none; }

@media (max-width: 991.98px) {
    body { padding-bottom:calc(72px + env(safe-area-inset-bottom)); }
    .app-shell { display:block; min-height:100vh; padding-top:calc(72px + env(safe-area-inset-top)); }
    .app-sidebar, .sidebar-backdrop { display:none !important; }
    .app-main { margin-left:0; padding-right:0; }
    .app-topbar {
        position:fixed;
        top:0;
        left:0;
        right:0;
        z-index:1030;
        height:calc(72px + env(safe-area-inset-top));
        margin:0;
        padding:calc(env(safe-area-inset-top) + 8px) 16px 8px;
        border:0;
        border-top:4px solid var(--accent);
        border-bottom:1px solid var(--line);
        border-radius:0;
        background:rgba(255,253,250,.98);
        box-shadow:0 2px 12px rgba(6,50,74,.05);
    }
    .app-topbar::after, .topbar-brand, .topbar-toggle, .topbar-mobile-brand { display:none !important; }
    .topbar-heading { min-width:0; }
    .topbar-kicker { display:block; font-size:.58rem; }
    .topbar-title { max-width:62vw; font-size:.96rem; }
    .topbar-sub { display:none !important; }
    .branch-chip { display:none; }
    .topbar-actions { margin-left:auto; gap:0; }
    .user-btn .u-name, .user-btn > i { display:none; }
    .user-btn { min-width:44px; min-height:44px; justify-content:center; }
    .user-btn .avatar { width:36px; height:36px; }
    .app-content > .container-fluid { padding:14px !important; }
    .app-footer { margin:12px 0 calc(72px + env(safe-area-inset-bottom)); border-radius:0; }

    .mobile-bottom-nav {
        position:fixed;
        right:0;
        bottom:0;
        left:0;
        z-index:1050;
        display:grid;
        grid-template-columns:repeat(4, minmax(0,1fr));
        min-height:calc(64px + env(safe-area-inset-bottom));
        padding:5px 8px calc(5px + env(safe-area-inset-bottom));
        border-top:1px solid var(--line);
        background:rgba(255,253,250,.98);
        box-shadow:0 -5px 18px rgba(6,50,74,.08);
        backdrop-filter:blur(12px) saturate(130%);
        -webkit-backdrop-filter:blur(12px) saturate(130%);
    }
    .mobile-bottom-nav__item {
        min-width:0;
        min-height:54px;
        display:flex;
        align-items:center;
        justify-content:center;
        flex-direction:column;
        gap:3px;
        border:0;
        border-radius:10px;
        background:transparent;
        color:var(--muted);
        font-family:var(--font);
        font-size:.65rem;
        font-weight:650;
        line-height:1;
        text-decoration:none;
    }
    .mobile-bottom-nav__item svg, .mobile-bottom-nav__item > i { width:19px; height:19px; font-size:19px; stroke-width:2; }
    .mobile-bottom-nav__item.is-active { background:var(--brand-050); color:var(--virah-blue-deep); }
    .mobile-bottom-nav__item:focus-visible { box-shadow:var(--ring); }
    body .brand-card-header { min-height:58px; padding:13px 14px !important; }
    body .brand-card-header > i:first-child, body .brand-card-header > span:first-child > i:first-child { width:27px; height:27px; flex-basis:27px; }
    body .hr-kpi, body .kpi-tile, body .fc-kpi { min-height:88px; padding:13px; }
    .metric-card-icon { top:12px; right:12px; }
    body .vfb-page-head { margin-bottom:0 !important; }
    .page-context { margin:0 0 10px; }
}

@media (max-width: 359.98px) {
    .mobile-bottom-nav { padding-inline:4px; }
    .mobile-bottom-nav__item { font-size:.6rem; }
}

/* ================================================= Staff360 Leave V2 ===== */
.lv2-shell { width: 100%; min-width: 0; display: grid; gap: 16px; }
.lv2-shell > * { min-width: 0; max-width: 100%; }
.lv2-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-width: 0; min-height: 48px;
}
.lv2-toolbar > div { min-width: 0; }
.lv2-title { margin: 0; color: var(--ink); font-size: 1.08rem; font-weight: 650; }
.lv2-subtitle { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.lv2-tabs {
    display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
    width: 100%; min-width: 0; max-width: 100%;
    padding: 4px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r); box-shadow: var(--shadow-xs);
}
.lv2-tabs a {
    min-height: 40px; display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px; border-radius: var(--r-sm); color: var(--muted);
    text-decoration: none; white-space: nowrap; font-size: .8rem; font-weight: 600;
}
.lv2-tabs a:hover { color: var(--brand-700); background: var(--brand-050); }
.lv2-tabs a.active {
    color: var(--brand-700); background: var(--brand-050);
    box-shadow: inset 0 0 0 1px var(--brand-100);
}
.lv2-grid { display: grid; gap: 14px; }
.lv2-grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lv2-grid--two { grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); }
.lv2-grid--reports { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lv2-panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs); min-width: 0;
}
.lv2-panel__head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 15px 17px; border-bottom: 1px solid var(--line-2);
}
.lv2-panel__head h2, .lv2-panel__head h3 {
    color: var(--ink); font-size: .92rem; font-weight: 650; margin: 0;
}
.lv2-panel__head p { color: var(--muted); font-size: .75rem; margin: 3px 0 0; }
.lv2-panel__body { padding: 16px 17px; }
.lv2-panel__body--flush { padding: 0; }
.lv2-stat {
    position: relative; display: flex; justify-content: space-between; gap: 12px;
    min-height: 110px; padding: 16px; color: inherit; text-decoration: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.lv2-stat::before {
    content: ""; position: absolute; left: 15px; top: -1px; width: 26px;
    height: 3px; background: var(--accent); border-radius: 0 0 2px 2px;
}
.lv2-stat:hover { color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-xs); }
.lv2-stat__label {
    color: var(--muted); font-size: .67rem; font-weight: 650;
    letter-spacing: .075em; text-transform: uppercase;
}
.lv2-stat strong {
    display: block; margin-top: 8px; color: var(--brand-800); font-size: 1.75rem;
    font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums;
}
.lv2-stat small { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; }
.lv2-stat__icon {
    width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
    border: 1px solid var(--brand-100); border-radius: var(--r-sm);
    color: var(--brand-700); background: var(--brand-050); font-size: 1rem;
}
.lv2-balance-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.lv2-balance {
    display: flex; align-items: center; gap: 10px; min-height: 94px;
    padding: 12px; border: 1px solid var(--line); border-radius: var(--r);
    background: var(--surface);
}
.lv2-balance svg { width: 62px; height: 62px; flex: 0 0 62px; }
.lv2-balance__name { color: var(--ink); font-size: .79rem; font-weight: 650; }
.lv2-balance__meta { color: var(--muted); font-size: .7rem; margin-top: 3px; line-height: 1.35; }
.lv2-queue {
    border: 1px solid var(--brand-100); box-shadow: 0 0 0 3px rgba(2,122,182,.04);
}
.lv2-queue .lv2-panel__head { background: var(--brand-050); }
.lv2-request-list { display: grid; }
.lv2-request-card {
    display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(150px, .85fr) 100px 120px auto;
    gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.lv2-request-card:last-child { border-bottom: 0; }
.lv2-request-card:hover { background: var(--surface-2); }
.lv2-person { display: flex; align-items: center; min-width: 0; gap: 9px; }
.lv2-person__avatar {
    width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
    overflow: hidden; border: 1px solid var(--brand-100); border-radius: var(--r-sm);
    color: var(--brand-700); background: var(--brand-050); font-size: .78rem; font-weight: 700;
}
.lv2-person__avatar img { width: 100%; height: 100%; object-fit: cover; }
.lv2-person__name { overflow: hidden; color: var(--ink); font-size: .82rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.lv2-person__meta, .lv2-request-meta { color: var(--muted); font-size: .7rem; line-height: 1.45; }
.lv2-request-main { color: var(--ink-2); font-size: .78rem; font-weight: 550; }
.lv2-request-actions { display: flex; justify-content: flex-end; gap: 6px; }
.lv2-empty {
    padding: 30px 20px; text-align: center; color: var(--muted);
}
.lv2-empty__icon {
    width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 9px;
    border-radius: var(--r); color: var(--brand-700); background: var(--brand-050);
    border: 1px solid var(--brand-100); font-size: 1.1rem;
}
.lv2-empty h3 { margin: 0 0 4px; color: var(--ink); font-size: .9rem; font-weight: 650; }
.lv2-empty p { margin: 0 auto; max-width: 460px; font-size: .78rem; }
.lv2-form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.lv2-senior-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lv2-senior-action-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.lv2-senior-action-card h3 { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--ink); font-size: .86rem; font-weight: 700; }
.lv2-senior-action-card h3 i { color: var(--brand-600); font-size: 1rem; }
.lv2-senior-action-card p { margin: 5px 0 13px; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.lv2-senior-action-card--approve { border-color: #b7ddc6; background: #f5fbf7; }
.lv2-senior-action-card--approve h3 i { color: #198754; }
.lv2-senior-action-card--reject { border-color: #f1c1c8; background: #fff8f8; }
.lv2-senior-action-card--reject h3 i { color: #bb2d3b; }
.lv2-senior-date-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(130px, .75fr); gap: 12px; }
.lv2-span-12 { grid-column: span 12; }
.lv2-span-8 { grid-column: span 8; }
.lv2-span-6 { grid-column: span 6; }
.lv2-span-4 { grid-column: span 4; }
.lv2-span-3 { grid-column: span 3; }
.lv2-field label {
    display: block; margin-bottom: 5px; color: var(--ink-2); font-size: .73rem; font-weight: 650;
}
.lv2-field .form-control, .lv2-field .form-select { min-height: 44px; font-size: .82rem; }
.lv2-field textarea.form-control { min-height: 104px; resize: vertical; }
.lv2-field__hint { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; }
.lv2-type-help {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px;
    color: var(--muted); font-size: .68rem;
}
.lv2-preview {
    min-height: 88px; padding: 14px; border: 1px dashed var(--brand-200);
    border-radius: var(--r); background: var(--brand-050); color: var(--ink-2);
}
.lv2-preview.is-error { border-color: var(--err-line); background: var(--err-bg); color: var(--err); }
.lv2-preview__message { display: flex; align-items: center; min-height: 58px; gap: 9px; font-size: .78rem; }
.lv2-preview__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lv2-preview__grid > div {
    padding: 8px 10px; border: 1px solid var(--brand-100);
    border-radius: var(--r-sm); background: var(--surface);
}
.lv2-preview__grid span { display: block; color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; }
.lv2-preview__grid strong { display: block; margin-top: 3px; color: var(--brand-800); font-size: .86rem; font-weight: 650; }
.lv2-explain {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 8px;
    padding: 4px 0; border: 0; color: var(--brand-700); background: transparent;
    font-size: .72rem; font-weight: 650;
}
.lv2-explain:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lv2-breakdown { max-height: 220px; overflow-y: auto; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--brand-100); }
.lv2-breakdown ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lv2-breakdown li { display: flex; justify-content: space-between; gap: 12px; font-size: .7rem; }
.lv2-breakdown time { color: var(--ink-2); font-weight: 550; }
.lv2-breakdown span { color: var(--muted); text-align: right; }
.lv2-filters {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
    padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface-2);
}
.lv2-filters label { display: block; margin-bottom: 3px; color: var(--muted); font-size: .64rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.lv2-filters .form-control, .lv2-filters .form-select, .lv2-filters .btn { min-height: 40px; font-size: .76rem; }
.lv2-status {
    display: inline-flex; align-items: center; gap: 5px; min-height: 26px;
    padding: 3px 7px; border: 1px solid var(--line); border-radius: var(--r-pill);
    color: var(--ink-2); background: var(--surface-2); font-size: .68rem; font-weight: 650;
    white-space: nowrap;
}
.lv2-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.lv2-status--pending, .lv2-status--recommended { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.lv2-status--pending::before, .lv2-status--recommended::before { background: var(--warn); }
.lv2-status--approved, .lv2-status--returned { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.lv2-status--approved::before, .lv2-status--returned::before { background: var(--ok); }
.lv2-status--rejected, .lv2-status--cancelled, .lv2-status--withdrawn { color: var(--err); background: var(--err-bg); border-color: var(--err-line); }
.lv2-status--rejected::before, .lv2-status--cancelled::before, .lv2-status--withdrawn::before { background: var(--err); }
.lv2-calendar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lv2-calendar-controls .btn { min-width: 40px; min-height: 40px; }
.lv2-calendar { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; }
.lv2-calendar caption { padding: 0; font-size: 0; }
.lv2-calendar th {
    padding: 7px 4px; color: var(--muted); font-size: .65rem;
    font-weight: 650; text-align: center; text-transform: uppercase; letter-spacing: .05em;
}
.lv2-calendar td {
    height: 88px; padding: 5px; vertical-align: top; border: 1px solid var(--line-2);
    border-radius: var(--r-xs); background: var(--surface);
}
.lv2-calendar td.is-muted { background: var(--surface-2); }
.lv2-calendar td.is-today { box-shadow: inset 0 0 0 2px var(--brand); }
.lv2-calendar td.has-conflict { border-color: var(--err-line); background: var(--err-bg); }
.lv2-calendar__day { color: var(--muted); font-size: .68rem; font-weight: 650; }
.lv2-calendar__event {
    display: block; overflow: hidden; margin-top: 3px; padding: 2px 4px;
    border-radius: var(--r-xs); color: var(--brand-700); background: var(--brand-050);
    font-size: .62rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap;
}
button.lv2-calendar__more {
    min-height: 28px; margin-top: 2px; padding: 2px 3px; border: 0; color: var(--brand-700);
    background: transparent; font-size: .62rem; font-weight: 650;
}
.lv2-agenda { display: grid; gap: 8px; }
.lv2-agenda__day {
    display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid var(--line-2);
}
.lv2-agenda__day:last-child { border-bottom: 0; }
.lv2-agenda__date { color: var(--brand-800); font-size: .76rem; font-weight: 650; }
.lv2-agenda__events { display: grid; gap: 5px; }
.lv2-agenda__event { color: var(--ink-2); font-size: .76rem; }
.lv2-timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.lv2-timeline::before { content: ""; position: absolute; left: 13px; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.lv2-timeline li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; }
.lv2-timeline__dot {
    width: 27px; height: 27px; z-index: 1; display: grid; place-items: center;
    border: 1px solid var(--brand-100); border-radius: 50%; color: var(--brand-700);
    background: var(--brand-050); font-size: .68rem;
}
.lv2-timeline__title { color: var(--ink); font-size: .78rem; font-weight: 650; }
.lv2-timeline__meta { color: var(--muted); font-size: .68rem; margin-top: 2px; }
.lv2-detail-hero {
    display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px;
    color: #fff; background: var(--brand-800); border-radius: var(--r-lg);
    border-bottom: 3px solid var(--accent); box-shadow: var(--shadow-sm);
}
.lv2-detail-hero h1 { margin: 3px 0 4px; font-size: 1.24rem; font-weight: 650; }
.lv2-detail-hero p { margin: 0; color: #d6ecf8; font-size: .78rem; }
.lv2-detail-hero__number { color: var(--accent); font-family: var(--font-mono); font-size: .72rem; }
.lv2-detail-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.lv2-detail-actions .btn { min-height: 42px; }
.lv2-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lv2-fact { padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); }
.lv2-fact span { display: block; color: var(--muted); font-size: .62rem; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.lv2-fact strong { display: block; margin-top: 3px; color: var(--ink); font-size: .8rem; font-weight: 600; }
.lv2-report-card {
    display: flex; flex-direction: column; min-height: 190px; padding: 16px;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.lv2-report-card__icon {
    width: 38px; height: 38px; display: grid; place-items: center;
    border: 1px solid var(--brand-100); border-radius: var(--r-sm);
    color: var(--brand-700); background: var(--brand-050);
}
.lv2-report-card h3 { margin: 12px 0 5px; color: var(--ink); font-size: .88rem; font-weight: 650; }
.lv2-report-card p { flex: 1; margin: 0 0 12px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.lv2-report-card .btn { align-self: flex-start; min-height: 40px; }
.lv2-disclosure { overflow: hidden; }
.lv2-disclosure > summary {
    min-height: 54px; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 14px 17px; color: var(--ink); cursor: pointer;
    font-size: .86rem; font-weight: 650; list-style: none;
}
.lv2-disclosure > summary::-webkit-details-marker { display: none; }
.lv2-disclosure > summary::after {
    content: "\F282"; margin-left: auto; color: var(--brand-700);
    font-family: "bootstrap-icons"; font-size: .78rem; transition: transform .15s ease;
}
.lv2-disclosure[open] > summary { border-bottom: 1px solid var(--line-2); background: var(--brand-050); }
.lv2-disclosure[open] > summary::after { transform: rotate(180deg); }
.lv2-disclosure > summary small { color: var(--muted); font-size: .68rem; font-weight: 500; }
.lv2-check-row { display: flex; flex-wrap: wrap; gap: 9px; }
.lv2-check-row label, .lv2-check-tile {
    min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
    margin: 0; padding: 9px 11px; border: 1px solid var(--line);
    border-radius: var(--r-sm); color: var(--ink-2); background: var(--surface-2);
    font-size: .75rem; font-weight: 600; cursor: pointer;
}
.lv2-check-row input, .lv2-check-tile input { width: 17px; height: 17px; accent-color: var(--brand); }
.lv2-compact-list { display: grid; }
.lv2-compact-list > div {
    min-height: 50px; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2);
    color: var(--ink-2); font-size: .75rem;
}
.lv2-compact-list > div:last-child { border-bottom: 0; }
.lv2-compact-list strong, .lv2-compact-list small { display: block; }
.lv2-compact-list strong { color: var(--ink); font-size: .78rem; }
.lv2-compact-list small { margin-top: 2px; color: var(--muted); font-size: .67rem; }
.lv2-week-grid { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 9px; }
.lv2-weekday {
    display: grid; gap: 7px; padding: 11px; border: 1px solid var(--line);
    border-radius: var(--r-sm); background: var(--surface-2); font-size: .73rem;
}
.lv2-weekday input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.lv2-weekday .form-control, .lv2-weekday .form-select { min-height: 38px; font-size: .73rem; }
.lv2-workflow-table .form-control, .lv2-workflow-table .form-select { min-width: 130px; min-height: 42px; font-size: .76rem; }
.lv2-step-number {
    width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 50%; color: #fff; background: var(--brand-700);
    font-size: .72rem; font-weight: 700;
}
.lv2-rule-list { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.lv2-rule-list li { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: start; }
.lv2-rule-list i { color: var(--brand-700); font-size: 1rem; }
.lv2-rule-list strong, .lv2-rule-list small { display: block; }
.lv2-rule-list strong { color: var(--ink); font-size: .77rem; }
.lv2-rule-list small { margin-top: 2px; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.lv2-permission-table th:first-child, .lv2-permission-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.lv2-permission-check { color: var(--ok); }
.lv2-permission-no { color: var(--muted-2); }
.lv2-bulkbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 10px 14px;
    border-bottom: 1px solid var(--line-2); background: var(--brand-050);
}
.lv2-bulkbar .btn { min-height: 38px; }
.lv2-pagination {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .72rem;
}
.lv2-fab { display: none; }

@media (max-width: 1199.98px) {
    .lv2-grid--reports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv2-balance-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .lv2-request-card { grid-template-columns: minmax(180px, 1fr) minmax(140px, .8fr) 90px auto; }
    .lv2-request-card > :nth-child(4) { display: none; }
}
@media (max-width: 991.98px) {
    .lv2-grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv2-grid--two { grid-template-columns: 1fr; }
    .lv2-balance-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .lv2-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lv2-request-card { grid-template-columns: minmax(180px, 1fr) minmax(140px, .8fr) auto; }
    .lv2-request-card > :nth-child(3) { display: none; }
    .lv2-week-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
}
@media (max-width: 767.98px) {
    .lv2-shell { gap: 12px; }
    .lv2-toolbar { align-items: flex-start; flex-wrap: wrap; }
    .lv2-grid--reports { grid-template-columns: 1fr; }
    .lv2-form-grid { display: block; }
    .lv2-senior-actions { grid-template-columns: 1fr; }
    .lv2-field { margin-bottom: 12px; }
    .lv2-preview__grid { grid-template-columns: 1fr; }
    .lv2-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv2-request-list { gap: 9px; padding: 10px; background: var(--surface-2); }
    .lv2-request-card {
        display: grid; grid-template-columns: 1fr auto; gap: 8px;
        padding: 13px; border: 1px solid var(--line); border-radius: var(--r);
        background: var(--surface); box-shadow: var(--shadow-xs);
    }
    .lv2-request-card > * { display: block !important; }
    .lv2-request-card .lv2-person { grid-column: 1; }
    .lv2-request-card .lv2-request-main { grid-column: 1; }
    .lv2-request-card .lv2-request-meta { grid-column: 1; }
    .lv2-request-card .lv2-status { grid-column: 2; grid-row: 1; }
    .lv2-request-card .lv2-request-actions { grid-column: 1 / -1; justify-content: stretch; }
    .lv2-request-card .lv2-request-actions .btn { min-height: 44px; flex: 1; }
    .lv2-calendar-month { display: none; }
    .lv2-agenda[hidden] { display: grid !important; }
    .lv2-detail-hero { grid-template-columns: 1fr; }
    .lv2-detail-actions { justify-content: flex-start; }
    .lv2-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv2-fab {
        position: fixed; right: 18px; bottom: 20px; z-index: 1020;
        width: 54px; height: 54px; display: grid; place-items: center;
        border: 0; border-radius: 50%; color: #fff; background: var(--brand);
        box-shadow: var(--shadow-brand); text-decoration: none; font-size: 1.2rem;
    }
}
@media (max-width: 575.98px) {
    .lv2-grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .lv2-stat { min-height: 98px; padding: 13px; }
    .lv2-stat strong { font-size: 1.45rem; }
    .lv2-stat__icon { display: none; }
    .lv2-balance-grid { grid-template-columns: 1fr; }
    .lv2-balance { min-height: 82px; }
    .lv2-panel__head, .lv2-panel__body { padding: 13px; }
    .lv2-senior-action-card { padding: 13px; }
    .lv2-senior-date-row { grid-template-columns: 1fr; gap: 0; }
    .lv2-filters { grid-template-columns: 1fr; }
    .lv2-facts { grid-template-columns: 1fr; }
    .lv2-pagination { align-items: flex-start; flex-direction: column; }
    .lv2-toolbar > .btn { min-height: 44px; }
    .lv2-week-grid { grid-template-columns: 1fr; }
    .lv2-disclosure > summary { padding: 13px; }
    .lv2-disclosure > summary small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .lv2-disclosure > summary::after { transition: none; }
}

/* =========================================================================
   HR redesign component layer (People Directory, Org Chart v2, Employee 360)
   Rendered by assets/js/hr-ui.js + the hr/* views. Namespaces:
   .person (shared atom) - .pd-* - .oc2-* - .e360-* - .ui-drawer - .ui-seg
   ========================================================================= */

/* ------------------------------------------------ Person atom (everywhere) */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .p-av {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: var(--r-sm);
    background: var(--brand-050); color: var(--brand-700);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .95rem; overflow: hidden;
    border: 1px solid var(--brand-100);
}
.person .p-av img { width: 100%; height: 100%; object-fit: cover; }
.person .p-av--lg { width: 64px; height: 64px; flex-basis: 64px; font-size: 1.4rem; border-radius: var(--r); }
.person .p-name {
    font-weight: 600; font-size: .9rem; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.person .p-sub {
    font-size: .74rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.person .p-body { min-width: 0; flex: 1; }
.p-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.p-dot--active { background: var(--ok); }
.p-dot--pending { background: #d97706; }
.p-dot--off { background: var(--muted-2); }

/* --------------------------------------------------- Segmented control */
.ui-seg {
    display: inline-flex; background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--r-sm); padding: 2px; gap: 2px;
}
.ui-seg button, .ui-seg a {
    border: 0; background: transparent; color: var(--ink-2);
    font: inherit; font-size: .78rem; font-weight: 600;
    padding: 5px 12px; border-radius: 5px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
    transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.ui-seg button:hover, .ui-seg a:hover { color: var(--brand-800); }
.ui-seg button.active, .ui-seg a.active { background: #fff; color: var(--brand-800); box-shadow: var(--shadow-xs); }

/* ------------------------------------------------ SmartRemit operations */
.sr-analytics { margin-top: 2px; }
.sr-analytics__head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 10px; margin: 0 2px 13px; }
.sr-analytics__head h5 { margin: 0; color: var(--brand-800); font-weight: 700; font-size: 1rem; }
.sr-analytics__head p { margin: 3px 0 0; color: var(--muted); font-size: .75rem; }
.sr-analytics__scope { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 9px; border: 1px solid var(--brand-200); border-radius: var(--r-pill); background: var(--brand-050); color: var(--brand-800); font-size: .7rem; font-weight: 650; }
.sr-metric { display: flex; align-items: center; min-height: 82px; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-xs); }
.sr-metric__icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-050); color: var(--brand-800); font-size: 1.05rem; }
.sr-metric__icon--ok { background: var(--ok-bg); color: var(--ok); }
.sr-metric__icon--warn { background: var(--warn-bg); color: var(--warn); }
.sr-metric strong { display: block; color: var(--ink); font-size: 1.22rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sr-metric small { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.sr-insight { height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.sr-insight span, .sr-insight small { display: block; color: var(--muted); font-size: .7rem; }
.sr-insight span { font-weight: 650; }
.sr-insight strong { display: block; margin: 7px 0 5px; color: var(--brand-800); font-size: 1.34rem; font-variant-numeric: tabular-nums; }
.sr-chart { height: 194px; display: flex; align-items: end; gap: 5px; padding: 8px 2px 0; overflow-x: auto; border-bottom: 1px solid var(--line); }
.sr-chart__day { min-width: 34px; flex: 1 0 34px; height: 100%; display: flex; flex-direction: column; justify-content: end; gap: 6px; text-align: center; }
.sr-chart__day small { color: var(--muted); font-size: .58rem; white-space: nowrap; }
.sr-chart__bars { height: 158px; display: flex; align-items: end; justify-content: center; gap: 3px; }
.sr-chart__bar { width: 9px; min-height: 3px; border-radius: 3px 3px 0 0; transition: opacity var(--t) var(--ease); }
.sr-chart__bar:hover { opacity: .72; }
.sr-chart__bar--submitted, .sr-chart__dot--submitted { background: var(--brand); }
.sr-chart__bar--processed, .sr-chart__dot--processed { background: var(--ok); }
.sr-chart__legend { display: flex; gap: 12px; margin-top: 10px; color: var(--muted); font-size: .68rem; }
.sr-chart__legend span { display: inline-flex; align-items: center; gap: 5px; }
.sr-chart__dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
@media (max-width: 575.98px) { .sr-filter .btn { min-height: 42px; } .sr-chart { gap: 4px; } .sr-chart__day { min-width: 30px; flex-basis: 30px; } }

/* --------------------------------------------------------- Drawer sheet */
.ui-drawer { position: fixed; inset: 0; z-index: 1080; display: none; }
.ui-drawer.open { display: block; }
.ui-drawer .ud-backdrop { position: absolute; inset: 0; background: rgba(6,26,42,.42); opacity: 0; transition: opacity var(--t) var(--ease); }
.ui-drawer.open .ud-backdrop { opacity: 1; }
.ui-drawer .ud-panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
    background: var(--surface); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    transform: translateX(24px); opacity: 0;
    transition: transform var(--t-slow) var(--ease-out), opacity var(--t) var(--ease);
}
.ui-drawer.open .ud-panel { transform: none; opacity: 1; }
.ui-drawer .ud-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.ui-drawer .ud-title { font-weight: 600; font-size: .95rem; color: var(--ink); margin: 0; }
.ui-drawer .ud-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
@media (max-width: 575.98px) {
    .ui-drawer .ud-panel {
        top: auto; left: 0; width: 100%; max-height: 92vh;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
        transform: translateY(24px);
    }
    .ui-drawer.open .ud-panel { transform: none; }
}
body.ui-drawer-open { overflow: hidden; }

/* ------------------------------------------------------ People Directory */
.pd-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px;
}
.pd-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.pd-search .bi-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pd-search input { width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; }
.pd-search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pd-chip {
    border: 1px solid var(--line); background: #fff; color: var(--ink-2);
    font-size: .74rem; font-weight: 600; padding: 4px 12px; border-radius: 999px;
    cursor: pointer; transition: all var(--t) var(--ease); font-family: inherit;
}
.pd-chip:hover { border-color: var(--brand-200); color: var(--brand-800); }
.pd-chip.active { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.pd-chip .n { opacity: .75; font-weight: 500; margin-left: 4px; }
.pd-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 10px;
}
.pd-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 14px; display: block; color: inherit;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
a.pd-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-1px); color: inherit; }
.pd-card .pd-card-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px;
    min-width: 0;
}
.pd-card .pd-card-head .person { min-width: 0; align-items: flex-start; }
.pd-card .pd-status { justify-self: end; padding-top: 2px; white-space: nowrap; }
.pd-card .pd-status .small { display: inline-flex; align-items: center; white-space: nowrap; font-size: .72rem; }
.pd-card .p-name {
    white-space: normal; overflow: hidden; overflow-wrap: anywhere; text-overflow: clip;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    line-height: 1.25; max-height: 2.5em;
}
.pd-card .pd-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; min-height: 18px; }
.pd-badge {
    font-size: .62rem; font-weight: 600; letter-spacing: .03em;
    border-radius: 4px; padding: 2px 7px;
    background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line);
}
.pd-badge--info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.pd-badge--err { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.pd-empty { text-align: center; color: var(--muted); padding: 46px 16px; }
.pd-skel { border-radius: var(--r); border: 1px solid var(--line-2); height: 108px; position: relative; overflow: hidden; background: var(--surface); }
.pd-skel::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(227,233,240,.6), transparent);
    animation: pdShimmer 1.1s infinite;
}
@keyframes pdShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.pd-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 2px 0; }

/* --------------------------------------------------------- Org Chart v2 */
.oc2-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.oc2-stage {
    position: relative; overflow: auto; height: min(72vh, 760px);
    background:
        radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 0) 0 0/22px 22px,
        var(--surface);
    border: 1px solid var(--line); border-radius: var(--r);
}
/* Sizer establishes the real scrollable extent (= content size * zoom) so the
   browser's native scrollbars/trackpad/touch scrolling work at any zoom
   level; .oc2-plane is scaled visually inside it via transform. */
.oc2-sizer { position: relative; }
.oc2-plane { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.oc2-links { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.oc2-links path { fill: none; stroke: #b7c3d1; stroke-width: 1.5; stroke-linecap: square; }
.oc2-node {
    position: absolute; width: 280px; box-sizing: border-box;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: 8px 40px 8px 10px; box-shadow: var(--shadow-xs);
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.oc2-node[data-href] { cursor: pointer; }
.oc2-node[data-href]:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.oc2-node.oc2-me { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.oc2-node.oc2-hit { border-color: #d9a514; box-shadow: 0 0 0 3px rgba(252,238,17,.4); }
.oc2-node--group { background: var(--brand-800); border-color: var(--brand-800); }
.oc2-node--group .p-name { color: #fff; }
.oc2-node--group .p-sub { color: #bcd9ec; }
.oc2-node--group .p-av { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
/* Right-aligned inline chip (rows now stack vertically, indented per level,
   so the toggle no longer sits bottom-centre under a fan of children). */
.oc2-kids {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
    background: var(--brand); color: #fff; border: 2px solid #fff;
    font-size: .64rem; font-weight: 700; line-height: 18px; text-align: center;
    cursor: pointer; box-shadow: var(--shadow-xs);
}
.oc2-kids.closed { background: var(--muted); }
.oc2-btn {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
    color: var(--ink-2); cursor: pointer; font-size: .95rem;
    transition: all var(--t) var(--ease);
}
.oc2-btn:hover { border-color: var(--brand-200); color: var(--brand-800); }
.oc2-hint { font-size: .72rem; color: var(--muted); }
@media (max-width: 767.98px) { .oc2-stage { height: 62vh; } }

/* --------------------------------------------------------- Employee 360 */
.e360-head {
    position: sticky; top: 0; z-index: 20;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 14px 16px 0; margin-bottom: 14px; box-shadow: var(--shadow-xs);
}
.e360-id { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-bottom: 12px; }
.e360-tabs {
    display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
    border-top: 1px solid var(--line-2); margin: 0 -16px; padding: 0 10px;
}
.e360-tabs::-webkit-scrollbar { display: none; }
.e360-tabs a {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 13px; font-size: .82rem; font-weight: 600; color: var(--ink-2);
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.e360-tabs a:hover { color: var(--brand-800); }
.e360-tabs a.active { color: var(--brand-800); border-bottom-color: var(--brand); }
.e360-tabs a .badge { font-size: .6rem; }
.e360-pane { display: none; }
.e360-pane.active { display: block; }
.e360-stat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 12px 14px; height: 100%;
}
.e360-stat .v { font-size: 1.25rem; font-weight: 600; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.e360-stat .k { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ================================================= Compact page contexts
   Legacy screens had large navy page banners above the shared top-bar title.
   Leave the useful status, helper text and actions in place, but make the
   wrapper a quiet inline context instead of a second title card. */
body .bfx-hero,
body .lct-hero,
body .mm-hero,
body .hr-hero,
body .wa-hero,
body .st-hero,
body .sf-hero,
body .af-hero,
body .um-hero,
body .fm-hero,
body .al-hero {
    min-height:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    color:var(--ink) !important;
}
body .bfx-hero::before,
body .bfx-hero::after,
body .lct-hero::before,
body .lct-hero::after,
body .mm-hero::before,
body .mm-hero::after,
body .hr-hero::before,
body .hr-hero::after,
body .wa-hero::before,
body .wa-hero::after,
body .st-hero::before,
body .st-hero::after,
body .sf-hero::before,
body .sf-hero::after,
body .af-hero::before,
body .af-hero::after,
body .um-hero::before,
body .um-hero::after,
body .fm-hero::before,
body .fm-hero::after,
body .al-hero::before,
body .al-hero::after { display:none !important; }
body .bfx-hero h1, body .bfx-hero h2, body .bfx-hero h3, body .bfx-hero h4,
body .lct-hero h1, body .lct-hero h2, body .lct-hero h3, body .lct-hero h4,
body .mm-hero h1, body .mm-hero h2, body .mm-hero h3, body .mm-hero h4,
body .hr-hero h1, body .hr-hero h2, body .hr-hero h3, body .hr-hero h4,
body .wa-hero h1, body .wa-hero h2, body .wa-hero h3, body .wa-hero h4,
body .st-hero h1, body .st-hero h2, body .st-hero h3, body .st-hero h4,
body .sf-hero h1, body .sf-hero h2, body .sf-hero h3, body .sf-hero h4,
body .af-hero h1, body .af-hero h2, body .af-hero h3, body .af-hero h4,
body .um-hero h1, body .um-hero h2, body .um-hero h3, body .um-hero h4,
body .fm-hero h1, body .fm-hero h2, body .fm-hero h3, body .fm-hero h4,
body .al-hero h1, body .al-hero h2, body .al-hero h3, body .al-hero h4 {
    margin:0 !important;
    color:var(--ink) !important;
    font-size:1rem !important;
    font-weight:600 !important;
}
body .bfx-hero p, body .lct-hero p, body .mm-hero p, body .hr-hero p,
body .wa-hero p, body .st-hero p, body .sf-hero p, body .af-hero p,
body .um-hero p, body .fm-hero p, body .al-hero p {
    margin:3px 0 0 !important;
    color:var(--muted) !important;
    font-size:.79rem !important;
    line-height:1.4 !important;
}
body .bfx-hero .bfx-scope,
body .lct-hero .lct-scope,
body .wa-hero .conn {
    border:1px solid var(--brand-100) !important;
    border-radius:99px !important;
    background:var(--brand-050) !important;
    color:var(--brand-800) !important;
}
body .bfx-hero .btn-outline-light,
body .lct-hero .btn-outline-light,
body .hr-hero .btn-outline-light,
body .wa-hero .btn-outline-light,
body .st-hero .btn-outline-light,
body .sf-hero .btn-outline-light,
body .af-hero .btn-outline-light,
body .um-hero .btn-outline-light,
body .fm-hero .btn-outline-light,
body .al-hero .btn-outline-light {
    border-color:var(--brand-200) !important;
    color:var(--brand-800) !important;
}
body .bou-hero { padding:0 !important; border:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; }
body .bou-hero::before { display:none !important; }
body .bou-hero h4 { margin:0 !important; font-size:1rem !important; }
body .bou-hero p { margin:3px 0 0 !important; font-size:.79rem !important; }
/* Leave V2 keeps its detailed request context, but it follows the same quiet
   card language as the rest of the portal instead of reintroducing navy/yellow
   page banners or dashboard dashes. */
body .lv2-stat::before { display:none !important; }
body .lv2-detail-hero {
    color:var(--ink) !important;
    background:var(--surface) !important;
    border:1px solid var(--line) !important;
    border-bottom:1px solid var(--line) !important;
    box-shadow:var(--shadow-xs) !important;
}
body .lv2-detail-hero h1 { color:var(--ink) !important; }
body .lv2-detail-hero p { color:var(--muted) !important; }
body .lv2-detail-hero__number { color:var(--brand-700) !important; }
body .lv2-detail-hero .btn-light {
    border-color:var(--brand-200) !important;
    color:var(--brand-800) !important;
    background:var(--surface) !important;
}

/* Payments-style page titles. These are text contexts, not title cards: the
   category, title and helper copy use the same hierarchy as SmartRemit KYC. */
.page-intro {
    max-width:42rem;
    margin:0 0 24px;
}
.page-intro__eyebrow {
    margin:0;
    color:var(--virah-blue);
    font-family:var(--font-heading);
    font-size:.75rem;
    font-weight:700;
    letter-spacing:.14em;
    line-height:1.2;
    text-transform:uppercase;
}
.page-intro h2 {
    margin:8px 0 0;
    color:var(--ink);
    font-family:var(--font-heading);
    font-size:clamp(1.5rem, 2vw, 1.875rem);
    font-weight:600;
    letter-spacing:-.025em;
    line-height:1.2;
}
.page-intro__copy {
    max-width:42rem;
    margin:8px 0 0;
    color:var(--muted);
    font-size:.875rem;
    line-height:1.7;
}
.page-intro__meta { margin-top:10px; }
.page-intro__meta .badge { font-size:.72rem; font-weight:600; }

body .bfx-hero,
body .lct-hero,
body .mm-hero,
body .hr-hero,
body .wa-hero,
body .st-hero,
body .sf-hero,
body .af-hero,
body .um-hero,
body .fm-hero,
body .al-hero {
    align-items:flex-start !important;
    gap:16px !important;
    margin-bottom:24px !important;
}
body .bou-hero { margin-bottom:24px !important; }
body .bfx-hero::before,
body .lct-hero::before,
body .mm-hero::before,
body .hr-hero::before,
body .wa-hero::before,
body .st-hero::before,
body .sf-hero::before,
body .af-hero::before,
body .um-hero::before,
body .fm-hero::before,
body .al-hero::before,
body .bou-hero::before {
    position:static !important;
    display:block !important;
    width:auto !important;
    height:auto !important;
    min-height:0 !important;
    flex:0 0 100%;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    color:var(--virah-blue) !important;
    font-family:var(--font-heading);
    font-size:.75rem;
    font-weight:700;
    letter-spacing:.14em;
    line-height:1.2;
    text-transform:uppercase;
}
body .bfx-hero::before { content:"Finance"; }
body .lct-hero::before { content:"Compliance"; }
body .mm-hero::before { content:"Finance"; }
body .hr-hero::before { content:"Workplace"; }
body[data-app-page="virah_hr"] .hr-hero::before { content:"Human resources"; }
body[data-app-page="it_tickets"] .hr-hero::before { content:"IT support"; }
body[data-app-page="remit_desk"] .hr-hero::before { content:"SmartRemit"; }
body .wa-hero::before { content:"Customer service"; }
body .st-hero::before { content:"Your portal"; }
body .sf-hero::before,
body .af-hero::before { content:"Security"; }
body .um-hero::before,
body .fm-hero::before,
body .al-hero::before { content:"Administration"; }
body .bou-hero::before { content:"Compliance reporting"; }

body .bfx-hero :is(h1,h2,h3,h4),
body .lct-hero :is(h1,h2,h3,h4),
body .mm-hero :is(h1,h2,h3,h4),
body .hr-hero :is(h1,h2,h3,h4),
body .wa-hero :is(h1,h2,h3,h4),
body .st-hero :is(h1,h2,h3,h4),
body .sf-hero :is(h1,h2,h3,h4),
body .af-hero :is(h1,h2,h3,h4),
body .um-hero :is(h1,h2,h3,h4),
body .fm-hero :is(h1,h2,h3,h4),
body .al-hero :is(h1,h2,h3,h4),
body .bou-hero h4 {
    margin:8px 0 0 !important;
    color:var(--ink) !important;
    font-family:var(--font-heading) !important;
    font-size:clamp(1.5rem, 2vw, 1.875rem) !important;
    font-weight:600 !important;
    letter-spacing:-.025em !important;
    line-height:1.2 !important;
}
body .bfx-hero :is(h1,h2,h3,h4) > i:first-child,
body .lct-hero :is(h1,h2,h3,h4) > i:first-child,
body .mm-hero :is(h1,h2,h3,h4) > i:first-child,
body .hr-hero :is(h1,h2,h3,h4) > i:first-child,
body .wa-hero :is(h1,h2,h3,h4) > i:first-child,
body .st-hero :is(h1,h2,h3,h4) > i:first-child,
body .sf-hero :is(h1,h2,h3,h4) > i:first-child,
body .af-hero :is(h1,h2,h3,h4) > i:first-child,
body .um-hero :is(h1,h2,h3,h4) > i:first-child,
body .fm-hero :is(h1,h2,h3,h4) > i:first-child,
body .al-hero :is(h1,h2,h3,h4) > i:first-child,
body .bou-hero h4 > i:first-child,
body .lct-hero-icon,
body .bou-hero-icon { display:none !important; }
body .bfx-hero p,
body .lct-hero p,
body .mm-hero p,
body .hr-hero p,
body .wa-hero p,
body .st-hero p,
body .sf-hero p,
body .af-hero p,
body .um-hero p,
body .fm-hero p,
body .al-hero p,
body .bou-hero p {
    max-width:42rem;
    margin:8px 0 0 !important;
    color:var(--muted) !important;
    font-size:.875rem !important;
    line-height:1.7 !important;
}

body .lv2-detail-hero {
    grid-template-columns:minmax(0,1fr) auto;
    gap:16px;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
}
body .lv2-detail-hero::before {
    content:"Leave management";
    grid-column:1 / -1;
    color:var(--virah-blue);
    font-family:var(--font-heading);
    font-size:.75rem;
    font-weight:700;
    letter-spacing:.14em;
    line-height:1.2;
    text-transform:uppercase;
}
body .lv2-detail-hero__number { display:none; }
body .lv2-detail-hero h1 {
    margin:8px 0 0 !important;
    color:var(--ink) !important;
    font-family:var(--font-heading);
    font-size:clamp(1.5rem, 2vw, 1.875rem) !important;
    font-weight:600 !important;
    letter-spacing:-.025em;
    line-height:1.2;
}
body .lv2-detail-hero p {
    max-width:42rem;
    margin:8px 0 0 !important;
    color:var(--muted) !important;
    font-size:.875rem !important;
    line-height:1.7 !important;
}

/* The Leave workspace root is a route heading. Keep nested Leave toolbars
   compact; only this direct shell child receives the page-title scale. */
body .lv2-shell > .lv2-toolbar {
    align-items:flex-end;
    gap:16px;
    min-height:0;
}
body .lv2-shell > .lv2-toolbar .lv2-eyebrow {
    margin:0;
    color:var(--virah-blue);
    font-family:var(--font-heading);
    font-size:.75rem;
    font-weight:700;
    letter-spacing:.14em;
    line-height:1.2;
    text-transform:uppercase;
}
body .lv2-shell > .lv2-toolbar .lv2-title {
    margin:8px 0 0;
    color:var(--ink);
    font-family:var(--font-heading);
    font-size:clamp(1.5rem, 2vw, 1.875rem);
    font-weight:600;
    letter-spacing:-.025em;
    line-height:1.2;
}
body .lv2-shell > .lv2-toolbar .lv2-subtitle {
    max-width:42rem;
    margin:8px 0 0;
    color:var(--muted);
    font-size:.875rem;
    line-height:1.7;
}

@media (max-width:991.98px) {
    body .bfx-hero, body .lct-hero, body .mm-hero, body .hr-hero, body .wa-hero,
    body .st-hero, body .sf-hero, body .af-hero, body .um-hero, body .fm-hero, body .al-hero,
    body .bou-hero { margin-bottom:12px !important; }
}

@media (max-width:575.98px) {
    .page-intro { margin-bottom:18px; }
    .page-intro h2 { font-size:1.5rem; }
    .page-intro__copy,
    body .bfx-hero p, body .lct-hero p, body .mm-hero p, body .hr-hero p,
    body .wa-hero p, body .st-hero p, body .sf-hero p, body .af-hero p,
    body .um-hero p, body .fm-hero p, body .al-hero p, body .bou-hero p,
    body .lv2-detail-hero p { line-height:1.6 !important; }
    body .bfx-hero, body .lct-hero, body .mm-hero, body .hr-hero, body .wa-hero,
    body .st-hero, body .sf-hero, body .af-hero, body .um-hero, body .fm-hero,
    body .al-hero, body .bou-hero { margin-bottom:18px !important; }
    body .lv2-shell > .lv2-toolbar { align-items:flex-start; }
    body .lv2-shell > .lv2-toolbar .lv2-subtitle { line-height:1.6; }
    body .lv2-detail-hero { grid-template-columns:1fr; }
    body .lv2-detail-actions { justify-content:flex-start; }
}

/* -------------------------------------------------------- Session warning */
.portal-session-dialog {
    width:min(480px, calc(100vw - 32px));
    max-width:none;
    margin:auto;
    padding:0;
    overflow:visible;
    border:0;
    background:transparent;
    color:var(--ink);
}
.portal-session-dialog::backdrop {
    background:rgba(6, 34, 50, .48);
    -webkit-backdrop-filter:blur(5px) saturate(.9);
    backdrop-filter:blur(5px) saturate(.9);
}
.portal-session-dialog__surface {
    display:grid;
    grid-template-columns:52px minmax(0, 1fr);
    gap:0 16px;
    padding:24px;
    border:1px solid rgba(6, 50, 74, .14);
    border-radius:24px;
    background:rgba(255, 255, 255, .98);
    box-shadow:0 28px 80px rgba(6, 34, 50, .28);
    animation:portal-session-enter 180ms var(--ease-out) both;
}
.portal-session-dialog__icon {
    display:grid;
    place-items:center;
    width:52px;
    height:52px;
    border:1px solid var(--brand-200);
    border-radius:16px;
    background:var(--brand-050);
    color:var(--brand-800);
}
.portal-session-dialog__icon .portal-icon { width:24px; height:24px; }
.portal-session-dialog__heading { min-width:0; }
.portal-session-dialog__eyebrow {
    margin:1px 0 5px;
    color:var(--brand-700);
    font-size:.72rem;
    font-weight:700;
    letter-spacing:.1em;
    line-height:1.2;
    text-transform:uppercase;
}
.portal-session-dialog__heading h2 {
    margin:0;
    color:var(--ledger-navy);
    font-family:var(--font-heading);
    font-size:clamp(1.35rem, 4vw, 1.65rem);
    font-weight:600;
    letter-spacing:-.025em;
    line-height:1.25;
}
.portal-session-dialog__heading p:last-child {
    margin:8px 0 0;
    color:var(--muted);
    font-size:.9rem;
    line-height:1.65;
}
.portal-session-dialog__countdown {
    grid-column:1 / -1;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-top:20px;
    padding:14px 16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:var(--surface-2);
}
.portal-session-dialog__countdown span {
    color:var(--ink-2);
    font-size:.82rem;
    font-weight:600;
}
.portal-session-dialog__countdown strong {
    color:var(--ledger-navy);
    font-family:var(--font-mono);
    font-size:1.25rem;
    font-variant-numeric:tabular-nums;
    letter-spacing:.02em;
    line-height:1;
}
.portal-session-dialog__policy {
    grid-column:1 / -1;
    margin:14px 2px 0;
    color:var(--muted);
    font-size:.78rem;
    line-height:1.55;
}
.portal-session-dialog__status {
    grid-column:1 / -1;
    min-height:1.4em;
    margin:8px 2px 0;
    color:transparent;
    font-size:.78rem;
    font-weight:600;
    line-height:1.4;
}
.portal-session-dialog__status.is-error { color:var(--danger); }
.portal-session-dialog__actions {
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:10px;
    margin-top:8px;
}
.portal-session-dialog__primary,
.portal-session-dialog__signout {
    min-height:48px;
    border-radius:12px;
    font:600 .84rem/1.2 var(--font);
    touch-action:manipulation;
    transition:transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease),
               background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.portal-session-dialog__primary {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    padding:0 18px;
}
.portal-session-dialog__primary[aria-busy="true"]::after {
    content:"";
    width:15px;
    height:15px;
    border:2px solid rgba(255,255,255,.45);
    border-top-color:#fff;
    border-radius:50%;
    animation:portal-session-spin .7s linear infinite;
}
.portal-session-dialog__signout {
    padding:0 16px;
    border:1px solid var(--line);
    background:#fff;
    color:var(--ink-2);
}
.portal-session-dialog__signout:hover { background:var(--paper); border-color:var(--border); }
.portal-session-dialog__primary:active,
.portal-session-dialog__signout:active { transform:scale(.98); }
.portal-session-dialog :is(button, a):focus-visible {
    outline:3px solid rgba(0,120,176,.28);
    outline-offset:3px;
}
@keyframes portal-session-enter {
    from { opacity:0; transform:translateY(10px) scale(.985); }
    to { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes portal-session-spin { to { transform:rotate(360deg); } }

@media (max-width:575.98px) {
    .portal-session-dialog {
        position:fixed;
        inset:auto 12px calc(12px + env(safe-area-inset-bottom));
        width:auto;
        margin:0;
    }
    .portal-session-dialog__surface {
        grid-template-columns:44px minmax(0, 1fr);
        gap:0 12px;
        padding:20px;
        border-radius:22px;
    }
    .portal-session-dialog__icon { width:44px; height:44px; border-radius:13px; }
    .portal-session-dialog__icon .portal-icon { width:22px; height:22px; }
    .portal-session-dialog__countdown { margin-top:18px; }
    .portal-session-dialog__actions { grid-template-columns:1fr; }
    .portal-session-dialog__signout { width:100%; }
}

@media (prefers-reduced-motion:reduce) {
    .portal-session-dialog__surface,
    .portal-session-dialog__primary,
    .portal-session-dialog__signout { animation:none; transition:none; }
}

/* Keep the light shell usable when Windows High Contrast is enabled. This is
   an accessibility fallback, not a second portal colour scheme. */
@media (forced-colors: active) {
    body.payments-portal,
    body.payments-portal .app-topbar,
    body.payments-portal .mobile-bottom-nav,
    body.payments-portal .app-sidebar,
    body.payments-portal :is(.card, .modal-content, .dropdown-menu) {
        background-image: none !important;
        box-shadow: none !important;
    }
    body.payments-portal :focus-visible { outline: 3px solid Highlight !important; }
    body.payments-portal :is(.sb-link.active, .mobile-bottom-nav__item.is-active) {
        border: 2px solid Highlight !important;
        background: Canvas !important;
        color: CanvasText !important;
    }
    body.payments-portal :is(button, .btn, input, select, textarea, .form-control, .form-select) {
        border: 1px solid ButtonText !important;
    }
    .portal-session-dialog::backdrop { background:Canvas; }
    .portal-session-dialog__surface { border:2px solid CanvasText; box-shadow:none; }
}

@media print {
    html { color-scheme: light !important; }
    body.payments-portal { color: #10212b !important; background: #fff !important; background-image: none !important; }
    body.payments-portal :is(.card, .table-responsive, .modal-content) { color: #10212b !important; background: #fff !important; box-shadow: none !important; }
}
