/*! HRX core styles — generated by scripts/hrx/build.mjs. Edit the sources in resources/hrx, then run: npm run hrx:build */
/* ---- 01-tokens.css ---- */
/* ==========================================================================
   HRX Classic — interface design layer (loaded last on every screen)
   --------------------------------------------------------------------------
   Direction: classic enterprise (Odoo / SAP Fiori / Zoho structure) with a
   modern finish. White canvas, black ink, neutral greys — no gold.

   Palette: UAE federal design system core colours
     AEBlack  50 #F7F7F7  100 #E1E3E5  200 #C3C6CB  300 #9EA2A9  500 #5F646D
              600 #4B4F58 700 #3E4046  800 #232528  900 #1B1D21  950 #0E0F12
     AEGold   50 #F9F7ED  100 #F2ECCF  300 #D7BC6D  500 #1B1D21  600 #92722A
              700 #7C5E24
   Type: Tajawal (UI) + Tajawal (headings) in Arabic;
         IBM Plex Sans in English. Tabular figures for all numbers.
   Arabic is the default language (dir="rtl"); English is dir="ltr".
   ========================================================================== */

:root {
    --ae-black-50: #F7F7F7;  --ae-black-100: #E1E3E5; --ae-black-200: #C3C6CB;
    --ae-black-300: #9EA2A9; --ae-black-400: #797E86; --ae-black-500: #5F646D;
    --ae-black-600: #4B4F58; --ae-black-700: #3E4046; --ae-black-800: #232528;
    --ae-black-900: #1B1D21; --ae-black-950: #0E0F12;
    /* Accent scale is neutral by design: black is the only accent colour. */
    /* Accent scale = brand blue (same blues as the public site, see
       docs/ui/PUBLIC-DESIGN-SYSTEM.md). Kept under the old "gold" names so
       every existing rule picks it up. */
    --ae-gold-50: #EEF3FF;   --ae-gold-100: #DCE6FF;  --ae-gold-200: #B9CCFF;
    --ae-gold-300: #7FA2FF;  --ae-gold-500: #1544F5;  --ae-gold-600: #1544F5;
    --ae-gold-700: #0A2FC2;

    --brand-blue: #1544F5;
    --brand-blue-dark: #0A2FC2;
    --brand-blue-tint: #EEF3FF;
    --brand-gradient: linear-gradient(90deg, #1541F2 0%, #0B5CFF 55%, #2A7BFF 100%);
    --brand-navy: #0B1D5C;
    --brand-navy-2: #0E2A86;

    --hrx-bg: #FFFFFF;
    --hrx-surface: #FFFFFF;
    --hrx-subtle: #F5F7FC;
    --hrx-subtle-2: #F9FAFD;
    --hrx-line: #DCE1EB;
    --hrx-line-soft: #E9EDF4;
    --hrx-line-strong: #BCC3D1;
    --hrx-ink: #1B1D21;
    --hrx-ink-2: #3E4046;
    --hrx-ink-3: #5F646D;
    --hrx-ink-4: #797E86;
    --hrx-accent: #1544F5;
    --hrx-accent-dark: #0A2FC2;
    --hrx-link: #1544F5;
    --hrx-focus: 0 0 0 3px rgba(21, 68, 245, .18);

    --hrx-success: #2F663C; --hrx-success-bg: #F3F8F4; --hrx-success-line: #CFE3D2;
    --hrx-danger: #B42318;  --hrx-danger-bg: #FDF4F3;  --hrx-danger-line: #F3CDC8;
    --hrx-warning: #9A4A05; --hrx-warning-bg: #FDF9F0; --hrx-warning-line: #F0DDB2;
    --hrx-info: #1F4E8C;    --hrx-info-bg: #F4F7FB;    --hrx-info-line: #D3DEEC;

    --hrx-radius-sm: 4px;
    --hrx-radius: 6px;
    --hrx-radius-lg: 8px;
    --hrx-shadow-pop: 0 10px 28px rgba(14, 15, 18, .12), 0 2px 6px rgba(14, 15, 18, .06);

    --hrx-font: 'Tajawal', 'IBM Plex Sans', Tahoma, 'Segoe UI', sans-serif;
    --hrx-font-head: 'Tajawal', 'IBM Plex Sans', sans-serif;

    /* Legacy tokens used throughout the views — re-pointed to the new palette. */
    --primary: #1544F5;
    --primary-hover: #0A2FC2;
    --primary-light: #EEF3FF;
    --primary-50: #EEF3FF;
    --primary-100: #DCE6FF;
    --primary-200: #B9CCFF;
    --primary-300: #7FA2FF;
    --primary-600: #1544F5;
    --primary-dark: #0A2FC2;
    --secondary: #5F646D;
    --gold: #1544F5;
    --gold-soft: #0A2FC2;
    --gold-deep: #1544F5;
    --champagne: #DCE1EB;
    --champagne-light: #F5F7FC;
    --ink: #1B1D21;
    --camel: #4B4F58;
    --camel-soft: #DCE1EB;
    --taupe-line: #DCE1EB;
    --canvas: #FFFFFF;
    --ivory-tint: #F9FAFD;
    --surface-gold: #FFFFFF;
    --gray-25: #FFFFFF;  --gray-50: #F5F7FC;  --gray-100: #ECF0F8; --gray-200: #DCE1EB;
    --gray-300: #BCC3D1; --gray-400: #9EA2A9; --gray-500: #5F646D; --gray-600: #4B4F58;
    --gray-700: #3E4046; --gray-800: #232528; --gray-900: #1B1D21;
    --success: #2F663C; --success-light: #EAF3EC;
    --warning: #B54708; --warning-light: #FBF3E4;
    --danger: #B42318;  --danger-light: #FBEBE9;
    --info: #1F4E8C;
}

html[lang="en"] {
    --hrx-font: 'IBM Plex Sans', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --hrx-font-head: 'IBM Plex Sans', 'Tajawal', sans-serif;
}


/* --------------------------------------------------------------------------
   Shared app tokens (docs/ui/PUBLIC-DESIGN-SYSTEM.md §3C). 4px/8px spacing scale,
   radii, elevation, shell sizes, content padding, status and chart colours.
   -------------------------------------------------------------------------- */
:root {
    --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;

    --text-xs: 12px; --text-sm: 13px; --text-md: 14px; --text-lg: 16px; --text-xl: 20px; --text-2xl: 24px;
    --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700;

    --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-pill: 999px;
    --elev-0: none;
    --elev-1: 0 1px 1px rgba(30, 31, 33, .08), 0 0 1px rgba(30, 31, 33, .2);
    --elev-2: 0 8px 12px rgba(30, 31, 33, .15), 0 0 1px rgba(30, 31, 33, .31);

    /* Neutrals carry a faint cast of the brand blue, so fills and hairlines
       read as part of the palette on the white canvas. Text stays neutral. */
    --surface: #FFFFFF;
    --surface-sunken: #F5F7FC;
    --surface-hovered: #ECF0F8;
    --border: #DCE1EB;
    --border-strong: #B3BBCB;
    --text: #292A2E;
    --text-subtle: #505258;
    --text-subtlest: #6B6E76;

    --status-success: #216E4E; --status-success-bg: #DCFFF1;
    --status-warning: #974F0C; --status-warning-bg: #FFF7D6;
    --status-danger: #AE2E24;  --status-danger-bg: #FFECEB;
    --status-info: #1544F5;    --status-info-bg: #E9F2FF;
    --status-neutral: #505258; --status-neutral-bg: #EEF1F7;

    /* Categorical chart colours — one meaning per colour across every chart. */
    --chart-1: #1544F5;  /* primary series: headcount, net pay, present, passport */
    --chart-2: #0894AC;  /* emirates ID */
    --chart-3: #7C3AED;  /* visa */
    --chart-4: #C2700F;  /* late / half day, labour */
    --chart-5: #8C8F97;  /* away (absent, leave, excused), other */
    --chart-grid: #E9EDF4;

    --content-pad: 24px;
}
@media (max-width: 1024px) { :root { --content-pad: 20px; } }
@media (max-width: 640px)  { :root { --content-pad: 16px; } }

/* ---- 02-base.css ---- */
/* --------------------------------------------------------------------------
   Base & typography
   -------------------------------------------------------------------------- */
html, body { background: var(--hrx-bg) !important; }
body {
    color: var(--hrx-ink);
    font-family: var(--hrx-font);
    font-feature-settings: "tnum" 1, "lnum" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
html body *:not(.bi):not([class^="bi-"]):not([class*=" bi-"]):not(code):not(pre):not(kbd) {
    font-family: var(--hrx-font) !important;
}
html body h1:not(.bi):not([class^="bi-"]):not([class*=" bi-"]):not(code):not(pre):not(kbd),
html body h2:not(.bi):not([class^="bi-"]):not([class*=" bi-"]):not(code):not(pre):not(kbd),
html body .page-title:not(.bi):not([class^="bi-"]):not([class*=" bi-"]):not(code):not(pre):not(kbd),
html body .sidebar-brand-name:not(.bi):not([class^="bi-"]):not([class*=" bi-"]):not(code):not(pre):not(kbd) {
    font-family: var(--hrx-font-head) !important;
}
html[lang="ar"] body { line-height: 1.65; }
/* Kufi headings need more room above and below than Latin ones. */
html[lang="ar"] h1, html[lang="ar"] h2 { line-height: 1.5 !important; }
html[lang="ar"] body * { letter-spacing: 0 !important; }
html[lang="ar"] .nav-section-title,
html[lang="ar"] th,
html[lang="ar"] .text-uppercase,
html[lang="ar"] [class*="eyebrow"],
html[lang="ar"] [class*="-label"] { text-transform: none !important; }

h1, h2, h3, h4, h5, h6 { color: var(--hrx-ink); }
a { color: var(--hrx-link); }
a:hover { color: #000; }
::selection { background: #D9DBDE; color: var(--hrx-ink); }
:focus-visible { outline: 2px solid var(--hrx-accent); outline-offset: 2px; }

table, .amount-cell, .num, .stat-value, [class*="amount"], [class*="-value"], input[type="number"] {
    font-variant-numeric: tabular-nums lining-nums;
}

/* Thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--hrx-line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--hrx-line-strong); border-radius: 10px; border: 3px solid #fff; }
::-webkit-scrollbar-track { background: transparent; }

/* Bilingual "echo" labels (an Arabic line repeated under English text) are
   replaced by the real interface language, so they are hidden in both modes. */
span.ar, em.ar, strong.ar, small.ar, p.ar, div.ar, b.ar,
span.arabic, p.arabic, em.arabic,
span[lang="ar"], small[lang="ar"], strong[lang="ar"], em[lang="ar"], b[lang="ar"],
.nav-ar, .label-ar, .sg-ar, .emi-ar-line, .page-title-ar, .section-title-ar,
.rating-label-ar, .portal-nav-label-ar, .portal-nav-section-title-ar,
.schedule-notice-ar, .upload-title-ar, .title-arabic, .arabic-title, .hero-title-ar,
.col-ar, .gcc-ar, .footer-arabic, .ar-title, .topnav-mega-ar, .pulse-label-ar,
.confirm-modal-title-ar, .confirm-modal-message-ar, .lt-label-ar, .day-arabic,
.portal-hcrumb .ar, .portal-hbrand-sub .ar {
    display: none !important;
}

/* ---- 03-shell.css ---- */
/* --------------------------------------------------------------------------
   Application shell — navigation (Jira-style, docs/ui/PUBLIC-DESIGN-SYSTEM.md §3A)
   · Full-width top bar (56px): sidebar toggle + brand | search + Create | tools
   · One light sidebar (248px) under it: Home, Recent, Starred, then an
     expandable menu per module. Hidden from the top-bar toggle on desktop;
     an off-canvas drawer below 1025px.
   Neutral palette follows Atlassian's new navigation; accents use our blue.
   -------------------------------------------------------------------------- */
:root {
    --topbar-height: 56px;
    --sidebar-width: 248px;
    --nav-text: #292A2E;
    --nav-text-subtle: #505258;
    --nav-icon: #505258;
    --nav-border: #DCE1EB;
    --nav-hover: #ECF0F8;
    --nav-pressed: #DCE1EB;
    --nav-selected-bg: #E9F2FF;
    --nav-selected: var(--brand-blue);
    /* Where page-level sticky bars and side panels pin: below the top bar,
       the module bar and the breadcrumb bar (set below when they are shown). */
    --sticky-top: var(--topbar-height);
}
body:has(.hrx-modulebar) { --sticky-top: calc(var(--topbar-height) + 48px); }
body:has(.hrx-modulebar ~ .hrx-controlbar):not(:has(.split-wrap)) { --sticky-top: calc(var(--topbar-height) + 48px + 42px); }
@media (max-width: 768px) {
    body:has(.hrx-modulebar) { --sticky-top: calc(var(--topbar-height) + 44px); }
    body:has(.hrx-modulebar ~ .hrx-controlbar):not(:has(.split-wrap)) { --sticky-top: calc(var(--topbar-height) + 44px + 42px); }
}

.main-wrapper, .main-content, .portal-content, .portal-main, .admin-content {
    background: var(--hrx-bg) !important;
}

/* ---- Sidebar ---- */
.sidebar {
    top: var(--topbar-height) !important; bottom: 0; height: auto !important;
    inset-inline-start: 0 !important; left: 0;
    width: var(--sidebar-width) !important;
    background: #FFFFFF !important;
    border-inline-end: 1px solid var(--nav-border) !important;
    box-shadow: none !important;
    color: var(--nav-text);
    z-index: 105 !important;
}
.sidebar::before { display: none !important; }
.sidebar .sidebar-nav { order: 1; padding: 12px 12px 16px !important; }
.sidebar .getting-started { order: 2; }

.sidebar .nav-section { border-top: 0 !important; margin: 0 !important; padding: 0 !important; }
.sidebar .nav-section.nav-top { padding-bottom: 8px !important; margin-bottom: 8px !important; border-bottom: 1px solid var(--nav-border) !important; }
.sidebar .nav-section + .nav-section:not(.nav-top) { margin-top: 2px !important; }

/* Menu item (link, flyout button, module title, group toggle) */
.sidebar .nav-link, .sidebar .nav-section-title {
    position: relative; display: flex !important; align-items: center; gap: 8px; width: 100%;
    min-height: 32px; padding: 4px 8px !important; margin: 0 !important;
    border: 0; border-radius: 6px !important; background: transparent;
    color: var(--nav-text) !important; font: inherit; font-size: 14px !important; font-weight: 400 !important;
    line-height: 20px; text-align: start; text-decoration: none !important; cursor: pointer;
    box-shadow: none !important;
}
.sidebar .nav-link i, .sidebar .nav-section-title i { color: var(--nav-icon) !important; font-size: 16px; flex: none; }
.sidebar .nav-link:hover, .sidebar .nav-section-title:hover { background: var(--nav-hover) !important; color: var(--nav-text) !important; }
.sidebar .nav-link:active, .sidebar .nav-section-title:active { background: var(--nav-pressed) !important; }
.sidebar .nav-link:focus-visible, .sidebar .nav-section-title:focus-visible,
.sidebar .nav-act:focus-visible, .sidebar .nav-star:focus-visible { outline: 2px solid var(--nav-selected); outline-offset: -2px; }
.sidebar .nav-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Selected page: blue tint, blue text and icon, bar on the sidebar edge */
.sidebar .nav-link.active {
    background: var(--nav-selected-bg) !important; color: var(--nav-selected) !important; font-weight: 500 !important;
}
.sidebar .nav-link.active i { color: var(--nav-selected) !important; }
.sidebar .nav-link.active::before {
    content: "" !important; display: block !important; position: absolute;
    inset-inline-start: -12px !important; left: auto; right: auto; top: 4px; bottom: 4px; width: 3px !important;
    background: var(--nav-selected) !important; border-radius: 0 3px 3px 0 !important;
}
[dir="rtl"] .sidebar .nav-link.active::before { border-radius: 3px 0 0 3px !important; }
.sidebar .nav-link::after { content: none !important; display: none !important; }

.sidebar .nav-count, .sidebar .nav-link .badge {
    margin-inline-start: auto !important; background: #E9EAEC !important; color: var(--nav-text-subtle) !important;
    border-radius: 999px !important; font-size: 12px !important; font-weight: 600; padding: 0 7px; line-height: 18px;
}
.sidebar .nav-count.is-alert { background: #FEF3C7 !important; color: #B45309 !important; }
.sidebar .nav-link.active .nav-count { background: var(--nav-selected) !important; color: #FFFFFF !important; }

/* Flyout menu button (Recent, Starred): chevron on the end */
.sidebar .nav-flyout-chev { margin-inline-start: auto; font-size: 12px !important; }
[dir="rtl"] .sidebar .nav-flyout-chev { transform: scaleX(-1); }
.sidebar .nav-flyout-btn[aria-expanded="true"] { background: var(--nav-hover) !important; }

/* Expandable module menu: chevron · icon · label, actions on hover */
.sidebar .nav-section-head { position: relative; display: flex; align-items: center; }
.sidebar .nav-section-title { font-weight: 500 !important; padding-inline-end: 36px !important; text-transform: none !important; letter-spacing: 0 !important; }
.sidebar .nav-section-title::before, .sidebar .nav-section-title::after { content: none !important; display: none !important; }
.sidebar .nav-section-title .nav-chevron {
    display: inline-block !important; font-size: 12px !important; width: 16px; text-align: center;
    transition: transform .15s ease;
}
.sidebar .nav-section.collapsed > .nav-section-head .nav-chevron { transform: none !important; }
.sidebar .nav-section:not(.collapsed) > .nav-section-head .nav-chevron { transform: rotate(90deg) !important; }
[dir="rtl"] .sidebar .nav-section.collapsed > .nav-section-head .nav-chevron { transform: scaleX(-1) !important; }
.sidebar .nav-section-links { padding-inline-start: 12px; max-height: none !important; opacity: 1 !important; overflow: visible !important; visibility: visible !important; }
.sidebar .nav-section.collapsed > .nav-section-links { display: none !important; }
.sidebar .nav-section.nav-top > .nav-section-links { padding-inline-start: 0; }

.sidebar .nav-act, .sidebar .nav-star {
    position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 4px;
    width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 4px;
    background: transparent; color: var(--nav-icon); font-size: 14px; cursor: pointer;
    opacity: 0; transition: opacity .1s;
}
.sidebar .nav-act:hover, .sidebar .nav-star:hover { background: var(--nav-pressed); color: var(--nav-text); }
.sidebar .nav-section-head:hover .nav-act, .sidebar .nav-section-head:focus-within .nav-act,
.sidebar .nav-act[aria-expanded="true"],
.sidebar .nav-item:hover .nav-star, .sidebar .nav-item:focus-within .nav-star, .sidebar .nav-star.is-on { opacity: 1; }
.sidebar .nav-star.is-on { color: #F59E0B; }
.sidebar .nav-item { position: relative; }
.sidebar .nav-item:hover .nav-link, .sidebar .nav-item:focus-within .nav-link { padding-inline-end: 32px !important; }
.sidebar .nav-item .nav-link:has(.nav-count) ~ .nav-star { inset-inline-end: 34px; }
@media (hover: none) { .sidebar .nav-act { opacity: 1; } }

/* Groups inside a module (Attendance) */
.sidebar .nav-group-toggle { font-weight: 400 !important; }
.sidebar .nav-group-chev { margin-inline-start: auto; font-size: 12px !important; transition: transform .15s; }
.sidebar .nav-group.is-open .nav-group-chev { transform: rotate(180deg); }
.sidebar .nav-group-links { margin-inline-start: 0; padding-inline-start: 12px; border-inline-start: 0; }
.sidebar .nav-group-links[hidden] { display: none !important; }

/* Getting started card */
.getting-started {
    border-radius: 8px !important; background: #FFFFFF !important;
    border: 1px solid var(--nav-border) !important; margin: 0 12px 12px !important;
}
.getting-started:hover { background: var(--nav-hover) !important; }
.getting-started-title { color: var(--nav-text) !important; }
.getting-started-icon { color: #F59E0B !important; }
.getting-started-progress { background: #E9F2FF !important; }
.getting-started-progress-bar { background: var(--brand-blue) !important; }
.sidebar-nav { scrollbar-color: #C9CBCF transparent !important; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #C9CBCF !important; }

/* Flyout menus (Recent, Starred, "+", Create) */
.nav-menu-pop {
    position: fixed; z-index: 1300; min-width: 220px; max-width: 320px; max-height: min(420px, 70vh); overflow-y: auto;
    padding: 6px 0; background: #FFFFFF; border-radius: 8px;
    box-shadow: 0 8px 12px rgba(30, 31, 33, .15), 0 0 1px rgba(30, 31, 33, .31);
    font-size: 14px; color: var(--nav-text);
}
.nav-menu-pop[hidden] { display: none !important; }
.nav-menu-pop .nav-menu-label { padding: 10px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--nav-text-subtle); }
.nav-menu-pop .nav-menu-label:first-child { padding-top: 6px; }
.nav-menu-pop a {
    display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 16px;
    color: var(--nav-text) !important; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-menu-pop a i { color: var(--nav-icon); font-size: 16px; flex: none; }
.nav-menu-pop a:hover, .nav-menu-pop a:focus-visible { background: var(--nav-hover); outline: none; box-shadow: inset 2px 0 0 var(--nav-selected); }
[dir="rtl"] .nav-menu-pop a:hover, [dir="rtl"] .nav-menu-pop a:focus-visible { box-shadow: inset -2px 0 0 var(--nav-selected); }
.nav-menu-pop .nav-menu-empty { margin: 0; padding: 8px 16px 10px; font-size: 13px; color: var(--nav-text-subtle); max-width: 260px; white-space: normal; }

/* ---- Layout offsets and collapse (desktop) ---- */
.main-wrapper { margin-inline-start: var(--sidebar-width) !important; padding-top: var(--topbar-height); }
@media (min-width: 1025px) {
    .sidebar.collapsed { display: none !important; }
    .sidebar.collapsed ~ .main-wrapper { margin-inline-start: 0 !important; }
}

/* ---- Drawer (tablet and phone) ---- */
@media (max-width: 1024px) {
    .main-wrapper, .sidebar.collapsed ~ .main-wrapper { margin-inline-start: 0 !important; }
    .sidebar { width: min(300px, calc(100vw - 48px)) !important; max-width: none !important; transition: transform .25s ease !important; }
    .sidebar:not(.active) { transform: translateX(-100%) !important; }
    .sidebar.active { transform: none !important; box-shadow: 8px 0 24px rgba(30, 31, 33, .18) !important; }
    .sidebar.collapsed { display: flex !important; }
    body.nav-drawer-open { overflow: hidden; }
    .sidebar { z-index: 1201 !important; }
    .overlay { z-index: 1200 !important; top: var(--topbar-height) !important; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none !important; } }

/* --------------------------------------------------------------------------
   Application shell — header
   -------------------------------------------------------------------------- */
.main-header, .portal-header {
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--hrx-line) !important;
    box-shadow: none !important;
}
.main-header::before, .portal-header::before { display: none !important; }
.header-btn, .portal-header-btn {
    border: 1px solid var(--hrx-line) !important;
    border-radius: var(--hrx-radius) !important;
    background: #FFFFFF !important;
    color: var(--hrx-ink-2) !important;
}
.header-btn:hover, .portal-header-btn:hover { background: var(--hrx-subtle) !important; color: var(--hrx-ink) !important; }
.header-search input, .header-search-wrap input {
    border-radius: var(--hrx-radius) !important;
    border: 1px solid var(--hrx-line) !important;
    background: var(--hrx-subtle-2) !important;
}
.header-search-wrap:focus-within input { background: #fff !important; border-color: var(--hrx-ink) !important; box-shadow: var(--hrx-focus) !important; }
.header-company, .header-profile { border-radius: var(--hrx-radius) !important; }

/* Language switch: a two-segment pill, English | العربية (partials/hrx/lang-switch).
   The current language is the filled segment, the other is a link. Both segments are
   always shown in the same order, so the pill looks the same and keeps its width on
   English and Arabic screens (docs/ui/TOPBAR.md). */
.hrx-lang-switch {
    display: inline-flex; align-items: stretch; flex: none; gap: 2px;
    height: 36px; padding: 3px;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-sunken);
    white-space: nowrap; direction: ltr;
}
.hrx-lang-opt {
    display: inline-flex; align-items: center; justify-content: center; align-self: stretch; min-width: 32px; padding: 0 10px;
    border-radius: 6px; color: var(--text-subtle); text-decoration: none !important;
    font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1;
    transition: background-color .12s, color .12s;
}
.hrx-lang-opt[lang="ar"] { font-family: 'Tajawal', sans-serif; }
.hrx-lang-opt[lang="en"] { font-family: 'IBM Plex Sans', sans-serif; }
a.hrx-lang-opt:hover { background: var(--surface-hovered); color: var(--text); }
a.hrx-lang-opt:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.hrx-lang-opt.is-current { background: var(--brand-navy); color: #FFFFFF; cursor: default; }
.hrx-lang-short { display: none; }
/* Tight places (the app and portal top bars, phones): EN | ع */
.main-header .hrx-lang-long, .pt-top .hrx-lang-long { display: none; }
.main-header .hrx-lang-short, .pt-top .hrx-lang-short { display: inline; }
.main-header .hrx-lang-opt, .pt-top .hrx-lang-opt { min-width: 30px; padding: 0 8px; }
@media (max-width: 640px) {
    .hrx-lang-long { display: none; }
    .hrx-lang-short { display: inline; }
}
/* On dark headers (public home, portal sign-in) the pill turns translucent. */
.pa-top .hrx-lang-switch, body.home .nav-actions .hrx-lang-switch { padding: 3px !important; gap: 2px !important; }
.pa-top .hrx-lang-opt, body.home .nav-actions .hrx-lang-opt { color: #FFFFFF; }
.pa-top .hrx-lang-opt.is-current, body.home .nav-actions .hrx-lang-opt.is-current { background: rgba(255, 255, 255, .24); }
.pa-top a.hrx-lang-opt:hover, body.home .nav-actions a.hrx-lang-opt:hover { background: rgba(255, 255, 255, .12); }
.hrx-lang-float {
    position: fixed;
    bottom: 16px;
    inset-inline-start: 16px;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(14, 15, 18, .08);
}

/* --------------------------------------------------------------------------
   Page header (control panel)
   -------------------------------------------------------------------------- */
.page-title, .main-wrapper h1 { color: var(--hrx-ink) !important; }
.page-title { font-size: 1.375rem !important; font-weight: 700 !important; line-height: 1.4 !important; }
.page-subtitle { color: var(--hrx-ink-3) !important; font-size: 14px !important; }
.back-btn {
    border: 1px solid var(--hrx-line) !important;
    border-radius: var(--hrx-radius) !important;
    background: #FFFFFF !important;
    color: var(--hrx-ink-2) !important;
}
.back-btn:hover { background: var(--hrx-subtle) !important; color: var(--hrx-ink) !important; }


/* --------------------------------------------------------------------------
   Shell: flush header bar (classic ERP), 60px
   -------------------------------------------------------------------------- */
:root { --header-height: 60px; }
.main-header {
    margin: 0 !important;
    border-radius: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--hrx-line) !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 1.25rem !important;
    top: 0 !important;
}
.hrx-controlbar { top: 60px; }
.main-header .header-search input { height: 38px !important; }
.header-date { border-radius: var(--hrx-radius) !important; }

/* Footer: white bar with a hairline, not a dark band. */
.main-footer { background: #FFFFFF !important; border-top: 1px solid var(--hrx-line) !important; color: var(--hrx-ink-3) !important; }
.main-footer *, .footer-copyright, .footer-mark { color: var(--hrx-ink-3) !important; }

/* --------------------------------------------------------------------------
   Header layout — start: menu + search · end: tools | organisation | user
   Every control is 38px high; spacing on an 8px rhythm.
   -------------------------------------------------------------------------- */
.main-header { display: flex !important; align-items: center !important; gap: 1rem !important; }
.main-header .header-left { display: flex; align-items: center; gap: .5rem; flex: 1 1 auto; min-width: 0; }
.main-header .header-search-wrap { flex: 1 1 auto; max-width: 520px; min-width: 0; }
.main-header .header-search input { height: 38px !important; width: 100% !important; }
.main-header .header-right { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.main-header .header-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 !important; }
.main-header .header-divider { width: 1px !important; height: 24px !important; background: var(--hrx-line) !important; margin: 0 .25rem !important; }
.main-header .header-company, .main-header .header-profile {
    display: flex; align-items: center; gap: .5rem;
    height: 38px; padding: 0 .55rem !important;
    border: 1px solid var(--hrx-line) !important; border-radius: var(--hrx-radius) !important;
    background: #FFFFFF !important; cursor: pointer;
}
.main-header .header-company:hover, .main-header .header-profile:hover { background: var(--hrx-subtle) !important; }
.main-header .header-company-icon, .main-header .header-profile-avatar { width: 26px !important; height: 26px !important; flex: 0 0 26px; }
.main-header .header-company-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px !important; font-weight: 600 !important; color: var(--hrx-ink) !important; }
.main-header .header-profile-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px !important; font-weight: 600 !important; }
.main-header .header-date { display: none !important; }

@media (max-width: 1279.98px) { .main-header .header-company-name { max-width: 120px; } }
@media (max-width: 1099.98px) {
    .main-header .header-company-name { display: none !important; }
}
@media (max-width: 767.98px) {
    .main-header { gap: .5rem !important; padding: 0 .75rem !important; }
    .main-header .header-profile-name, .main-header .header-profile-chevron, .main-header .header-company .header-profile-chevron { display: none !important; }
    .main-header .header-divider { display: none !important; }
    .main-header .header-right { gap: .375rem; }
}
@media (max-width: 479.98px) {
    .main-header .header-search-wrap { max-width: none; }
    .main-header .header-search input::placeholder { color: transparent !important; }
    .main-header .header-company { display: none !important; }
}

/* --------------------------------------------------------------------------
   Top bar (Jira-style): full width above the sidebar.
   start: sidebar toggle + brand · centre: search + Create · end: tools
   -------------------------------------------------------------------------- */
.main-header {
    position: fixed !important; top: 0 !important; inset-inline: 0 !important; left: 0; right: 0;
    z-index: 1100 !important;
    height: var(--topbar-height) !important; min-height: var(--topbar-height) !important;
    display: grid !important; grid-template-columns: auto minmax(200px, 1fr) auto !important;
    align-items: center !important; gap: 12px !important;
    padding: 0 12px !important;
    background: #FFFFFF !important; border-bottom: 1px solid var(--nav-border) !important; box-shadow: none !important;
}
.hrx-controlbar { top: var(--topbar-height) !important; }
.main-header .header-left { display: flex; align-items: center; gap: 4px; min-width: 0; flex: none; }
.main-header .header-center { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; max-width: 820px; justify-self: center; }
.main-header .header-left { min-width: calc(var(--sidebar-width) - 12px); }
.main-header .header-company-name { max-width: 150px !important; }
.main-header .header-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }

/* Icon buttons: 32px, subtle, rounded */
.main-header .nav-toggle, .main-header .header-btn {
    display: inline-grid !important; place-items: center; flex: none;
    width: 32px !important; height: 32px !important; min-width: 32px; padding: 0 !important;
    border: 0 !important; border-radius: 6px !important; background: transparent !important;
    color: var(--nav-icon) !important; font-size: 16px; cursor: pointer;
}
.main-header .nav-toggle:hover, .main-header .header-btn:hover { background: var(--nav-hover) !important; color: var(--nav-text) !important; }
.main-header .nav-toggle:focus-visible, .main-header .header-btn:focus-visible { outline: 2px solid var(--nav-selected); outline-offset: 1px; }
.main-header .nav-toggle[aria-expanded="true"] { color: var(--nav-text) !important; }
[dir="rtl"] .main-header .nav-toggle i { transform: scaleX(-1); }

.topbar-brand { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px; border-radius: 6px; text-decoration: none !important; min-width: 0; }
.topbar-brand:hover { background: var(--nav-hover); }
.topbar-brand img { width: 26px; height: 26px; flex: none; }
.topbar-brand span { font-size: 16px; font-weight: 700; color: var(--nav-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }

/* Search: bordered, full width of the centre column */
.main-header .header-search-wrap { flex: 1 1 auto; max-width: none !important; min-width: 0; }
.main-header .header-search input {
    height: 36px !important; width: 100% !important; border-radius: 6px !important;
    border: 1px solid #8C8F97 !important; background: #FFFFFF !important; font-size: 14px !important; color: var(--nav-text) !important;
}
.main-header .header-search input:hover { background: var(--nav-hover) !important; }
.main-header .header-search-wrap:focus-within input { border-color: var(--nav-selected) !important; box-shadow: inset 0 0 0 1px var(--nav-selected) !important; background: #FFFFFF !important; }

/* Filled button (the Save button of the sidebar's customise dialog) */
.btn-create {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border: 0; border-radius: 6px; background: var(--brand-blue); color: #FFFFFF;
    font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn-create:hover { background: var(--brand-blue-dark); }
.btn-create:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* Tools (approvals, notifications, help, settings, language, organization, account):
   see "Top bar v4" at the end of this file. */

@media (max-width: 1280px) {
    .main-header .header-left { min-width: 0; }
}
@media (max-width: 1024px) {
    .topbar-brand span { display: none; }
}
@media (max-width: 768px) {
    .main-header { gap: 6px !important; padding: 0 8px !important; }
}

/* --------------------------------------------------------------------------
   Blue rail + light sidebar + top bar (docs/ui/PUBLIC-DESIGN-SYSTEM.md §3A)
   ┌rail┬──────────── top bar ────────────┐
   │56px├─ sidebar (resizable) ─┬─ page ──┤
   Desktop only: below 1025px the rail hides and the sidebar is a drawer.
   -------------------------------------------------------------------------- */
:root { --rail-width: 56px; }

.app-rail {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 1150;
    width: var(--rail-width);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 0 12px;
    background: linear-gradient(180deg, var(--brand-navy) 0%, #0C2470 55%, var(--brand-navy-2) 100%);
}
.rail-logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; margin-bottom: 6px; }
.rail-logo img { width: 34px; height: 34px; }
.rail-sep { width: 28px; height: 1px; background: rgba(255, 255, 255, .14); margin: 6px 0; flex: none; }
.rail-modules, .rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.rail-modules { flex: 1 1 auto; overflow-y: auto; scrollbar-width: none; }
.rail-modules::-webkit-scrollbar { display: none; }
.rail-item {
    position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center;
    border: 0; border-radius: 10px; background: transparent; color: rgba(255, 255, 255, .74) !important;
    font-size: 18px; cursor: pointer; text-decoration: none !important; transition: background .15s, color .15s;
}
.rail-item:hover { background: rgba(255, 255, 255, .12); color: #FFFFFF !important; }
.rail-item.is-active { background: rgba(255, 255, 255, .2); color: #FFFFFF !important; }
.rail-item.is-active::before {
    content: ""; position: absolute; inset-inline-start: -8px; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: #34D399;
}
[dir="rtl"] .rail-item.is-active::before { border-radius: 3px 0 0 3px; }
.rail-create { background: rgba(255, 255, 255, .16); color: #FFFFFF !important; }
.rail-logo:focus-visible, .rail-item:focus-visible, .rail-avatar:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.rail-bottom { padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12); width: 40px; }
.rail-avatar {
    position: relative; width: 32px; height: 32px; margin-top: 6px; border-radius: 50%;
    display: grid; place-items: center; text-decoration: none !important;
    background: var(--brand-gradient); color: #FFFFFF !important; font-size: 11px; font-weight: 700;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .25);
}
.rail-avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.rail-presence { position: absolute; bottom: -1px; inset-inline-end: -1px; width: 9px; height: 9px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px var(--brand-navy-2); }
.rail-tip-brand { background: #1E1F21 !important; color: #FFFFFF !important; border-color: #1E1F21 !important; box-shadow: 0 8px 20px rgba(30, 31, 33, .25) !important; font-size: 13px !important; z-index: 1400 !important; }
.rail-tip-brand::before { border-inline-end-color: #1E1F21 !important; }

/* The rail carries the logo, so the top bar keeps only the product name. */
.topbar-brand img { display: none; }

/* ---- Offsets (desktop) ---- */
@media (min-width: 1025px) {
    .main-header { inset-inline-start: var(--rail-width) !important; left: var(--rail-width); }
    .sidebar { inset-inline-start: var(--rail-width) !important; left: var(--rail-width); }
    .main-wrapper { margin-inline-start: calc(var(--rail-width) + var(--sidebar-width)) !important; }
    .sidebar.collapsed ~ .main-wrapper { margin-inline-start: var(--rail-width) !important; }
    .main-header .header-left { min-width: calc(var(--sidebar-width) - 12px); }
}
@media (max-width: 1024px) {
    .app-rail { display: none; }
}
/* RTL offsets live in 06-rtl.css (loaded after this file). */
.main-wrapper { transition: none !important; }

/* ---- Sidebar resizer (drag the edge) ---- */
.sidebar-resizer {
    position: absolute; top: 0; bottom: 0; inset-inline-end: -4px; width: 8px; z-index: 3;
    cursor: col-resize; touch-action: none;
}
.sidebar-resizer::after {
    content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 3px; width: 2px;
    background: transparent; transition: background .12s;
}
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, body.is-resizing-sidebar .sidebar-resizer::after { background: var(--brand-blue); }
.sidebar-resizer:focus-visible { outline: none; }
body.is-resizing-sidebar { cursor: col-resize; user-select: none; }
@media (max-width: 1024px) { .sidebar-resizer { display: none; } }

/* ---- Row "…" actions and starred mark ---- */
.sidebar .nav-more {
    position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 4px;
    width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 4px;
    background: transparent; color: var(--nav-icon); font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .1s;
}
.sidebar .nav-more:hover, .sidebar .nav-more[aria-expanded="true"] { background: var(--nav-pressed); color: var(--nav-text); opacity: 1; }
.sidebar .nav-item:hover .nav-more, .sidebar .nav-item:focus-within .nav-more { opacity: 1; }
.sidebar .nav-more:focus-visible { outline: 2px solid var(--nav-selected); outline-offset: -2px; opacity: 1; }
.sidebar .nav-item .nav-link:has(.nav-count) ~ .nav-more { inset-inline-end: 34px; }
.sidebar .nav-starred-mark {
    display: none; position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 10px;
    font-size: 11px; color: #F59E0B; pointer-events: none;
}
.sidebar .nav-item.is-starred .nav-starred-mark { display: block; }
.sidebar .nav-item.is-starred .nav-link:has(.nav-count) ~ .nav-starred-mark { inset-inline-end: 40px; }
.sidebar .nav-item:hover .nav-starred-mark, .sidebar .nav-item:focus-within .nav-starred-mark { display: none; }
.sidebar .nav-item.is-starred .nav-link { padding-inline-end: 28px !important; }
@media (hover: none) { .sidebar .nav-more { opacity: 1; } }
/* Bigger tap targets for the row buttons on touch screens. */
@media (pointer: coarse) {
    .sidebar .nav-act, .sidebar .nav-star, .sidebar .nav-more { width: 32px; height: 32px; }
    .sidebar .nav-item .nav-link, .sidebar .nav-item:hover .nav-link,
    .sidebar .nav-item:focus-within .nav-link { padding-inline-end: 40px !important; }
}
.nav-menu-pop button[role="menuitem"] {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 16px;
    border: 0; background: transparent; color: var(--nav-text); font: inherit; font-size: 14px; text-align: start; cursor: pointer;
}
.nav-menu-pop button[role="menuitem"] i { color: var(--nav-icon); font-size: 16px; }
.nav-menu-pop button[role="menuitem"]:hover, .nav-menu-pop button[role="menuitem"]:focus-visible { background: var(--nav-hover); outline: none; box-shadow: inset 2px 0 0 var(--nav-selected); }

/* ---- Customize sidebar ---- */
.sidebar .is-user-hidden { display: none !important; }
.sidebar .nav-section.nav-foot { margin-top: 8px !important; padding-top: 8px !important; border-top: 1px solid var(--nav-border) !important; }
.sidebar .nav-section.nav-foot .nav-link { color: var(--nav-text-subtle) !important; }
.sidebar .nav-section.is-flash > .nav-section-head .nav-section-title { animation: navFlash 1s ease; }
@keyframes navFlash { 0%, 40% { background: var(--nav-selected-bg); } 100% { background: transparent; } }

.nav-modal-backdrop {
    position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px;
    background: rgba(9, 30, 66, .54);
}
.nav-modal-backdrop[hidden] { display: none !important; }
body.nav-modal-open { overflow: hidden; }
.nav-modal {
    width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
    padding: 24px; border-radius: 12px; background: #FFFFFF; color: var(--nav-text);
    box-shadow: 0 8px 12px rgba(30, 31, 33, .15), 0 0 1px rgba(30, 31, 33, .31);
}
.nav-modal h2 { margin: 0 0 6px; font-size: 20px !important; font-weight: 600 !important; color: var(--nav-text) !important; }
.nav-modal p { margin: 0 0 16px; font-size: 14px; color: var(--nav-text-subtle); }
.nav-custom-list { list-style: none; margin: 0 0 20px; padding: 0; border: 1px solid var(--nav-border); border-radius: 8px; }
.nav-custom-list li + li { border-top: 1px solid var(--nav-border); }
.nav-custom-list label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; margin: 0; font-size: 14px; cursor: pointer; }
.nav-custom-list label:hover { background: var(--nav-hover); }
.nav-custom-list label.is-locked { cursor: default; color: var(--nav-text-subtle); }
.nav-custom-list input { width: 16px; height: 16px; accent-color: var(--brand-blue); margin: 0; }
.nav-custom-list i { color: var(--nav-icon); font-size: 16px; }
.nav-custom-list small { margin-inline-start: auto; font-size: 12px; color: var(--nav-text-subtle); }
.nav-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.nav-btn-subtle { height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--nav-text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.nav-btn-subtle:hover { background: var(--nav-hover); }
.nav-btn-subtle:focus-visible, .nav-custom-list input:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* Width follows the resizer directly (no easing while dragging). */
@media (min-width: 1025px) { .sidebar { transition: none !important; } }


/* ---- Final sidebar touches ---- */
/* Module rows carry "…" and "+" in the same place on every module. */
.sidebar .nav-section-title { padding-inline-end: 60px !important; }
.sidebar .nav-section-head .nav-act-more { inset-inline-end: 30px; }
.sidebar .nav-section-head .nav-act-more:last-child { inset-inline-end: 4px; }
.sidebar .nav-section-head:hover .nav-act-more, .sidebar .nav-section-head:focus-within .nav-act-more, .sidebar .nav-act-more[aria-expanded="true"] { opacity: 1; }
/* "More" lists what the user hid; it disappears when nothing is hidden. */
.sidebar #navMoreBtn.is-empty { display: none !important; }
/* Hidden sidebar peeks out over the page while the pointer is on the rail. */
@media (min-width: 1025px) {
    .sidebar.collapsed.is-peek { display: flex !important; z-index: 1140 !important; box-shadow: 8px 0 24px rgba(30, 31, 33, .16) !important; }
    [dir="rtl"] .sidebar.collapsed.is-peek { box-shadow: -8px 0 24px rgba(30, 31, 33, .16) !important; }
}

/* --------------------------------------------------------------------------
   Module bar (Jira-style container navigation) — pinned under the top bar on
   pages that belong to a module: module name, every page as a tab, and the
   module's "New" create menu. The breadcrumb bar sits right under it.
   -------------------------------------------------------------------------- */
.hrx-modulebar {
    position: sticky; top: var(--topbar-height); z-index: 46;
    display: flex; align-items: center; gap: 12px;
    height: 48px; margin: -1.5rem -1.5rem 0; padding: 0 1.5rem;
    background: #FFFFFF; border-bottom: 1px solid var(--nav-border);
}
.modulebar-title {
    flex: none; font-size: 15px; font-weight: 700; color: var(--nav-text); white-space: nowrap;
    padding-inline-end: 14px; border-inline-end: 1px solid var(--nav-border); line-height: 24px;
}
.modulebar-tabs {
    display: flex; align-items: stretch; gap: 2px; flex: 1 1 auto; min-width: 0; height: 100%;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.modulebar-tabs::-webkit-scrollbar { display: none; }
.modulebar-tab {
    position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px;
    height: 100%; padding: 0 10px; border: 0; background: transparent;
    font: inherit; font-size: 14px; font-weight: 400; white-space: nowrap; cursor: pointer;
    color: var(--nav-text-subtle) !important; text-decoration: none !important;
}
.modulebar-tab i { font-size: 15px; color: var(--nav-icon); }
.modulebar-tab:hover { color: var(--nav-text) !important; background: var(--nav-hover); }
.modulebar-tab:focus-visible { outline: 2px solid var(--nav-selected); outline-offset: -4px; border-radius: 6px; }
.modulebar-tab.is-active { color: var(--nav-selected) !important; font-weight: 500; }
.modulebar-tab.is-active i { color: var(--nav-selected); }
.modulebar-tab.is-active::after {
    content: ""; position: absolute; inset-inline: 8px; bottom: 0; height: 2px;
    border-radius: 2px 2px 0 0; background: var(--nav-selected);
}
.modulebar-tab.is-off { opacity: .5; }
.modulebar-chev { font-size: 11px !important; }
.modulebar-group[aria-expanded="true"] { background: var(--nav-hover); }
.modulebar-count {
    display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px;
    background: #E9EAEC; color: var(--nav-text-subtle); font-size: 11px; font-weight: 600;
}
.modulebar-tab.is-active .modulebar-count { background: var(--nav-selected); color: #FFFFFF; }
.modulebar-count.is-alert { background: #FEF3C7; color: #B45309; }
.modulebar-create {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border: 1px solid var(--nav-border); border-radius: 6px; background: #FFFFFF;
    font: inherit; font-size: 14px; font-weight: 500; color: var(--nav-text); cursor: pointer;
}
.modulebar-create:hover, .modulebar-create[aria-expanded="true"] { background: var(--nav-hover); }
.modulebar-create:focus-visible { outline: 2px solid var(--nav-selected); outline-offset: 2px; }
.modulebar-create i { color: var(--nav-selected); }
/* The breadcrumb bar follows directly and pins just below the module bar. */
.hrx-modulebar ~ .hrx-controlbar { margin-top: 0 !important; top: calc(var(--topbar-height) + 48px) !important; }
@media (max-width: 768px) {
    .hrx-modulebar { margin: -1rem -1rem 0; padding: 0 1rem; gap: 8px; height: 44px; }
    .hrx-modulebar ~ .hrx-controlbar { top: calc(var(--topbar-height) + 44px) !important; }
    .modulebar-title { font-size: 14px; padding-inline-end: 10px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
    .modulebar-tab { padding: 0 8px; font-size: 13.5px; }
    .modulebar-create span { display: none; }
    .modulebar-create { width: 32px; padding: 0; justify-content: center; }
}

/* The dashboard page head follows the module bar instead of pulling up under it. */
.hrx-modulebar ~ .hrx-pagehead { margin-top: 0 !important; }

/* --------------------------------------------------------------------------
   Sidebar rhythm (after Zoho Books): even 36px rows, spacing instead of rules,
   a small section label, the open module softly tinted, and its pages indented
   under the title text. Labels use the full width until the row's actions show.
   -------------------------------------------------------------------------- */
.sidebar .sidebar-nav { padding: 14px 10px 18px !important; }
.sidebar .nav-link, .sidebar .nav-section-title {
    min-height: 36px; padding: 7px 10px !important; margin: 0 0 2px !important;
    border-radius: 8px !important; gap: 10px; line-height: 22px;
}
.sidebar .nav-link i, .sidebar .nav-section-title i { width: 18px; text-align: center; font-size: 16px; }

/* Groups are separated by space, not lines. */
.sidebar .nav-section.nav-top { border-bottom: 0 !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }
.sidebar .nav-label {
    margin: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: #8A8D93;
}
[dir="rtl"] .sidebar .nav-label { letter-spacing: 0; font-size: 12px; }
.sidebar .nav-section + .nav-section:not(.nav-top) { margin-top: 0 !important; }
.sidebar .nav-section.nav-foot { border-top: 0 !important; margin-top: 18px !important; padding-top: 0 !important; }

/* Module titles: regular weight, full label until hover reveals "…" and "+". */
.sidebar .nav-section-title { font-weight: 500 !important; padding-inline-end: 10px !important; }
.sidebar .nav-section-head:hover .nav-section-title,
.sidebar .nav-section-head:focus-within .nav-section-title { padding-inline-end: 62px !important; }
.sidebar .nav-section-title .nav-chevron { width: 18px; font-size: 12px !important; color: #8A8D93 !important; }
/* The open module is softly tinted so its pages read as one block. */
.sidebar .nav-section:not(.collapsed) > .nav-section-head .nav-section-title { background: #F1F3F8 !important; }
.sidebar .nav-section:not(.collapsed) > .nav-section-head .nav-section-title:hover { background: #E8EBF2 !important; }

/* Pages sit under the title text (chevron column + gap), with 4px air above and below. */
.sidebar .nav-section-links { padding-inline-start: 18px; }
.sidebar .nav-section:not(.collapsed) > .nav-section-links { padding-top: 4px; padding-bottom: 8px; }
.sidebar .nav-section.nav-top > .nav-section-links { padding: 0 !important; }
.sidebar .nav-section-links .nav-link { min-height: 34px; padding-top: 6px !important; padding-bottom: 6px !important; }
.sidebar .nav-group-links { padding-inline-start: 18px; }
.sidebar .nav-link.active::before { inset-inline-start: -10px !important; }
.sidebar .nav-section-links .nav-link.active::before { inset-inline-start: -28px !important; }
.sidebar .nav-group-links .nav-link.active::before { inset-inline-start: -46px !important; }

.getting-started { margin: 0 10px 12px !important; }

/* More breathing room between sidebar rows (40px rows, 4px gaps). */
.sidebar .nav-link, .sidebar .nav-section-title { min-height: 40px; padding: 9px 12px !important; margin: 0 0 4px !important; }
.sidebar .nav-section-links .nav-link { min-height: 38px; padding-top: 8px !important; padding-bottom: 8px !important; }
.sidebar .nav-section:not(.collapsed) > .nav-section-links { padding-top: 6px; padding-bottom: 10px; }
.sidebar .nav-label { margin: 22px 12px 8px; }
.sidebar .nav-section.nav-foot { margin-top: 22px !important; }
.sidebar .nav-link.active::before { inset-inline-start: -10px !important; }

/* --------------------------------------------------------------------------
   Shell v3: the header sits beside the sidebar (aligned with the content),
   the sidebar runs full height with its own head row, and each global control
   lives in one place only (search/create/account in the header, help on the
   rail; the header shows Help only where the rail is hidden).
   -------------------------------------------------------------------------- */
.sidebar { top: 0 !important; }
.sidebar-head {
    flex: none; display: flex; align-items: center; gap: var(--space-2);
    height: var(--topbar-height); padding-block: 0; padding-inline: var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--border);
}
.sidebar-product { flex: 1 1 auto; min-width: 0; font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--text) !important; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.sidebar-close { display: none; width: 36px; height: 36px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-subtle); cursor: pointer; }
.sidebar-close:hover { background: var(--surface-hovered); }
.sidebar-close:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 1px; }

@media (min-width: 1025px) {
    .main-header { inset-inline-start: calc(var(--rail-width) + var(--sidebar-width)) !important; left: calc(var(--rail-width) + var(--sidebar-width)); }
    .sidebar.collapsed ~ .main-wrapper .main-header { inset-inline-start: var(--rail-width) !important; left: var(--rail-width); }
    .main-header .header-left { min-width: 0 !important; }
    .main-header .tb-help { display: none !important; }
}
@media (max-width: 1024px) {
    .sidebar-close { display: inline-grid; place-items: center; }
    .overlay { top: 0 !important; }
}
.main-header { grid-template-columns: auto minmax(160px, 1fr) auto !important; }
.main-header .header-center { max-width: 720px; }

/* Skip link: visible on keyboard focus only. */
.skip-link {
    position: fixed; top: 8px; inset-inline-start: 8px; z-index: 2000;
    padding: 8px 14px; border-radius: var(--radius-md); background: var(--text); color: #FFFFFF !important;
    font-size: var(--text-md); font-weight: var(--weight-semibold); text-decoration: none !important;
    transform: translateY(-200%); transition: transform .15s;
}
.skip-link:focus { transform: none; outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.main-content:focus { outline: none; }

/* Content padding from tokens; bars that bleed to the edges follow it. */
/* White canvas on every page: cards and lists keep their own 1px border. */
.main-content { padding: var(--content-pad) !important; background: var(--surface) !important; min-width: 0; }
.hrx-modulebar { margin: calc(-1 * var(--content-pad)) calc(-1 * var(--content-pad)) 0 !important; padding-inline: var(--content-pad) !important; }
.hrx-controlbar { margin: calc(-1 * var(--content-pad)) calc(-1 * var(--content-pad)) var(--space-5) !important; padding-inline: var(--content-pad) !important; }
.hrx-modulebar ~ .hrx-controlbar { margin-top: 0 !important; }

/* Footer: small, in normal flow. */
.main-footer { padding: var(--space-3) var(--content-pad) !important; border-top: 1px solid var(--border) !important; background: var(--surface) !important; }
.main-footer .footer-content { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.footer-links { display: flex; gap: var(--space-4); }
.footer-links a { color: var(--text-subtle) !important; text-decoration: none; }
.footer-links a:hover { color: var(--brand-blue) !important; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    .skip-link, .sidebar, .app-rail, .nav-section-title .nav-chevron { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------------------------
   Top bar v4 (docs/ui/TOPBAR.md) — markup: layouts/app.blade.php (.main-header),
   layouts/partials/header-search, topbar-end, notifications-dropdown.
   start: sidebar toggle · centre: search + Create ·
   end: approvals, notifications, help, settings | language | organization | account
   Every control is 36px high in the 56px bar, 8px apart; hairline separators
   between groups; all dropdowns share .tb-pop (white, 1px border, 12px radius,
   soft shadow, 8px padding, 36px items) and open below their button at its
   end edge, on the flyout layer (1300).
   -------------------------------------------------------------------------- */
.main-header { gap: var(--space-3) !important; padding: 0 var(--space-4) !important; }
.main-header .header-center { max-width: 760px; gap: var(--space-2); }
.main-header .header-right { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2) !important; min-width: 0; }
.main-header .nav-toggle { width: 36px !important; height: 36px !important; border-radius: var(--radius-md) !important; font-size: 18px; }
.main-header .nav-toggle:hover { background: var(--surface-hovered) !important; }
.main-header .nav-toggle:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 1px; }

/* Search: the widest control, a soft field that turns white with a blue ring on focus. */
.main-header .header-search { display: block !important; }
.main-header .header-search input {
    height: 36px !important; width: 100% !important; padding-block: 0 !important;
    padding-inline-start: 36px !important; padding-inline-end: 64px !important;
    border: 1px solid var(--border) !important; border-radius: var(--radius-md) !important;
    background: var(--surface-sunken) !important; color: var(--text) !important; font-size: var(--text-md) !important;
    box-shadow: none !important; transition: background-color .12s, border-color .12s;
}
.main-header .header-search input::placeholder { color: var(--text-subtlest) !important; }
.main-header .header-search input:hover { background: var(--surface-hovered) !important; border-color: var(--border-strong) !important; }
.main-header .header-search-wrap:focus-within input {
    background: var(--surface) !important; border-color: var(--brand-blue) !important; box-shadow: 0 0 0 3px var(--brand-blue-tint) !important;
}
.main-header .header-search > .bi-search {
    left: auto !important; right: auto !important; inset-inline-start: 12px !important;
    color: var(--text-subtlest) !important; font-size: 15px !important; pointer-events: none;
}
.main-header .header-search-suggest {
    top: calc(100% + 8px) !important; z-index: 1300; padding: var(--space-2);
    border: 1px solid var(--border) !important; border-radius: var(--radius-lg) !important;
    box-shadow: 0 12px 28px -6px rgba(30, 31, 33, .16), 0 2px 6px rgba(30, 31, 33, .06) !important;
}
.main-header .header-search-suggest-item { align-items: center; min-height: 36px; padding: 6px var(--space-2); border: 0; border-radius: var(--radius-md); }
.main-header .header-search-suggest-item:hover, .main-header .header-search-suggest-item.is-active { background: var(--surface-hovered); }
.main-header .header-search-suggest-item i.icon { background: var(--surface-sunken); color: var(--text-subtle); }
.main-header .header-search-suggest-item strong { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); }
.header-search-suggest-label { padding: var(--space-1) var(--space-2) 6px; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-subtlest); }
.main-header .header-search-suggest-foot { margin: var(--space-1) calc(-1 * var(--space-2)) calc(-1 * var(--space-2)); border-top: 1px solid var(--border); background: var(--surface-sunken); }
.tb-search-open { display: none !important; }

/* Icon buttons */
.tb-btn {
    position: relative; flex: none; display: inline-grid; place-items: center;
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-md);
    background: transparent; color: var(--text-subtle) !important; font: inherit; font-size: 18px; line-height: 1;
    cursor: pointer; text-decoration: none !important; transition: background-color .12s, color .12s;
}
.tb-btn:hover, .tb-btn[aria-expanded="true"] { background: var(--surface-hovered); color: var(--text) !important; }
.tb-btn.is-current { background: var(--nav-selected-bg); color: var(--brand-blue) !important; }
.tb-btn:focus-visible, .tb-company-btn:focus-visible, .tb-user-btn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.tb-count {
    position: absolute; top: 1px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--radius-pill); box-shadow: 0 0 0 2px var(--surface);
    background: var(--status-danger); color: var(--surface);
    font-size: 11px; font-weight: var(--weight-bold); line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.tb-count.is-brand { background: var(--brand-blue); }
.tb-sep { flex: none; width: 1px; height: 24px; background: var(--border); }

/* Dropdowns */
.tb-menu { position: relative; flex: none; display: flex; align-items: center; }
.tb-pop {
    position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 1300;
    width: 280px; max-width: calc(100vw - 16px);
    max-height: min(560px, calc(100vh - var(--topbar-height) - 24px)); overflow-y: auto; overscroll-behavior: contain;
    padding: var(--space-2); background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 12px 28px -6px rgba(30, 31, 33, .16), 0 2px 6px rgba(30, 31, 33, .06);
    font-size: var(--text-md); text-align: start;
}
.tb-pop[hidden] { display: none !important; }
.tb-pop-wide { width: 380px; }
.tb-pop-company { width: 340px; }
.tb-pop-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
    min-height: 36px; padding: 0 var(--space-2) var(--space-2); margin-bottom: var(--space-1);
    border-bottom: 1px solid var(--border);
}
.tb-pop-head strong { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); }
.tb-pop-meta { font-size: var(--text-xs); color: var(--text-subtlest); }
.tb-pop-label { padding: var(--space-2) var(--space-2) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-subtlest); }
.tb-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px var(--space-2);
    border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text) !important;
    font: inherit; font-size: var(--text-md); text-align: start; text-decoration: none !important; cursor: pointer;
}
.tb-item > i { flex: none; width: 18px; text-align: center; font-size: 16px; color: var(--text-subtle); }
.tb-item:hover, a.tb-item:focus-visible, button.tb-item:focus-visible { background: var(--surface-hovered); outline: none; }
a.tb-item:focus-visible, button.tb-item:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-blue); }
.tb-item.is-danger { color: var(--status-danger) !important; }
.tb-item.is-danger > i { color: inherit; }
.tb-item.is-danger:hover { background: var(--status-danger-bg); }
.tb-divider { height: 1px; margin: var(--space-1) calc(-1 * var(--space-2)); background: var(--border); }
.tb-pop-foot { display: flex; gap: var(--space-1); margin-top: var(--space-1); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.tb-foot-link {
    flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 var(--space-2);
    border-radius: var(--radius-md); color: var(--brand-blue) !important; font-size: var(--text-sm); font-weight: var(--weight-semibold);
    text-decoration: none !important;
}
.tb-foot-link:hover, .tb-foot-link:focus-visible { background: var(--brand-blue-tint); outline: none; }
.tb-empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--text-subtle); font-size: var(--text-sm); }
.tb-empty i { display: block; margin-bottom: var(--space-2); font-size: 24px; color: var(--text-subtlest); }
.tb-empty p { margin: 0; }
.tb-empty p + p { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--text-subtlest); }
.tb-empty b { font-weight: var(--weight-semibold); color: var(--text); }
.is-late { color: var(--status-warning); font-weight: var(--weight-semibold); }

/* Approvals: one row per waiting record, oldest first. */
.tb-appr {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px var(--space-2);
    border-radius: var(--radius-md); color: var(--text) !important; text-decoration: none !important;
}
.tb-appr:hover, .tb-appr:focus-visible { background: var(--surface-hovered); outline: none; }
.tb-appr:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-blue); }
.tb-ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--text-subtle); font-size: 15px; }
.tb-appr-body { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.35; }
.tb-appr-body b, .tb-appr-body small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-appr-body b { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.tb-appr-body small { font-size: var(--text-xs); color: var(--text-subtlest); }
.tb-appr-go {
    flex: none; display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
    color: var(--brand-blue); font-size: var(--text-xs); font-weight: var(--weight-semibold);
}
.tb-appr:hover .tb-appr-go { border-color: var(--brand-blue); }

/* Notifications: unread rows are bold and carry a blue dot. */
.tb-mark-read { margin: 0; }
.tb-mark-read button {
    height: 28px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent;
    color: var(--brand-blue); font: inherit; font-size: var(--text-xs); font-weight: var(--weight-semibold); cursor: pointer;
}
.tb-mark-read button:hover { background: var(--brand-blue-tint); }
.tb-mark-read button:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.tb-pop .header-notifications-list { max-height: 360px; overflow-y: auto; }
.tb-pop .header-notif-item {
    position: relative; display: flex; gap: 10px; padding: var(--space-2); padding-inline-end: 24px;
    border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text) !important; text-decoration: none !important;
}
.tb-pop .header-notif-item:hover, .tb-pop .header-notif-item:focus-visible { background: var(--surface-hovered); outline: none; }
.tb-pop .header-notif-item:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-blue); }
.tb-pop .header-notif-icon { width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--text-subtle); }
.tb-pop .header-notif-icon.is-warning { background: var(--status-warning-bg); color: var(--status-warning); }
.tb-pop .header-notif-title { font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--text); }
.tb-pop .header-notif-desc { font-size: var(--text-xs); color: var(--text-subtle); }
.tb-pop .header-notif-time { font-size: 11px; color: var(--text-subtlest); }
.tb-pop .header-notif-item.is-unread { background: transparent; }
.tb-pop .header-notif-item.is-unread:hover { background: var(--surface-hovered); }
.tb-pop .header-notif-item.is-unread .header-notif-title { font-weight: var(--weight-bold); }
.tb-pop .header-notif-item.is-unread::after {
    content: ""; position: absolute; top: 14px; inset-inline-end: 10px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--brand-blue);
}

/* Organization: logo or initials, name (one line, full name on hover) and the user's role. */
.tb-company-btn {
    display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 320px; height: 36px;
    padding-block: 0; padding-inline: 4px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
    color: var(--text) !important; font: inherit; text-align: start; text-decoration: none !important; cursor: pointer;
    transition: background-color .12s, border-color .12s;
}
.tb-company-btn:hover, .tb-company-btn[aria-expanded="true"] { background: var(--surface-sunken); border-color: var(--border-strong); }
.tb-logo {
    flex: none; width: 28px; height: 28px; display: grid; place-items: center; overflow: hidden;
    border-radius: 6px; background: var(--brand-navy); color: var(--surface);
    font-size: 11px; font-weight: var(--weight-bold); line-height: 1; letter-spacing: .02em;
}
.tb-logo.has-img { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.tb-logo img { width: 100%; height: 100%; object-fit: contain; }
.tb-company-text { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.25; }
.tb-company-name, .tb-company-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-company-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); }
.tb-company-role { font-size: 11px; color: var(--text-subtlest); }
.tb-chev { flex: none; font-size: 12px; color: var(--text-subtle); transition: transform .15s; }
[aria-expanded="true"] > .tb-chev { transform: rotate(180deg); }
.tb-company-empty { min-width: 0; }
.tb-company-empty .tb-logo { background: var(--brand-blue-tint); color: var(--brand-blue); font-size: 14px; }
.tb-org-list { display: grid; gap: 2px; }
.tb-org-form { margin: 0; }
.tb-org-form[hidden], .tb-org[hidden] { display: none !important; }
.tb-org { min-height: 48px; }
.tb-org-text { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.3; }
.tb-org-text b, .tb-org-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-org-text b { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.tb-org-text small { font-size: var(--text-xs); color: var(--text-subtlest); }
.tb-org.is-active { background: var(--nav-selected-bg); cursor: default; }
.tb-org.is-active:hover { background: var(--nav-selected-bg); }
.tb-org-tick { flex: none; font-size: 18px; color: var(--brand-blue); }
.tb-filter { position: relative; margin: 0 0 var(--space-1); }
.tb-filter i { position: absolute; top: 50%; inset-inline-start: 10px; transform: translateY(-50%); color: var(--text-subtlest); font-size: 14px; pointer-events: none; }
.tb-filter input {
    width: 100%; height: 36px; padding-block: 0; padding-inline: 32px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunken);
    color: var(--text); font: inherit; font-size: var(--text-sm);
}
.tb-filter input:focus { outline: none; background: var(--surface); border-color: var(--brand-blue); box-shadow: 0 0 0 3px var(--brand-blue-tint); }
.tb-filter-empty { margin: 0; padding: var(--space-2); font-size: var(--text-sm); color: var(--text-subtle); }

/* Account */
.tb-user-btn {
    display: flex; align-items: center; gap: 4px; height: 36px; padding-block: 0; padding-inline: 2px 6px;
    border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.tb-user-btn:hover, .tb-user-btn[aria-expanded="true"] { background: var(--surface-hovered); }
.tb-avatar {
    flex: none; width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden;
    border-radius: 50%; background: var(--brand-navy); color: var(--surface);
    font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .02em;
}
.tb-avatar img { width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 50%; }
.tb-avatar.is-lg { width: 40px; height: 40px; font-size: var(--text-sm); }
.tb-user-head {
    display: flex; align-items: center; gap: 10px; padding: var(--space-1) var(--space-2) var(--space-2);
    margin: 0 0 var(--space-1); border-bottom: 1px solid var(--border);
}
.tb-user-id { min-width: 0; display: grid; line-height: 1.35; }
.tb-user-id b, .tb-user-id small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user-id b { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); }
.tb-user-id small { font-size: var(--text-xs); color: var(--text-subtle); }
.tb-user-id small + small { color: var(--text-subtlest); }

/* Help shows only where the rail is hidden: see "Shell v3" above (.tb-help). */

/* Narrower desktops: the organization keeps two lines in less room. */
@media (max-width: 1279.98px) {
    .tb-company-btn { min-width: 200px; max-width: 240px; }
}
/* Under 1024px: labels go, icons stay. The organization shrinks to its logo. */
@media (max-width: 1023.98px) {
    .main-header .header-search input { padding-inline-end: 12px !important; }
    .tb-company-btn { min-width: 0; max-width: none; width: 36px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
    .tb-company-btn .tb-company-text, .tb-company-btn .tb-chev, .tb-user-btn .tb-chev { display: none; }
    .tb-user-btn { padding: 2px; }
}
/* Under 640px: search becomes a button that opens the field over the bar;
   language and settings move out (language is in the account menu). */
@media (max-width: 639.98px) {
    .main-header { grid-template-columns: auto minmax(0, 1fr) auto !important; gap: var(--space-2) !important; padding: 0 var(--space-2) !important; }
    .main-header .header-right { gap: var(--space-1) !important; }
    .main-header .header-center { justify-content: flex-end; }
    .tb-search-open { display: inline-grid !important; }
    .main-header:not(.is-search-open) .header-search-wrap { display: none !important; }
    .main-header.is-search-open .header-search-wrap {
        position: absolute; inset: 0; z-index: 5; display: flex; align-items: center;
        padding: 0 var(--space-2); background: var(--surface);
    }
    .main-header.is-search-open .header-search { flex: 1 1 auto; }
    .main-header .header-search input { font-size: 16px !important; }
    .main-header .hrx-lang-switch, .main-header .tb-settings, .main-header .tb-help, .main-header .tb-sep { display: none !important; }
    .tb-pop, .tb-pop-wide, .tb-pop-company {
        position: fixed; top: calc(var(--topbar-height) + 4px); inset-inline: 8px; width: auto; max-width: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .tb-btn, .tb-company-btn, .tb-chev, .hrx-lang-opt { transition: none !important; }
}

/* ---- 04-components.css ---- */
/* --------------------------------------------------------------------------
   Cards & panels
   -------------------------------------------------------------------------- */
.card, .form-card, .detail-card, .details-card, .info-card, .summary-card, .stat-card,
.settings-panel, .panel, .portal-card, .pf-panel, .preview-panel, .emi-notice {
    background: #FFFFFF;
    border: 1px solid var(--hrx-line);
    border-radius: var(--hrx-radius-lg);
    box-shadow: none !important;
}
.card-header, .form-card-header, .detail-card-header, .info-card-header, .settings-panel-header,
.portal-card-header, .pf-panel-head {
    background: var(--hrx-subtle-2) !important;
    border-bottom: 1px solid var(--hrx-line) !important;
}
.card-title, .form-card-title, .portal-card-title, .section-title, .form-section-title, .settings-section-title {
    color: var(--hrx-ink) !important;
    font-weight: 700 !important;
}
.form-section-title, .settings-section-title {
    padding-bottom: .55rem;
    border-bottom: 1px solid var(--hrx-line);
    margin-bottom: 1rem;
}
.form-card-icon, .stat-icon {
    border-radius: var(--hrx-radius) !important;
}
.settings-panel-footer { background: var(--hrx-subtle-2) !important; border-top: 1px solid var(--hrx-line) !important; }

/* Stat tiles */
.stat-card { transition: border-color .15s; }
.stat-card:hover { border-color: var(--hrx-line-strong) !important; transform: none !important; }
.stat-value { color: var(--hrx-ink) !important; font-weight: 700 !important; }
.stat-label { color: var(--hrx-ink-3) !important; }

/* Read-only field rows (view pages) */
.info-label, .detail-label, .info-item-label, .settlement-label {
    color: var(--hrx-ink-3) !important;
    font-weight: 500 !important;
}
.info-value, .detail-value, .info-item-value, .settlement-value {
    color: var(--hrx-ink) !important;
}
.info-row, .detail-row, .settlement-row, .summary-row { border-color: var(--hrx-line-soft) !important; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn, .btn-portal, .action-btn, .step-btn, .ps-btn-primary, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 36px;
    padding: .45rem 1rem;
    border-radius: var(--hrx-radius) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3;
    border: 1px solid transparent;
    box-shadow: none !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover, .btn-portal:hover, .action-btn:hover, .step-btn:hover { transform: none !important; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--hrx-accent); outline-offset: 2px; }

.btn-primary, .btn-portal-primary, .portal-btn-primary, .ps-btn-primary, .ops-btn-gold {
    background: var(--hrx-accent) !important;
    border-color: var(--hrx-accent) !important;
    color: #FFFFFF !important;
    background-image: none !important;
}
.btn-primary:hover, .btn-portal-primary:hover, .portal-btn-primary:hover, .ps-btn-primary:hover, .ops-btn-gold:hover {
    background: var(--hrx-accent-dark) !important;
    border-color: var(--hrx-accent-dark) !important;
    color: #FFFFFF !important;
}
.btn-outline, .btn-secondary, .btn-light, .btn-default, .btn-outline-secondary, .btn-outline-primary, .btn-white {
    background: #FFFFFF !important;
    border: 1px solid var(--hrx-line-strong) !important;
    color: var(--hrx-ink) !important;
    background-image: none !important;
}
.btn-outline:hover, .btn-secondary:hover, .btn-light:hover, .btn-default:hover,
.btn-outline-secondary:hover, .btn-outline-primary:hover, .btn-white:hover {
    background: var(--hrx-subtle) !important;
    border-color: var(--hrx-ink-3) !important;
    color: var(--hrx-ink) !important;
}
.btn-danger, .step-btn-danger {
    background: var(--hrx-danger) !important;
    border-color: var(--hrx-danger) !important;
    color: #FFFFFF !important;
    background-image: none !important;
}
.btn-danger:hover, .step-btn-danger:hover { background: #8A1C13 !important; border-color: #8A1C13 !important; }
.btn-outline-danger {
    background: #FFFFFF !important; color: var(--hrx-danger) !important;
    border: 1px solid var(--hrx-danger-line) !important;
}
.btn-outline-danger:hover { background: var(--hrx-danger-bg) !important; }
.btn-success {
    background: var(--hrx-success) !important;
    border-color: var(--hrx-success) !important;
    color: #FFFFFF !important;
    background-image: none !important;
}
.btn-success:hover { background: #24432B !important; border-color: #24432B !important; }
.btn-warning {
    background: #B54708 !important; border-color: #B54708 !important; color: #FFFFFF !important;
    background-image: none !important;
}
.btn-warning:hover { background: #9A4A05 !important; }
.btn-info {
    background: var(--hrx-info) !important; border-color: var(--hrx-info) !important; color: #FFFFFF !important;
    background-image: none !important;
}
.btn-ghost, .btn-link {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--hrx-ink-2) !important;
}
.btn-ghost:hover, .btn-link:hover { background: var(--hrx-subtle) !important; color: var(--hrx-ink) !important; }
.btn-sm { min-height: 30px; padding: .3rem .7rem; font-size: 13px !important; }
.btn-lg { min-height: 44px; padding: .6rem 1.4rem; font-size: 15px !important; }
.btn-icon { padding: 0; width: 36px; }
.table-action {
    border-radius: var(--hrx-radius) !important;
    color: var(--hrx-ink-3) !important;
}
.table-action:hover { background: var(--hrx-subtle) !important; color: var(--hrx-ink) !important; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label, .form-group > label, .modal-form-label, .portal-form-label, .field-label, label.form-label {
    color: var(--hrx-ink-2) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: .35rem;
}
.required, .req, .form-label .text-danger { color: var(--hrx-danger) !important; }

.form-control, .form-select, .form-input, .modal-form-control, .portal-form-control, .field-input,
.main-wrapper .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="range"]),
.main-wrapper .form-group select, .main-wrapper .form-group textarea,
.portal-content .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="range"]),
.portal-content .form-group select, .portal-content .form-group textarea {
    min-height: 40px;
    border: 1px solid var(--hrx-line-strong) !important;
    border-radius: var(--hrx-radius) !important;
    background-color: #FFFFFF !important;
    color: var(--hrx-ink) !important;
    font-size: 15px !important;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
}
textarea.form-control, .form-group textarea, textarea.modal-form-control, textarea.portal-form-control { min-height: 96px; }
.form-control:hover, .form-select:hover, .form-input:hover, .modal-form-control:hover, .portal-form-control:hover {
    border-color: var(--hrx-ink-4) !important;
}
.form-control:focus, .form-select:focus, .form-input:focus, .modal-form-control:focus, .portal-form-control:focus, .field-input:focus,
.main-wrapper .form-group input:focus, .main-wrapper .form-group select:focus, .main-wrapper .form-group textarea:focus,
.portal-content .form-group input:focus, .portal-content .form-group select:focus, .portal-content .form-group textarea:focus {
    border-color: var(--hrx-ink) !important;
    box-shadow: var(--hrx-focus) !important;
    outline: none !important;
}
.form-control:disabled, .form-control[readonly], .form-select:disabled, .form-input:disabled, .form-input[readonly] {
    background-color: var(--hrx-subtle) !important;
    color: var(--hrx-ink-3) !important;
}
::placeholder { color: var(--hrx-ink-4) !important; opacity: 1; }
.is-invalid, .form-control.is-invalid, .form-input.is-invalid { border-color: var(--hrx-danger) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .18) !important; }
.invalid-feedback, .form-error, .error-text { color: var(--hrx-danger) !important; font-size: 12.5px; }
.text-danger { color: var(--hrx-danger) !important; }
.form-hint, .form-helper, .hint, .form-text, .help-text { color: var(--hrx-ink-3) !important; font-size: 12.5px !important; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-blue); }
.toggle-slider { background-color: var(--hrx-line-strong); }
input:checked + .toggle-slider { background-color: var(--brand-blue) !important; }

/* --------------------------------------------------------------------------
   Tables (list view)
   -------------------------------------------------------------------------- */
.data-table, .table, .main-wrapper table, .portal-content table { border-collapse: collapse; }
.data-table thead th, .table thead th, .main-wrapper thead th, .portal-content thead th {
    background: var(--hrx-subtle) !important;
    color: var(--hrx-ink-2) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--hrx-line) !important;
    white-space: nowrap;
    vertical-align: middle;
}
.data-table tbody td, .table tbody td, .main-wrapper tbody td, .portal-content tbody td {
    border-bottom: 1px solid var(--hrx-line-soft);
    vertical-align: middle;
}
.data-table tbody tr:hover > td, .table tbody tr:hover > td, .main-wrapper tbody tr:hover > td {
    background: var(--hrx-subtle-2);
}
.table-responsive { border-radius: var(--hrx-radius-lg); }

/* --------------------------------------------------------------------------
   Status badges, alerts, tabs
   -------------------------------------------------------------------------- */
.badge, .status-badge, .portal-badge, .pill {
    border-radius: 999px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}
.alert {
    border-radius: var(--hrx-radius) !important;
    border: 1px solid var(--hrx-line);
    border-inline-start-width: 4px !important;
    box-shadow: none !important;
}
.alert-success { background: var(--hrx-success-bg) !important; border-color: var(--hrx-success-line) !important; border-inline-start-color: var(--hrx-success) !important; color: #1E3824 !important; }
.alert-danger, .alert-error { background: var(--hrx-danger-bg) !important; border-color: var(--hrx-danger-line) !important; border-inline-start-color: var(--hrx-danger) !important; color: #6E1710 !important; }
.alert-warning { background: var(--hrx-warning-bg) !important; border-color: var(--hrx-warning-line) !important; border-inline-start-color: #B54708 !important; color: #6A3505 !important; }
.alert-info { background: var(--hrx-info-bg) !important; border-color: var(--hrx-info-line) !important; border-inline-start-color: var(--hrx-info) !important; color: #163A68 !important; }
.filter-tab.active, .stage-tab.active, .main-tab.active { color: var(--hrx-ink) !important; }

/* --------------------------------------------------------------------------
   Dropdowns & modals
   -------------------------------------------------------------------------- */
.dropdown-menu, .header-notifications-panel, .header-search-suggest {
    border: 1px solid var(--hrx-line) !important;
    border-radius: var(--hrx-radius-lg) !important;
    box-shadow: var(--hrx-shadow-pop) !important;
}
.dropdown-item { border-radius: var(--hrx-radius-sm) !important; color: var(--hrx-ink-2); }
.dropdown-item:hover { background: var(--hrx-subtle) !important; color: var(--hrx-ink) !important; }

.modal-overlay { background: rgba(14, 15, 18, .45) !important; backdrop-filter: none !important; }
.modal-content, .modal-dialog .modal-content, .modal-box, .modal-card {
    border: 1px solid var(--hrx-line) !important;
    border-radius: 10px !important;
    box-shadow: var(--hrx-shadow-pop) !important;
}
.modal-header { border-bottom: 1px solid var(--hrx-line) !important; }
.modal-footer { border-top: 1px solid var(--hrx-line) !important; background: var(--hrx-subtle-2); }
.modal-close { border-radius: var(--hrx-radius) !important; }

/* Pagination */
nav[role="navigation"] a, nav[role="navigation"] span[aria-current] span, .pagination .page-link {
    border-radius: var(--hrx-radius) !important;
}
nav[role="navigation"] span[aria-current="page"] span, .pagination .active .page-link {
    background: var(--brand-blue) !important; border-color: var(--brand-blue) !important; color: #fff !important;
}

/* Empty states */
.empty-state { color: var(--hrx-ink-3); }
.empty-state i { color: var(--hrx-ink-4) !important; }

/* --------------------------------------------------------------------------
   Native <dialog> opened with showModal(): always in the middle of the
   screen over a dimmed page, whatever the page or module styles say.
   -------------------------------------------------------------------------- */
dialog:modal {
    position: fixed !important;
    inset: 0 !important;
    margin: auto !important;
    height: fit-content;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
}
dialog::backdrop { background: rgba(14, 15, 18, .45); }

/* --------------------------------------------------------------------------
   Confirmation dialog (classic: title row, message, actions at the end)
   -------------------------------------------------------------------------- */
.confirm-modal-overlay {
    background: rgba(14, 15, 18, .45) !important;
    backdrop-filter: none !important;
}
.confirm-modal {
    max-width: 460px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    text-align: start !important;
    border: 1px solid var(--hrx-line);
    box-shadow: var(--hrx-shadow-pop) !important;
    transform: translateY(8px) !important;
    transition: transform .18s ease, opacity .18s ease !important;
    overflow: hidden;
}
.confirm-modal-overlay.active .confirm-modal { transform: none !important; }
.confirm-modal-body {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: .25rem 1rem;
    padding: 1.4rem 1.5rem 1.25rem;
}
.confirm-modal-icon {
    width: 40px !important; height: 40px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    font-size: 1.15rem !important;
    grid-row: span 2;
}
.confirm-modal-icon.danger { background: var(--hrx-danger-bg) !important; color: var(--hrx-danger) !important; }
.confirm-modal-icon.warning { background: var(--hrx-warning-bg) !important; color: #B54708 !important; }
.confirm-modal-icon.info { background: var(--hrx-info-bg) !important; color: var(--hrx-info) !important; }
.confirm-modal-icon.success { background: var(--hrx-success-bg) !important; color: var(--hrx-success) !important; }
.confirm-modal-title {
    margin: .35rem 0 .2rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--hrx-ink) !important;
    font-family: var(--hrx-font-head) !important;
}
.confirm-modal-message {
    margin: 0 !important;
    font-size: 14px !important;
    color: var(--hrx-ink-3) !important;
    line-height: 1.6 !important;
}
.confirm-modal-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: .5rem !important;
    padding: .85rem 1.5rem !important;
    background: var(--hrx-subtle-2);
    border-top: 1px solid var(--hrx-line);
    margin: 0 !important;
}
.confirm-modal-actions .btn { flex: 0 0 auto !important; min-width: 96px; }
.confirm-modal-hint { grid-column: 2; margin-top: .6rem; font-size: 12px; color: var(--hrx-ink-4); }

/* ---- 05-structure.css ---- */
/* --------------------------------------------------------------------------
   Structure — control bar (breadcrumb row pinned under the header)
   -------------------------------------------------------------------------- */
.hrx-controlbar {
    position: sticky;
    top: var(--header-height, 64px);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 42px;
    margin: -1.5rem -1.5rem 1.25rem;
    padding: .45rem 1.5rem;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--hrx-line);
    backdrop-filter: saturate(1.2) blur(6px);
}
.hrx-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}
.hrx-crumbs li { display: inline-flex; align-items: center; gap: .25rem; color: var(--hrx-ink-3); }
.hrx-crumbs li + li::before { content: '/'; color: var(--hrx-ink-4); margin-inline: .35rem; }
.hrx-crumbs a { display: inline-flex; align-items: center; gap: .35rem; color: var(--hrx-ink-3) !important; text-decoration: none; }
.hrx-crumbs a:hover { color: var(--hrx-ink) !important; text-decoration: underline; }
.hrx-crumbs [aria-current="page"] { color: var(--hrx-ink); font-weight: 600; }
@media (max-width: 768px) { .hrx-controlbar { margin: -1rem -1rem 1rem; padding: .4rem 1rem; } }

/* --------------------------------------------------------------------------
   Structure — "sheet" forms on wide screens: label beside its field
   (classic ERP form layout). Narrow screens keep label above field.
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) {
    .main-content .form-group:has(> label.form-label:first-child):not(:has(> label.form-label:first-child input[type="checkbox"])):not(:has(> label.form-label:first-child input[type="radio"])) {
        display: grid;
        grid-template-columns: minmax(140px, 34%) minmax(0, 1fr);
        column-gap: 1rem;
        row-gap: .3rem;
        align-items: start;
    }
    .main-content .form-group:has(> label.form-label:first-child) > label.form-label:first-child {
        grid-column: 1;
        grid-row: 1 / span 3;
        margin: 0 !important;
        padding-top: .55rem;
        line-height: 1.45;
    }
    .main-content .form-group:has(> label.form-label:first-child) > :not(label.form-label:first-child) { grid-column: 2; min-width: 0; }
    .main-content .form-group.full-width:has(> textarea) { grid-template-columns: minmax(140px, 17%) minmax(0, 1fr); }

    /* Field widths follow what goes in them (as in Zoho Books), instead of every
       field filling its column: dates, times and numbers are short, choices are
       medium, names, emails and addresses keep the full width. A field can opt
       into a size with .field-s (220px), .field-m (260px) or .field-l (full). */
    .main-content .form-group input:is([type="date"], [type="time"], [type="month"], [type="week"], [type="number"]),
    .main-content .form-group .field-s { max-width: 220px; }
    .main-content .form-group select:not([multiple]),
    .main-content .form-group .field-m { max-width: 260px; }
    .main-content .form-group .field-l { max-width: none; }
}
.form-grid { row-gap: 1rem; }
.form-card-body, .card-body { padding: 1.25rem 1.5rem; }

/* Form footers: actions at the end, like an ERP sheet's button row. */
.form-actions, .form-footer, .form-card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hrx-line);
}

/* --------------------------------------------------------------------------
   Structure — list pages: filter row reads as one toolbar above the table
   -------------------------------------------------------------------------- */
.filters-bar, .filter-bar, .filters, .toolbar, .list-toolbar, .table-toolbar, .search-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .65rem .75rem;
    background: var(--hrx-subtle-2);
    border: 1px solid var(--hrx-line);
    border-radius: var(--hrx-radius-lg);
}
.filter-tab {
    border-radius: var(--hrx-radius) !important;
}
.filter-tab.active {
    background: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: #fff !important;
}


/* --------------------------------------------------------------------------
   Page header (<x-page.header>): breadcrumbs, one H1, short description,
   secondary actions then one primary action, optional tabs. Secondary actions
   fold into "More" on narrow containers; the primary action never truncates.
   -------------------------------------------------------------------------- */
.pg-head { container: pghead / inline-size; display: grid; gap: var(--space-2, 8px); margin-bottom: var(--space-5, 20px); }
.pg-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-1, 4px); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm, 13px); }
.pg-crumbs li { display: inline-flex; align-items: center; color: var(--text-subtle, #505258); }
.pg-crumbs li + li::before { content: "/"; margin-inline: var(--space-2, 8px); color: var(--text-subtlest, #6B6E76); }
.pg-crumbs a { color: var(--text-subtle, #505258) !important; text-decoration: none; }
.pg-crumbs a:hover { color: var(--brand-blue) !important; text-decoration: underline; }
.pg-crumbs [aria-current="page"] { color: var(--text, #292A2E); font-weight: var(--weight-medium, 500); }
.pg-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3, 12px) var(--space-6, 24px); flex-wrap: wrap; }
.pg-head-text { min-width: 0; flex: 1 1 320px; }
.pg-title { margin: 0; font-size: var(--text-2xl, 24px) !important; line-height: 1.25; font-weight: var(--weight-semibold, 600) !important; color: var(--text, #292A2E) !important; letter-spacing: -.01em; }
html[lang="ar"] .pg-title { letter-spacing: 0; }
.pg-desc { margin: var(--space-1, 4px) 0 0; font-size: var(--text-md, 14px); line-height: 1.5; color: var(--text-subtle, #505258); max-width: 72ch; }
.pg-actions { display: flex; align-items: center; gap: var(--space-2, 8px); flex-wrap: wrap; justify-content: flex-end; }
.pg-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-3, 12px);
    border-radius: var(--radius-md, 8px); font-size: var(--text-md, 14px); font-weight: var(--weight-medium, 500);
    white-space: nowrap; text-decoration: none !important; cursor: pointer; list-style: none;
}
.pg-btn::-webkit-details-marker { display: none; }
.pg-btn-primary { background: var(--brand-blue); color: #FFFFFF !important; border: 1px solid var(--brand-blue); }
.pg-btn-primary:hover { background: var(--brand-blue-dark); border-color: var(--brand-blue-dark); }
.pg-btn-secondary { background: var(--surface, #FFFFFF); color: var(--text, #292A2E) !important; border: 1px solid var(--border, #DDDEE1); }
.pg-btn-secondary:hover { background: var(--surface-hovered, #F0F1F2); }
.pg-btn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.pg-btn i { font-size: 15px; }
.pg-more { position: relative; display: none; }
.pg-more[open] > summary { background: var(--surface-hovered, #F0F1F2); }
.pg-more-menu {
    position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 60; min-width: 200px; padding: 6px 0;
    background: var(--surface, #FFFFFF); border-radius: var(--radius-md, 8px); box-shadow: var(--elev-2);
}
.pg-more-menu a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 16px; color: var(--text, #292A2E) !important; text-decoration: none !important; font-size: var(--text-md, 14px); }
.pg-more-menu a:hover, .pg-more-menu a:focus-visible { background: var(--surface-hovered, #F0F1F2); outline: none; }
.pg-tabs { display: flex; gap: var(--space-1, 4px); border-bottom: 1px solid var(--border, #DDDEE1); overflow-x: auto; }
@container pghead (max-width: 640px) {
    .pg-actions { width: 100%; justify-content: flex-start; }
    .pg-actions > .pg-btn-secondary { display: none; }
    .pg-more { display: block; }
    .pg-actions .pg-btn-primary { order: -1; }
}
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ---- 06-rtl.css ---- */
/* --------------------------------------------------------------------------
   Right-to-left (Arabic) mirroring
   -------------------------------------------------------------------------- */
[dir="rtl"] .sidebar { left: auto !important; right: 0 !important; }
[dir="rtl"] .main-header { left: 0 !important; right: 0 !important; }
@media (min-width: 1025px) {
    [dir="rtl"] .sidebar { right: var(--rail-width, 56px) !important; }
    [dir="rtl"] .main-header { right: calc(var(--rail-width, 56px) + var(--sidebar-width, 248px)) !important; }
    [dir="rtl"] .sidebar.collapsed ~ .main-wrapper .main-header { right: var(--rail-width, 56px) !important; }
}
[dir="rtl"] .portal-sidebar { left: auto !important; right: 0 !important; }
[dir="rtl"] .nav-link.active::before { left: auto !important; right: -0.5rem !important; border-radius: 4px 0 0 4px !important; }
[dir="rtl"] .portal-nav-link.active::before { left: auto !important; right: -0.875rem !important; }
[dir="rtl"] .rail-tip::before { left: auto; right: -5px; }
@media (max-width: 1024px) {
    [dir="rtl"] .sidebar:not(.active) { transform: translateX(100%) !important; }
    [dir="rtl"] .sidebar.active { box-shadow: -8px 0 24px rgba(30, 31, 33, .18) !important; }
    [dir="rtl"] .sidebar.active { transform: translateX(0) !important; }
    [dir="rtl"] .portal-sidebar:not(.open) { transform: translateX(100%) !important; }
    [dir="rtl"] .portal-sidebar.open { transform: translateX(0) !important; }
}
[dir="rtl"] .dropdown-menu:not(.dropdown-menu-start) { right: auto; left: 0; }
[dir="rtl"] .header-notifications-panel { right: auto !important; left: 0 !important; }
[dir="rtl"] .gs-panel { right: auto !important; left: 0 !important; }
[dir="rtl"] .gs-panel:not(.active) { transform: translateX(-100%) !important; }
[dir="rtl"] .header-search i, [dir="rtl"] .header-search .search-icon { left: auto; right: .875rem; }

/* Direction-bearing icons point the other way in Arabic. */
[dir="rtl"] .bi-arrow-left, [dir="rtl"] .bi-arrow-right,
[dir="rtl"] .bi-arrow-left-short, [dir="rtl"] .bi-arrow-right-short,
[dir="rtl"] .bi-chevron-left, [dir="rtl"] .bi-chevron-right,
[dir="rtl"] .bi-chevron-double-left, [dir="rtl"] .bi-chevron-double-right,
[dir="rtl"] .bi-caret-left, [dir="rtl"] .bi-caret-right,
[dir="rtl"] .bi-caret-left-fill, [dir="rtl"] .bi-caret-right-fill,
[dir="rtl"] .bi-arrow-left-circle, [dir="rtl"] .bi-arrow-right-circle,
[dir="rtl"] .bi-box-arrow-right, [dir="rtl"] .bi-box-arrow-left,
[dir="rtl"] .bi-box-arrow-in-right, [dir="rtl"] .bi-box-arrow-in-left,
[dir="rtl"] .bi-box-arrow-up-right, [dir="rtl"] .bi-arrow-up-right,
[dir="rtl"] .bi-arrow-return-left, [dir="rtl"] .bi-arrow-return-right,
[dir="rtl"] .bi-reply, [dir="rtl"] .bi-send, [dir="rtl"] .bi-send-fill,
[dir="rtl"] .bi-list-nested, [dir="rtl"] .bi-text-indent-left, [dir="rtl"] .bi-text-indent-right {
    display: inline-block;
    transform: scaleX(-1);
}

/* Alignment helpers */
[dir="rtl"] .text-end, [dir="rtl"] .text-right { text-align: left !important; }
[dir="rtl"] .text-start, [dir="rtl"] .text-left { text-align: right !important; }
/* Low specificity so page rules (e.g. centred day columns) still win. */
[dir="rtl"] :where(th) { text-align: start; }
[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .me-auto { margin-right: 0 !important; margin-left: auto !important; }
[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }

/* Latin-only values (email, phone, IBAN, codes) stay left-to-right. */
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="url"],
[dir="rtl"] input[type="number"], [dir="rtl"] input[name*="iban" i], [dir="rtl"] input[name*="email" i],
[dir="rtl"] input[name*="phone" i], [dir="rtl"] input[name*="mobile" i], [dir="rtl"] input[name*="code" i] {
    direction: ltr;
    text-align: right;
}
[dir="rtl"] input[type="email"]::placeholder, [dir="rtl"] input[type="tel"]::placeholder { text-align: right; }

/* ---- 07-print.css ---- */
/* --------------------------------------------------------------------------
   Print — plain black on white
   -------------------------------------------------------------------------- */
@media print {
    .sidebar, .main-header, .portal-sidebar, .portal-header, .hrx-lang-switch, .mobile-nav { display: none !important; }
    .main-wrapper { margin: 0 !important; }
    /* The rest of the app chrome, and the blank band left by the fixed top bar. */
    .app-rail, .hrx-modulebar, .hrx-controlbar, .main-footer, .skip-link,
    .gs-panel, .gs-panel-overlay, .nav-menu-pop, .overlay { display: none !important; }
    .main-wrapper { padding-top: 0 !important; }
    .main-content { padding: 0 !important; }
}

/* ---- 08-utilities.css ---- */
/* An Arabic label kept by the translator (its English twin was dropped). */
html body [data-hrx-keep] { display: revert !important; }

/* ---- 09-lists.css ---- */
/* ==========================================================================
   Lists (after Zoho Books)
   - Row selection: checkboxes added by js/03-list-select.js to any
     [data-list-select] list, and the bulk bar that replaces the list toolbar.
   - List page pieces: toolbar (views, search, filters) and the list table.
   - Split view: a narrow list beside a record's detail.
   ========================================================================== */

/* ---- Selection ---- */
.ls-cell { width: 44px !important; min-width: 44px; padding-inline: 14px 4px !important; text-align: start; cursor: pointer; }
.ls-cell input, .ls-check input, input.ls-all {
    width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer;
    accent-color: var(--brand-blue);
}
.ls-cell input:focus-visible, .ls-check input:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
table[data-list-select] tbody tr[data-ls-key] { cursor: pointer; }
table[data-list-select] tbody tr.is-selected > td { background: var(--brand-blue-tint) !important; }
[data-list-item].is-selected { background: var(--brand-blue-tint) !important; }

.ls-bar {
    position: sticky; top: calc(var(--sticky-top, 56px) + 8px); z-index: 40;
    display: flex; align-items: center; gap: var(--space-2, 8px); flex-wrap: wrap;
    min-height: 52px; padding: 8px 12px; margin-bottom: var(--space-2, 8px);
    background: var(--surface, #FFFFFF); border: 1px solid var(--border, #DDDEE1);
    border-radius: var(--radius-md, 8px); box-shadow: var(--elev-2);
}
.ls-bar[hidden] { display: none !important; }
.ls-bar-inline { position: static; margin: 0; box-shadow: none; border-radius: 0; border-width: 0 0 1px; min-height: 56px; }
.ls-actions { display: flex; align-items: center; gap: var(--space-2, 8px); flex-wrap: wrap; min-width: 0; }
.ls-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border: 1px solid var(--border, #DDDEE1); border-radius: var(--radius-sm, 4px);
    background: var(--surface, #FFFFFF); color: var(--text, #292A2E) !important;
    font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none !important;
}
.ls-btn:hover { background: var(--surface-hovered, #F0F1F2); }
.ls-btn:focus-visible, .ls-clear:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.ls-btn.is-danger { color: var(--status-danger, #C9372C) !important; }
.ls-count { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-subtle, #505258); white-space: nowrap; }
.ls-count b {
    min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center;
    border-radius: 999px; background: var(--brand-blue); color: #FFFFFF; font-size: 12px; font-weight: 600;
}
.ls-clear {
    width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--radius-md, 8px);
    background: transparent; color: var(--text-subtle, #505258); cursor: pointer;
}
.ls-clear:hover { background: var(--surface-hovered, #F0F1F2); color: var(--text, #292A2E); }
.ls-head-hidden { display: none !important; }

@media print {
    body.ls-printing .ls-print-target tbody tr:not(.is-selected) { display: none !important; }
    .ls-bar, .ls-cell { display: none !important; }
}

/* ---- List page: toolbar + table ---- */
.lst { container: lst / inline-size; min-width: 0; max-width: 100%; background: var(--surface, #FFFFFF); border: 1px solid var(--border, #DDDEE1); border-radius: var(--radius-lg, 12px); box-shadow: var(--elev-1); overflow: clip; }
.lst-toolbar {
    display: flex; align-items: center; gap: var(--space-2, 8px); flex-wrap: wrap;
    min-height: 56px; padding: 10px 12px; border-bottom: 1px solid var(--border, #DDDEE1);
}
.lst-views { display: flex; align-items: center; gap: 2px; margin-inline-end: auto; overflow-x: auto; scrollbar-width: none; }
.lst-view {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius-md, 8px);
    font-size: 14px; font-weight: 500; color: var(--text-subtle, #505258) !important; text-decoration: none !important; white-space: nowrap;
}
.lst-view:hover { background: var(--surface-hovered, #F0F1F2); color: var(--text, #292A2E) !important; }
.lst-view[aria-current="page"] { background: var(--brand-blue-tint); color: var(--brand-blue) !important; font-weight: 600; }
.lst-view em { font-style: normal; font-size: 12px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--surface-sunken, #F7F8F9); color: var(--text-subtle, #505258); }
.lst-view[aria-current="page"] em { background: #FFFFFF; color: var(--brand-blue); }
.lst-filters { display: flex; align-items: center; gap: var(--space-2, 8px); flex-wrap: wrap; }
.lst-search, .lst-select {
    display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; min-width: 0;
    border: 1px solid var(--border, #DDDEE1); border-radius: var(--radius-md, 8px); background: var(--surface, #FFFFFF);
}
.lst-search:focus-within, .lst-select:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 1px var(--brand-blue); }
.lst-search i, .lst-select i { color: var(--text-subtlest, #6B6E76); font-size: 14px; }
.lst-search input, .lst-select select {
    border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important;
    height: 34px; padding: 0 !important; font-size: 14px; color: var(--text, #292A2E); min-width: 0;
}
.lst-search { width: 240px; }
.lst-search input { width: 100%; }
.lst-select select { max-width: 170px; cursor: pointer; }
.lst-clear { font-size: 13px; font-weight: 500; color: var(--brand-blue) !important; text-decoration: none !important; padding: 0 6px; white-space: nowrap; }
.lst-clear:hover { text-decoration: underline !important; }

.lst-scroll { position: relative; overflow-x: auto; }
.lst-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lst-table th {
    height: 40px; padding: 0 12px; text-align: start; white-space: nowrap;
    font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-subtle, #505258);
    background: var(--surface-sunken, #F7F8F9); border-bottom: 1px solid var(--border, #DDDEE1);
}
.lst-table td { padding: 10px 12px; border-bottom: 1px solid var(--border, #DDDEE1); color: var(--text, #292A2E); vertical-align: middle; }
.lst-table tbody tr:last-child td { border-bottom: 0; }
.lst-table tbody tr:hover > td { background: var(--surface-sunken, #F7F8F9); }
.lst-table .lst-num { text-align: end; font-variant-numeric: tabular-nums; }
.lst-table .lst-muted { color: var(--text-subtle, #505258); }
.lst-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border, #DDDEE1); font-size: 13px; color: var(--text-subtle, #505258); }

@container lst (max-width: 760px) {
    .lst-views { width: 100%; margin-inline-end: 0; }
    .lst-filters { width: 100%; }
    .lst-search { flex: 1 1 100%; width: auto; }
    .lst-select { flex: 1 1 140px; }
    .lst-select select { max-width: none; width: 100%; }
    .lst-table .lst-hide-sm { display: none; }
}

/* ---- Split view: list beside detail ---- */
.split-wrap { container: split / inline-size; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--space-5, 20px); align-items: start; }
.split-list {
    position: sticky; top: calc(var(--topbar-height, 56px) + 56px);
    display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-height, 56px) - 80px);
    background: var(--surface, #FFFFFF); border: 1px solid var(--border, #DDDEE1); border-radius: var(--radius-lg, 12px); box-shadow: var(--elev-1);
    overflow: hidden; min-width: 0;
}
.split-head { display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border, #DDDEE1); }
.split-head .ls-all { flex: none; }
.split-view { position: relative; flex: 1 1 auto; min-width: 0; }
.split-view > summary {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%; list-style: none; cursor: pointer;
    font-size: 15px; font-weight: 600; color: var(--text, #292A2E); padding: 4px 6px; border-radius: var(--radius-sm, 4px);
}
.split-view > summary::-webkit-details-marker { display: none; }
.split-view > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-view > summary i { color: var(--brand-blue); font-size: 12px; }
.split-view > summary:hover { background: var(--surface-hovered, #F0F1F2); }
.split-menu {
    position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 60; min-width: 200px; padding: 6px 0;
    background: var(--surface, #FFFFFF); border-radius: var(--radius-md, 8px); box-shadow: var(--elev-2);
}
.split-menu a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; font-size: 14px; color: var(--text, #292A2E) !important; text-decoration: none !important; }
.split-menu a:hover { background: var(--surface-hovered, #F0F1F2); }
.split-menu a[aria-current="true"] { color: var(--brand-blue) !important; font-weight: 600; }
.split-menu em { font-style: normal; color: var(--text-subtlest, #6B6E76); font-size: 13px; }
.split-icon {
    flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border, #DDDEE1); background: var(--surface, #FFFFFF); color: var(--text, #292A2E) !important; text-decoration: none !important;
}
.split-icon:hover { background: var(--surface-hovered, #F0F1F2); }
.split-icon.is-primary { background: var(--brand-blue); border-color: var(--brand-blue); color: #FFFFFF !important; }
.split-icon.is-primary:hover { background: var(--brand-blue-dark); }
.split-search { padding: 8px 10px; border-bottom: 1px solid var(--border, #DDDEE1); }
.split-search input {
    width: 100%; height: 32px; padding: 0 10px !important; font-size: 13px;
    border: 1px solid var(--border, #DDDEE1) !important; border-radius: var(--radius-md, 8px) !important; background: var(--surface-sunken, #F7F8F9) !important;
}
.split-search input:focus { outline: 0; border-color: var(--brand-blue) !important; background: #FFFFFF !important; }
.split-items { position: relative; flex: 1 1 auto; overflow-y: auto; margin: 0; padding: 0; list-style: none; overscroll-behavior: contain; }
.split-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--border, #DDDEE1); }
.split-item .ls-check { flex: none; padding-top: 2px; }
.split-item:hover { background: var(--surface-sunken, #F7F8F9); }
.split-item.is-current { background: var(--surface-hovered, #F0F1F2); box-shadow: inset 3px 0 0 var(--brand-blue); }
[dir="rtl"] .split-item.is-current { box-shadow: inset -3px 0 0 var(--brand-blue); }
.split-link { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-decoration: none !important; color: inherit !important; }
.split-title { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text, #292A2E); }
.split-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-title em { flex: none; font-style: normal; font-size: 12px; color: var(--text-subtlest, #6B6E76); font-weight: 400; }
.split-sub { font-size: 12.5px; color: var(--text-subtle, #505258); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-sub .split-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 4px; vertical-align: 1px; background: var(--status-neutral, #8C8F97); }
.split-dot.is-success { background: var(--status-success, #22A06B); }
.split-dot.is-warning { background: var(--status-warning, #C2700F); }
.split-dot.is-danger { background: var(--status-danger, #C9372C); }
.split-empty { padding: 24px 14px; font-size: 13px; color: var(--text-subtle, #505258); text-align: center; }
.split-detail { min-width: 0; container: splitdetail / inline-size; }
.split-list .ls-bar-inline { min-height: 56px; padding: 8px 10px; }

/* Narrow content area: the detail takes the full width, the list goes away. */
@container split (max-width: 900px) {
    .split { grid-template-columns: minmax(0, 1fr); }
    .split-list { display: none; }
}
.split-item[hidden] { display: none !important; }

/* Bulk delete: icon button in the bar, and the result note after reload. */
.ls-btn-icon { width: 32px; padding: 0; justify-content: center; }
.ls-btn.is-danger:hover { background: var(--status-danger-bg, #FFECEB); border-color: var(--status-danger, #C9372C); }
.ls-btn:disabled { opacity: .5; cursor: progress; }
.ls-toast {
    position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 2000;
    display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-md, 8px);
    background: #1F2124; color: #FFFFFF; font-size: 14px; box-shadow: var(--elev-2);
}
[dir="rtl"] .ls-toast { transform: translateX(50%); }
.ls-toast i { color: #6CC69A; }
.ls-toast.is-warning i { color: #F5B73B; }

/* Icon-only delete keeps its label for screen readers and the compact menu. */
.ls-btn-icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Compact bulk bar (split list, after Zoho Books):
   [select all] [Bulk actions ▾] | (n) Selected  ✕ */
.ls-bar-compact { flex-wrap: nowrap; gap: 10px; padding: 8px 10px 8px 14px; }
.ls-bar-all { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--brand-blue); cursor: pointer; }
.ls-menu { position: relative; flex: none; }
.ls-menu > summary { list-style: none; }
.ls-menu > summary::-webkit-details-marker { display: none; }
.ls-menu > summary i { font-size: 11px; color: var(--text-subtle, #505258); }
.ls-menu[open] > summary { background: var(--surface-hovered, #F0F1F2); }
.ls-menu-list {
    position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 70; min-width: 190px;
    display: flex; flex-direction: column; align-items: stretch; gap: 0; flex-wrap: nowrap; padding: 6px 0;
    background: var(--surface, #FFFFFF); border-radius: var(--radius-md, 8px); box-shadow: var(--elev-2);
}
.ls-menu-list .ls-btn {
    width: 100%; height: 36px; padding: 0 14px; border: 0; border-radius: 0; justify-content: flex-start; gap: 10px; font-size: 14px;
}
.ls-menu-list .ls-btn-icon span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.ls-menu-list .ls-btn.is-danger { border-top: 1px solid var(--border, #DDDEE1); margin-top: 4px; padding-top: 4px; height: 40px; }
.ls-menu-list .ls-btn.is-danger:hover { background: var(--status-danger-bg, #FFECEB); }
.ls-bar-compact .ls-count {
    margin-inline-start: 0; padding-inline-start: 10px; border-inline-start: 1px solid var(--border, #DDDEE1);
    flex: 1 1 auto; font-size: 14px; color: var(--text, #292A2E);
}
.ls-bar-compact .ls-count b { background: var(--brand-blue-tint); color: var(--brand-blue); }
.ls-bar-compact .ls-clear { color: var(--status-danger, #C9372C); }
.ls-bar-compact .ls-clear:hover { background: var(--status-danger-bg, #FFECEB); color: var(--status-danger, #C9372C); }

/* Split list items: name and ID, a muted second line, then the status in small caps. */
.split-item { padding: 12px 12px 12px 14px; }
.split-title { font-weight: 600; font-size: 14px; }
.split-title em { font-weight: 500; font-size: 12.5px; color: var(--text-subtle, #505258); }
.split-sub { margin-top: 1px; }
.split-status { margin-top: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle, #505258); }
.split-status.is-success { color: var(--status-success, #1F845A); }
.split-status.is-warning { color: var(--status-warning, #A54800); }
.split-status.is-danger { color: var(--status-danger, #C9372C); }
.split-item.is-selected { box-shadow: none; }
.split-item.is-current.is-selected { box-shadow: inset 3px 0 0 var(--brand-blue); }
[dir="rtl"] .split-item.is-current.is-selected { box-shadow: inset -3px 0 0 var(--brand-blue); }

/* Close (✕) at the top end of a record opened beside its list: back to the full list. */
.split-close {
    flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-md, 8px);
    color: var(--status-danger, #C9372C) !important; text-decoration: none !important; font-size: 18px;
}
.split-close:hover { background: var(--status-danger-bg, #FFECEB); }
.split-close:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* In-place navigation (js/04-soft-nav.js): thin progress line under the top edge. */
.soft-progress {
    position: fixed; top: 0; inset-inline: 0; z-index: 3000; height: 2px; pointer-events: none;
    background: var(--brand-blue); transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
}
[dir="rtl"] .soft-progress { transform-origin: 100% 50%; }
.soft-progress.is-on { opacity: 1; animation: soft-progress 2.5s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes soft-progress { from { transform: scaleX(0); } to { transform: scaleX(.85); } }
@media (prefers-reduced-motion: reduce) { .soft-progress.is-on { animation: none; transform: scaleX(.6); } }

/* --------------------------------------------------------------------------
   Split view v2 (after Zoho Books): two full-height panes, flush with the
   content edges. The page itself doesn't scroll; the list and the record
   each scroll on their own, and the record header stays put.
   --split-h is set by the split component from the space below the bars.
   -------------------------------------------------------------------------- */
.main-content:has(.split-wrap) { padding-bottom: 0 !important; }
.main-content:has(.split-wrap) .hrx-controlbar { display: none !important; }
body:has(.split-wrap) .main-footer { display: none !important; }
.split-wrap {
    margin-inline: calc(-1 * var(--content-pad)); margin-top: calc(-1 * var(--content-pad));
    height: var(--split-h, calc(100vh - var(--topbar-height, 56px) - 48px));
}
.hrx-modulebar ~ .split-wrap, .hrx-modulebar ~ * .split-wrap { margin-top: 0; }
.split { height: 100%; gap: 0; grid-template-columns: 360px minmax(0, 1fr); }
.split-list {
    position: static; height: 100%; max-height: none;
    border: 0; border-inline-end: 1px solid var(--border, #DDDEE1); border-radius: 0; box-shadow: none;
}
.split-detail {
    height: 100%; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 var(--content-pad) var(--content-pad); background: var(--surface-sunken, #F7F8F9);
}
@container split (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.ls-esc { font: 500 11px/1 inherit; font-family: inherit; padding: 3px 5px; border: 1px solid var(--border, #DDDEE1); border-radius: 4px; color: var(--text-subtlest, #6B6E76); background: var(--surface-sunken, #F7F8F9); }
.split-detail:focus { outline: none; }
