:root {
    --erp-font-family: "Inter", "Segoe UI", Tahoma, Arial, sans-serif;
    --erp-font-size-sm: .875rem;
    --erp-font-size-md: .95rem;
    --erp-font-size-lg: 1.125rem;
    --erp-font-size-xl: 1.5rem;
    --erp-space-1: .25rem;
    --erp-space-2: .5rem;
    --erp-space-3: .75rem;
    --erp-space-4: 1rem;
    --erp-space-5: 1.25rem;
    --erp-space-6: 1.5rem;
    --erp-space-8: 2rem;
    --erp-radius-sm: 6px;
    --erp-radius-md: 8px;
    --erp-radius-lg: 12px;
    --erp-radius-xl: 16px;
    --erp-sidebar-width: 320px;
    --erp-topbar-height: 64px;
    --erp-transition-fast: 150ms ease;
    --erp-transition-base: 220ms ease;
    --erp-primary: #2563eb;
    --erp-primary-rgb: 37, 99, 235;
    --erp-primary-hover: #1d4ed8;
    --erp-primary-soft: #eff6ff;
    --erp-primary-contrast: #fff;
    --erp-secondary: #64748b;
    --erp-success: #16a34a;
    --erp-warning: #f59e0b;
    --erp-danger: #dc2626;
    --erp-info: #0891b2;
    --erp-bg: #f5f7fb;
    --erp-bg-subtle: #f8fafc;
    --erp-surface: #fff;
    --erp-surface-muted: #f8fafc;
    --erp-text: #111827;
    --erp-text-muted: #64748b;
    --erp-text-soft: #94a3b8;
    --erp-border: #e2e8f0;
    --erp-border-strong: #cbd5e1;
    --erp-focus-ring: rgba(var(--erp-primary-rgb), .24);
    --erp-shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --erp-shadow-sm: 0 8px 20px rgba(15, 23, 42, .07);
    --erp-shadow-md: 0 16px 36px rgba(15, 23, 42, .1);
    --erp-auth-shadow: 0 24px 60px rgba(15, 23, 42, .12);
    --erp-auth-panel-width: 440px;
    --erp-sidebar-bg: #0f172a;
    --erp-sidebar-bg-soft: rgba(255, 255, 255, .08);
    --erp-sidebar-border: rgba(255, 255, 255, .1);
    --erp-sidebar-text: rgba(255, 255, 255, .78);
    --erp-sidebar-muted: rgba(255, 255, 255, .58);
    --primary: var(--erp-primary);
    --primary-hover: var(--erp-primary-hover);
    --primary-soft: var(--erp-primary-soft);
    --secondary: var(--erp-secondary);
    --surface: var(--erp-surface);
    --surface-elevated: #fff;
    --surface-hover: var(--erp-surface-muted);
    --surface-2: var(--erp-surface-muted);
    --background: var(--erp-bg);
    --text-primary: var(--erp-text);
    --text-secondary: var(--erp-text-muted);
    --text-muted: var(--erp-text-soft);
    --border: var(--erp-border);
    --border-hover: var(--erp-border-strong);
    --success: var(--erp-success);
    --warning: var(--erp-warning);
    --danger: var(--erp-danger);
}

:root[data-color-scheme="emerald"] {
    --erp-primary: #059669;
    --erp-primary-rgb: 5, 150, 105;
    --erp-primary-hover: #047857;
    --erp-primary-soft: #ecfdf5;
}

:root[data-color-scheme="purple"] {
    --erp-primary: #7c3aed;
    --erp-primary-rgb: 124, 58, 237;
    --erp-primary-hover: #6d28d9;
    --erp-primary-soft: #f5f3ff;
}

:root[data-color-scheme="orange"] {
    --erp-primary: #ea580c;
    --erp-primary-rgb: 234, 88, 12;
    --erp-primary-hover: #c2410c;
    --erp-primary-soft: #fff7ed;
}

:root[data-color-scheme="slate"] {
    --erp-primary: #334155;
    --erp-primary-rgb: 51, 65, 85;
    --erp-primary-hover: #1e293b;
    --erp-primary-soft: #f1f5f9;
    --erp-sidebar-bg: #111827;
}

:root[data-theme-mode="dark"] {
    --erp-bg: #0b1120;
    --erp-bg-subtle: #111827;
    --erp-surface: #111827;
    --erp-surface-muted: #0f172a;
    --erp-text: #e5e7eb;
    --erp-text-muted: #a3aab8;
    --erp-text-soft: #737d91;
    --erp-border: #263244;
    --erp-border-strong: #334155;
    --erp-primary-soft: rgba(var(--erp-primary-rgb), .14);
    --erp-shadow-xs: 0 1px 2px rgba(0, 0, 0, .18);
    --erp-shadow-sm: 0 10px 24px rgba(0, 0, 0, .22);
    --erp-shadow-md: 0 18px 44px rgba(0, 0, 0, .3);
    --erp-auth-shadow: 0 24px 70px rgba(0, 0, 0, .36);
    --surface-elevated: #172033;
    --surface-hover: #1d293d;
}

.auth-surface {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--erp-radius-xl);
    box-shadow: var(--erp-auth-shadow);
    color: var(--text-primary);
}

.auth-control {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--erp-radius-lg);
    color: var(--text-primary);
    min-height: 52px;
    transition: border-color var(--erp-transition-fast), box-shadow var(--erp-transition-fast), background var(--erp-transition-fast);
}

.auth-control:focus-within,
.auth-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--erp-focus-ring);
}

.auth-primary-action {
    background: var(--primary);
    border: 0;
    border-radius: var(--erp-radius-lg);
    color: var(--erp-primary-contrast);
    min-height: 52px;
    transition: background var(--erp-transition-fast), box-shadow var(--erp-transition-fast), transform var(--erp-transition-fast);
}

.auth-primary-action:hover,
.auth-primary-action:focus-visible {
    background: var(--primary-hover);
    box-shadow: 0 14px 28px rgba(var(--erp-primary-rgb), .22);
}

.auth-primary-action:disabled {
    cursor: not-allowed;
    opacity: .72;
}

body {
    background: var(--erp-bg);
    color: var(--erp-text);
    font-family: var(--erp-font-family);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.erp-shell {
    background: var(--erp-bg);
    color: var(--erp-text);
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.erp-main {
    background:
        radial-gradient(circle at top left, rgba(var(--erp-primary-rgb), .08), transparent 28rem),
        var(--erp-bg);
    color: var(--erp-text);
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding: var(--erp-space-6);
    width: 100%;
}

[dir="rtl"] .erp-main {
    background:
        radial-gradient(circle at top right, rgba(var(--erp-primary-rgb), .08), transparent 28rem),
        var(--erp-bg);
}

.erp-page {
    max-width: 1400px;
    width: 100%;
}

.erp-topbar {
    align-items: center;
    min-height: var(--erp-topbar-height);
    height: var(--erp-topbar-height);
    background: color-mix(in srgb, var(--erp-surface) 94%, transparent);
    border-bottom: 1px solid var(--erp-border);
    box-shadow: var(--erp-shadow-xs);
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-3);
    max-width: 100%;
    min-width: 0;
    padding-block: 0;
    padding-inline: var(--erp-space-4);
    width: 100%;
}

.erp-topbar-title {
    color: var(--erp-text);
    display: block;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-icon-btn {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    color: var(--erp-text);
    display: inline-flex;
    gap: .45rem;
    min-height: 38px;
    justify-content: center;
}

.erp-icon-btn:hover,
.erp-icon-btn:focus {
    background: var(--erp-primary-soft);
    border-color: rgba(var(--erp-primary-rgb), .35);
    color: var(--erp-primary);
}

.erp-page-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-4);
    justify-content: space-between;
    margin-bottom: var(--erp-space-6);
}

.erp-page-kicker {
    color: var(--erp-primary);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: var(--erp-space-1);
    text-transform: uppercase;
}

.erp-page-title {
    color: var(--erp-text);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.erp-page-title-icon {
    margin-inline-end: var(--erp-space-3);
    vertical-align: -0.05em;
}

.erp-page-subtitle {
    color: var(--erp-text-muted);
    margin-top: var(--erp-space-1);
}

.erp-card,
.card {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border) !important;
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    color: var(--erp-text);
}

.erp-card-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-3);
    justify-content: space-between;
    padding: var(--erp-space-5) var(--erp-space-5) 0;
}

.erp-card-title,
.erp-section-title {
    color: var(--erp-text);
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.erp-card-subtitle,
.erp-section-subtitle {
    color: var(--erp-text-muted);
    font-size: var(--erp-font-size-sm);
    margin-top: var(--erp-space-1);
}

.erp-card-body {
    padding: var(--erp-space-5);
}

.erp-stat-card {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-inline-start: 4px solid var(--erp-primary);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    display: flex;
    gap: var(--erp-space-4);
    min-height: 92px;
    padding: var(--erp-space-4);
}

.erp-stat-action {
    cursor: pointer;
    text-align: start;
    transition: background var(--erp-transition-fast), border-color var(--erp-transition-fast), transform var(--erp-transition-fast);
    width: 100%;
}

.erp-stat-action:hover,
.erp-stat-action:focus {
    background: color-mix(in srgb, var(--erp-primary-soft) 38%, var(--erp-surface));
    border-color: color-mix(in srgb, var(--erp-primary) 28%, var(--erp-border));
    color: var(--erp-text);
}

.erp-stat-action:hover {
    transform: translateY(-1px);
}

.erp-stat-icon {
    align-items: center;
    background: var(--erp-primary-soft);
    border-radius: var(--erp-radius-md);
    color: var(--erp-primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.35rem;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.erp-stat-label {
    color: var(--erp-text-muted);
    font-size: var(--erp-font-size-sm);
}

.erp-stat-value {
    color: var(--erp-text);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.erp-filter-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-3);
    justify-content: space-between;
}

.erp-filter-search {
    max-width: 420px;
    width: 100%;
}

.erp-page-size-select {
    min-width: 88px;
    width: auto;
}

.erp-table-wrap {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    overflow: auto;
}

.erp-table,
.table {
    color: var(--erp-text);
}

.erp-table thead th,
.table thead th {
    background: var(--erp-surface-muted);
    color: var(--erp-text-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.erp-table tbody tr:hover,
.table tbody tr:hover {
    background: var(--erp-primary-soft);
}

.form-control,
.form-select {
    background-color: var(--erp-surface);
    border-color: var(--erp-border);
    border-radius: var(--erp-radius-md);
    color: var(--erp-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 .2rem var(--erp-focus-ring);
}

.form-label {
    color: var(--erp-text);
    font-weight: 700;
}

.text-muted {
    color: var(--erp-text-muted) !important;
}

.btn {
    border-radius: var(--erp-radius-md);
    font-weight: 700;
}

.erp-row-action,
.branch-action,
.org-action,
.employee-action,
.employee-lookup-action,
.shift-action {
    align-items: center;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 36px;
}

.erp-row-action i,
.branch-action i,
.org-action i,
.employee-action i,
.employee-lookup-action i,
.shift-action i {
    margin: 0;
}

.btn-primary {
    --bs-btn-bg: var(--erp-primary);
    --bs-btn-border-color: var(--erp-primary);
    --bs-btn-hover-bg: var(--erp-primary-hover);
    --bs-btn-hover-border-color: var(--erp-primary-hover);
    --bs-btn-active-bg: var(--erp-primary-hover);
    --bs-btn-active-border-color: var(--erp-primary-hover);
}

.btn-outline-primary {
    --bs-btn-color: var(--erp-primary);
    --bs-btn-border-color: rgba(var(--erp-primary-rgb), .5);
    --bs-btn-hover-bg: var(--erp-primary);
    --bs-btn-hover-border-color: var(--erp-primary);
}

.badge.text-bg-primary {
    background-color: var(--erp-primary) !important;
}

.badge.text-bg-light {
    background: var(--erp-surface-muted) !important;
    border: 1px solid var(--erp-border);
    color: var(--erp-text-muted) !important;
}

.erp-empty-state {
    align-items: center;
    color: var(--erp-text-muted);
    display: grid;
    justify-items: center;
    padding: var(--erp-space-8);
    text-align: center;
}

.erp-empty-icon {
    align-items: center;
    background: var(--erp-primary-soft);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-primary);
    display: inline-flex;
    font-size: 1.75rem;
    height: 56px;
    justify-content: center;
    margin-bottom: var(--erp-space-3);
    width: 56px;
}

.erp-loading {
    align-items: center;
    color: var(--erp-text-muted);
    display: grid;
    justify-items: center;
    padding: var(--erp-space-8);
    text-align: center;
}

.validation-message {
    color: var(--erp-danger);
    font-size: var(--erp-font-size-sm);
    margin-top: var(--erp-space-1);
}

.modal-content {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text);
}

.theme-selector {
    min-width: 160px;
}

.theme-selector .form-select,
.theme-selector .btn {
    min-height: 38px;
}

[dir="rtl"] .erp-stat-card {
    border-inline-start: 1px solid var(--erp-border);
    border-inline-end: 4px solid var(--erp-primary);
}

@media (max-width: 767.98px) {
    .erp-main {
        padding: var(--erp-space-4);
    }

    .erp-page-title {
        font-size: 1.3rem;
    }

    .erp-card-body {
        padding: var(--erp-space-4);
    }
}

.app-sidebar {
    width: var(--erp-sidebar-width);
    min-width: var(--erp-sidebar-width);
    max-width: var(--erp-sidebar-width);
    flex: 0 0 var(--erp-sidebar-width);
    height: 100vh;
    background: var(--erp-sidebar-bg);
    border-inline-end: 1px solid var(--erp-sidebar-border);
    padding: var(--erp-space-4) var(--erp-space-3);
    overflow: hidden;
    transition: width var(--erp-transition-base), min-width var(--erp-transition-base), max-width var(--erp-transition-base), flex-basis var(--erp-transition-base), transform var(--erp-transition-base);
}

.sidebar-collapsed .app-sidebar,
.app-sidebar.is-collapsed {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    flex-basis: 76px;
    padding-inline: var(--erp-space-2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--erp-space-3);
    padding: .35rem .45rem .9rem;
    border-bottom: 1px solid var(--erp-sidebar-border);
    margin-bottom: var(--erp-space-3);
    min-width: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--erp-radius-md);
    background: var(--erp-primary);
    color: var(--erp-primary-contrast);
    flex: 0 0 auto;
}

.brand-title {
    font-weight: 800;
    line-height: 1.1;
}

.brand-subtitle,
.user-meta {
    color: var(--erp-sidebar-muted);
    font-size: .76rem;
    line-height: 1.2;
}

.sidebar-collapse-btn {
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--erp-sidebar-border);
    border-radius: var(--erp-radius-md);
    color: var(--erp-sidebar-text);
    background: var(--erp-sidebar-bg-soft);
    margin-inline-start: auto;
    flex: 0 0 auto;
}

.sidebar-collapse-btn:hover,
.logout-btn:hover,
.search-clear:hover {
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.sidebar-search {
    position: relative;
    margin-bottom: var(--erp-space-3);
}

.sidebar-search > .bi {
    position: absolute;
    inset-inline-start: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--erp-sidebar-muted);
    pointer-events: none;
}

.sidebar-search .form-control {
    height: 38px;
    border-radius: var(--erp-radius-md);
    border: 1px solid var(--erp-sidebar-border);
    background: var(--erp-sidebar-bg-soft);
    color: #fff;
    padding-inline-start: 2.25rem;
    padding-inline-end: 2rem;
    font-size: .9rem;
}

.sidebar-search .form-control::placeholder {
    color: var(--erp-sidebar-muted);
}

.search-clear {
    position: absolute;
    inset-inline-end: .25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--erp-sidebar-text);
    border: 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-inline-end: .2rem;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
}

.sidebar-menu {
    gap: .18rem;
}

.sidebar-section-label {
    color: var(--erp-sidebar-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    list-style: none;
    padding: .8rem .65rem .28rem;
    text-transform: uppercase;
}

.sidebar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--erp-space-2);
    min-height: 120px;
    color: var(--erp-sidebar-muted);
    font-size: .9rem;
    text-align: center;
}

.sidebar-node {
    margin: .08rem 0;
}

.sidebar-node.parent-active {
    padding-block: .08rem;
}

.sidebar-link {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    border: 0;
    border-radius: var(--erp-radius-md);
    padding: .58rem .65rem;
    color: var(--erp-sidebar-text);
    background: transparent;
    text-decoration: none;
    text-align: start;
    transition: background-color var(--erp-transition-fast), color var(--erp-transition-fast);
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.sidebar-link.is-active {
    color: #fff;
    background: var(--erp-primary);
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, .62);
}

[dir="rtl"] .sidebar-link.is-active {
    box-shadow: inset -3px 0 0 rgba(255, 255, 255, .62);
}

.sidebar-link.is-parent-active {
    color: #fff;
    background: rgba(var(--erp-primary-rgb), .1);
    box-shadow: inset 2px 0 0 rgba(var(--erp-primary-rgb), .48);
}

[dir="rtl"] .sidebar-link.is-parent-active {
    box-shadow: inset -2px 0 0 rgba(var(--erp-primary-rgb), .48);
}

.sidebar-link.is-open:not(.is-parent-active) {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.sidebar-link-main {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.sidebar-link-icon {
    width: 1.1rem;
    text-align: center;
    color: var(--erp-sidebar-text);
    flex: 0 0 auto;
}

.sidebar-link.is-active .sidebar-link-icon,
.sidebar-link.is-parent-active .sidebar-link-icon,
.sidebar-link:hover .sidebar-link-icon {
    color: #fff;
}

.sidebar-link-copy {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.sidebar-link-text,
.sidebar-link-context,
.user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link-text {
    font-size: .92rem;
    line-height: 1.2;
}

.sidebar-link-context {
    color: var(--erp-sidebar-muted);
    font-size: .72rem;
    line-height: 1.1;
}

.sidebar-link-trailing {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex: 0 0 auto;
}

.sidebar-chevron {
    color: rgba(255, 255, 255, .5);
    font-size: .78rem;
}

.sidebar-submenu {
    position: relative;
    margin: .16rem 0 .28rem;
    padding-inline-start: .8rem;
    gap: .12rem;
}

.sidebar-submenu::before {
    content: "";
    position: absolute;
    inset-block: .25rem;
    inset-inline-start: .2rem;
    width: 1px;
    background: rgba(255, 255, 255, .12);
}

.sidebar-submenu .sidebar-link {
    min-height: 36px;
    padding: .5rem .6rem;
    color: rgba(255, 255, 255, .68);
}

.sidebar-submenu .sidebar-link-text {
    font-size: .86rem;
}

.sidebar-submenu .sidebar-submenu {
    padding-inline-start: .7rem;
    margin-block: .12rem;
}

.sidebar-link .badge {
    font-size: .68rem;
    line-height: 1;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: var(--erp-space-2);
    border-top: 1px solid var(--erp-sidebar-border);
    padding-top: var(--erp-space-3);
    margin-top: var(--erp-space-3);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    flex: 1 1 auto;
}

.user-avatar,
.topbar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--erp-radius-md);
    font-weight: 800;
    flex: 0 0 auto;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--erp-sidebar-bg-soft);
    font-size: .78rem;
}

.user-name {
    font-size: .9rem;
    font-weight: 700;
}

.logout-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--erp-radius-md);
    color: var(--erp-sidebar-text);
    background: var(--erp-sidebar-bg-soft);
    flex: 0 0 auto;
}

.app-sidebar.is-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
}

.app-sidebar.is-collapsed .sidebar-brand-copy,
.app-sidebar.is-collapsed .sidebar-search input,
.app-sidebar.is-collapsed .search-clear,
.app-sidebar.is-collapsed .sidebar-section-label,
.app-sidebar.is-collapsed .sidebar-link-copy,
.app-sidebar.is-collapsed .sidebar-link-trailing,
.app-sidebar.is-collapsed .sidebar-user-copy {
    display: none;
}

.app-sidebar.is-collapsed .sidebar-search {
    height: 38px;
    border: 1px solid var(--erp-sidebar-border);
    border-radius: var(--erp-radius-md);
    background: var(--erp-sidebar-bg-soft);
}

.app-sidebar.is-collapsed .sidebar-search > .bi {
    inset-inline-start: 50%;
    transform: translate(-50%, -50%);
}

[dir="rtl"] .app-sidebar.is-collapsed .sidebar-search > .bi {
    transform: translate(50%, -50%);
}

.app-sidebar.is-collapsed .sidebar-link {
    justify-content: center;
    padding-inline: 0;
}

.app-sidebar.is-collapsed .sidebar-link-main {
    justify-content: center;
}

.app-sidebar.is-collapsed .sidebar-link-icon {
    width: auto;
    font-size: 1.05rem;
}

.app-sidebar.is-collapsed .sidebar-footer {
    justify-content: center;
}

.app-sidebar.is-collapsed .user-chip {
    flex: 0 0 auto;
}

.app-sidebar.is-collapsed .logout-btn {
    display: none;
}

.topbar-context {
    gap: var(--erp-space-3);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.topbar-page-context {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: var(--erp-space-2);
    min-width: 0;
    white-space: nowrap;
}

.topbar-actions .erp-icon-btn,
.topbar-actions .theme-selector,
.topbar-actions .form-select {
    min-height: 36px;
}

.topbar-actions .erp-icon-btn {
    height: 36px;
    min-width: 36px;
    padding-block: 0;
    padding-inline: var(--erp-space-2);
}

.mobile-workspace-switcher {
    flex: 0 1 240px;
    max-width: min(58vw, 260px);
    min-width: 0;
    position: relative;
}

.mobile-workspace-trigger {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-2);
    min-height: 44px;
    min-width: 0;
    padding: var(--erp-space-1) var(--erp-space-2);
    text-align: start;
    width: 100%;
}

.mobile-workspace-trigger:hover,
.mobile-workspace-trigger:focus {
    background: var(--erp-primary-soft);
    border-color: rgba(var(--erp-primary-rgb), .32);
    color: var(--erp-primary);
}

.mobile-workspace-icon,
.mobile-workspace-option-icon {
    align-items: center;
    background: var(--erp-primary-soft);
    border-radius: var(--erp-radius-md);
    color: var(--erp-primary);
    display: inline-flex;
    flex: 0 0 32px;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.mobile-workspace-copy,
.mobile-workspace-option span {
    display: grid;
    min-width: 0;
}

.mobile-workspace-copy small,
.mobile-workspace-option small {
    color: var(--erp-text-muted);
    font-size: .68rem;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-workspace-copy strong,
.mobile-workspace-option strong {
    color: inherit;
    font-size: .86rem;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-workspace-chevron {
    color: var(--erp-text-muted);
    flex: 0 0 auto;
    font-size: .8rem;
    margin-inline-start: auto;
}

.mobile-workspace-backdrop {
    inset: 0;
    position: fixed;
    z-index: 1045;
}

.mobile-workspace-menu {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-xl);
    box-shadow: var(--erp-shadow-lg);
    display: grid;
    gap: var(--erp-space-2);
    inset-inline: var(--erp-space-2);
    max-height: min(70vh, 420px);
    min-width: 0;
    overflow-y: auto;
    padding: var(--erp-space-2);
    position: fixed;
    top: calc(var(--erp-topbar-height) + var(--erp-space-2));
    z-index: 1055;
}

.mobile-workspace-option {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-3);
    min-height: 56px;
    min-width: 0;
    padding: var(--erp-space-2);
    text-align: start;
}

.mobile-workspace-option:hover,
.mobile-workspace-option:focus,
.mobile-workspace-option.is-active {
    background: var(--erp-primary-soft);
    border-color: rgba(var(--erp-primary-rgb), .24);
    color: var(--erp-primary);
}

.mobile-workspace-option > .bi-check2 {
    margin-inline-start: auto;
}

.topbar-breadcrumb {
    align-items: center;
    color: var(--erp-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    list-style: none;
    margin: .12rem 0 0;
    min-width: 0;
    padding: 0;
    font-size: .78rem;
}

.topbar-breadcrumb li {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-breadcrumb li:not(:last-child)::after {
    content: "/";
    color: var(--erp-text-soft);
    margin-inline-start: .35rem;
}

.topbar-user-button {
    height: 36px;
    max-width: 220px;
    min-width: 36px;
    padding-inline: var(--erp-space-2);
}

.topbar-user-avatar {
    width: 26px;
    height: 26px;
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
    font-size: .72rem;
}

.topbar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1399.98px) {
    .topbar-user-name {
        display: none;
    }
}

@media (max-width: 1199.98px) {
    :root .enterprise-context-trail li {
        max-inline-size: 128px;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        z-index: 1050;
        inset-block: 0;
        inset-inline-start: 0;
        transform: translateX(-100%);
        width: min(var(--erp-sidebar-width), 86vw);
        min-width: min(var(--erp-sidebar-width), 86vw);
        max-width: min(var(--erp-sidebar-width), 86vw);
        flex-basis: min(var(--erp-sidebar-width), 86vw);
    }

    [dir="rtl"] .app-sidebar {
        transform: translateX(100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-sidebar.is-collapsed {
        width: min(var(--erp-sidebar-width), 86vw);
        min-width: min(var(--erp-sidebar-width), 86vw);
        max-width: min(var(--erp-sidebar-width), 86vw);
        flex-basis: min(var(--erp-sidebar-width), 86vw);
    }

    .app-sidebar.is-collapsed .sidebar-brand-copy,
    .app-sidebar.is-collapsed .sidebar-search input,
    .app-sidebar.is-collapsed .sidebar-link-copy,
    .app-sidebar.is-collapsed .sidebar-link-trailing,
    .app-sidebar.is-collapsed .sidebar-user-copy {
        display: block;
    }

    .app-sidebar.is-collapsed .sidebar-section-label {
        display: list-item;
    }

    .app-sidebar.is-collapsed .sidebar-search {
        height: auto;
        border: 0;
        background: transparent;
    }

    .app-sidebar.is-collapsed .sidebar-search > .bi {
        inset-inline-start: .75rem;
        transform: translateY(-50%);
    }

    [dir="rtl"] .app-sidebar.is-collapsed .sidebar-search > .bi {
        transform: translateY(-50%);
    }

    .app-sidebar.is-collapsed .sidebar-link {
        justify-content: space-between;
        padding: .58rem .65rem;
    }

    .app-sidebar.is-collapsed .sidebar-link-main {
        justify-content: flex-start;
    }

    .app-sidebar.is-collapsed .logout-btn {
        display: inline-flex;
    }

    .topbar-user-name,
    .theme-selector {
        display: none;
    }
}

.mobile-first-shell .erp-main {
    padding-bottom: calc(var(--erp-space-6) + 74px);
}

.mobile-first-shell,
.mobile-first-shell > .flex-grow-1 {
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.desktop-workspace-shell {
    background: var(--erp-surface);
    border-inline-end: 1px solid var(--erp-border);
    display: flex;
    flex: 0 0 344px;
    min-width: 344px;
    max-width: 344px;
    height: 100vh;
}

.desktop-rail {
    align-items: center;
    background: var(--erp-bg-subtle);
    border-inline-end: 1px solid var(--erp-border);
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-2);
    padding: var(--erp-space-3) var(--erp-space-2);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    width: 96px;
}

.desktop-rail-item {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text-muted);
    display: grid;
    font-size: .68rem;
    gap: .18rem;
    min-height: 56px;
    justify-items: center;
    line-height: 1.15;
    min-width: 0;
    padding: var(--erp-space-1) .25rem;
    text-align: center;
    width: 78px;
}

.desktop-rail-item i {
    font-size: 1.08rem;
}

.desktop-rail-item span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: normal;
}

.desktop-rail-item:hover,
.desktop-rail-item.is-active {
    background: var(--erp-primary-soft);
    border-color: rgba(var(--erp-primary-rgb), .22);
    color: var(--erp-primary);
}

.desktop-workspace-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--erp-space-4);
    min-width: 0;
    overflow-y: auto;
    padding: var(--erp-space-4);
}

.desktop-workspace-header {
    border-bottom: 1px solid var(--erp-border);
    padding-bottom: var(--erp-space-4);
}

.desktop-workspace-header span,
.desktop-nav-section h3,
.nav-quick-section h3 {
    color: var(--erp-text-muted);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    margin: 0 0 var(--erp-space-2);
    text-transform: uppercase;
}

.desktop-workspace-header strong {
    color: var(--erp-text);
    display: block;
    font-size: 1.08rem;
}

.desktop-nav-section {
    display: grid;
    gap: var(--erp-space-2);
}

.workspace-board {
    border-bottom: 1px solid var(--erp-border);
    padding-bottom: var(--erp-space-4);
}

.workspace-board-grid {
    display: grid;
    gap: var(--erp-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-board-tile {
    align-items: center;
    background: var(--erp-bg-subtle);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-2);
    min-height: 52px;
    min-width: 0;
    padding: var(--erp-space-2);
    text-align: start;
}

.workspace-board-tile:hover,
.workspace-board-tile:focus {
    background: var(--erp-primary-soft);
    border-color: color-mix(in srgb, var(--erp-primary) 22%, transparent);
    color: var(--erp-primary);
}

.workspace-board-tile:disabled {
    color: var(--erp-text-muted);
    cursor: default;
    opacity: .72;
}

.workspace-board-tile > i {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    display: inline-flex;
    flex: 0 0 32px;
    height: 32px;
    justify-content: center;
}

.workspace-board-tile span {
    display: grid;
    min-width: 0;
}

.workspace-board-tile strong,
.workspace-board-tile small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-board-tile strong {
    font-size: .78rem;
}

.workspace-board-tile small {
    color: var(--erp-text-muted);
    font-size: .7rem;
}

.desktop-hub-section-list {
    display: grid;
    gap: var(--erp-space-3);
}

.desktop-hub-workspace {
    display: grid;
    gap: var(--erp-space-2);
    padding: var(--erp-space-3);
}

.desktop-hub-workspace h3 {
    align-items: center;
    color: var(--erp-text);
    display: flex;
    font-size: .9rem;
    gap: var(--erp-space-2);
    margin: 0;
}

.desktop-hub-module {
    display: grid;
    gap: var(--erp-space-2);
    padding: var(--erp-space-2);
}

.desktop-hub-module > strong {
    color: var(--erp-text-muted);
    font-size: .75rem;
    padding-inline: var(--erp-space-2);
}

.desktop-nav-link,
.more-link,
.nav-chip,
.command-result {
    color: var(--erp-text);
    text-align: start;
}

.desktop-nav-row {
    align-items: center;
    display: flex;
    gap: var(--erp-space-1);
    min-width: 0;
}

.desktop-nav-link {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-md);
    display: flex;
    gap: var(--erp-space-3);
    min-height: 40px;
    min-width: 0;
    padding: var(--erp-space-2) var(--erp-space-3);
    width: 100%;
}

.desktop-favorite-toggle {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-md);
    color: var(--erp-text-soft);
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
    padding: 0;
}

.desktop-favorite-toggle:hover,
.desktop-favorite-toggle:focus,
.desktop-favorite-toggle.is-active {
    background: color-mix(in srgb, var(--erp-warning) 13%, transparent);
    border-color: color-mix(in srgb, var(--erp-warning) 24%, transparent);
    color: var(--erp-warning);
}

.desktop-nav-link > span,
.more-link > span {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.desktop-nav-link strong,
.desktop-nav-link small,
.more-link strong,
.more-link small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desktop-nav-link small {
    color: var(--erp-text-muted);
    font-size: .72rem;
}

.desktop-nav-link:hover,
.desktop-nav-link.is-active {
    background: var(--erp-primary-soft);
    border-color: rgba(var(--erp-primary-rgb), .22);
    color: var(--erp-primary);
}

.desktop-nav-link.is-parent {
    background: var(--erp-bg-subtle);
    border-color: var(--erp-border);
    font-weight: 800;
}

.desktop-nav-link.is-parent > i {
    color: var(--erp-primary);
}

.desktop-nav-link.is-expanded {
    border-color: rgba(var(--erp-primary-rgb), .2);
}

.desktop-nav-link.is-ancestor-active {
    background: var(--erp-bg-subtle);
    border-color: rgba(var(--erp-primary-rgb), .18);
    color: var(--erp-text);
}

.desktop-nav-chevron {
    color: var(--erp-text-muted);
    flex: 0 0 auto;
    font-size: .8rem;
    margin-inline-start: auto;
}

.desktop-nav-link.is-disabled {
    color: var(--erp-text-muted);
    cursor: default;
    opacity: .88;
}

.desktop-nav-link.depth-1 {
    padding-inline-start: calc(var(--erp-space-3) + .75rem);
}

.desktop-nav-link.depth-2 {
    padding-inline-start: calc(var(--erp-space-3) + 1.5rem);
}

.desktop-nav-link.depth-3 {
    padding-inline-start: calc(var(--erp-space-3) + 2.25rem);
}

.desktop-nav-link.depth-4 {
    padding-inline-start: calc(var(--erp-space-3) + 3rem);
}

.mobile-bottom-nav,
.mobile-action-bar {
    background: color-mix(in srgb, var(--erp-surface) 96%, transparent);
    border-top: 1px solid var(--erp-border);
    bottom: 0;
    box-shadow: 0 -10px 28px rgba(15, 23, 42, .08);
    display: none;
    gap: var(--erp-space-1);
    inset-inline: 0;
    max-width: 100%;
    min-width: 0;
    padding: var(--erp-space-2) var(--erp-space-2) max(var(--erp-space-2), env(safe-area-inset-bottom));
    position: fixed;
    width: 100%;
    z-index: 1040;
}

.mobile-bottom-nav-item,
.mobile-action-bar-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text-muted);
    display: grid;
    flex: 1 1 0;
    font-size: .7rem;
    gap: .16rem;
    justify-items: center;
    min-height: 54px;
    min-width: 0;
    padding: var(--erp-space-1);
}

.mobile-bottom-nav-item i,
.mobile-action-bar-item i {
    font-size: 1.08rem;
}

.mobile-bottom-nav-item span,
.mobile-action-bar-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.mobile-bottom-nav-item.is-active,
.mobile-action-bar-item.is-active,
.mobile-action-bar-item:hover,
.mobile-action-bar-item:focus {
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
    font-weight: 800;
}

.more-hub-backdrop,
.command-palette-backdrop {
    background: rgba(15, 23, 42, .42);
    inset: 0;
    max-width: 100%;
    position: fixed;
    width: 100%;
    z-index: 1050;
}

.more-hub {
    background: var(--erp-bg);
    color: var(--erp-text);
    display: flex;
    flex-direction: column;
    inset: 0;
    max-width: 100%;
    min-width: 0;
    position: fixed;
    width: 100%;
    z-index: 1060;
}

.more-hub-header {
    align-items: center;
    background: var(--erp-surface);
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    justify-content: space-between;
    gap: var(--erp-space-3);
    min-width: 0;
    padding: var(--erp-space-4);
}

.more-hub-kicker {
    color: var(--erp-primary);
    font-size: .75rem;
    font-weight: 800;
}

.more-hub-header h2 {
    font-size: 1.35rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-hub-body {
    display: grid;
    gap: var(--erp-space-4);
    min-width: 0;
    overflow-y: auto;
    padding: var(--erp-space-4) var(--erp-space-4) calc(90px + env(safe-area-inset-bottom));
}

.more-hub-quick-grid {
    display: grid;
    gap: var(--erp-space-3);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.more-hub-controls {
    background: color-mix(in srgb, var(--erp-bg) 94%, transparent);
    border-bottom: 1px solid var(--erp-border);
    display: grid;
    gap: var(--erp-space-3);
    margin-inline: calc(var(--erp-space-4) * -1);
    padding: 0 var(--erp-space-4) var(--erp-space-3);
    position: sticky;
    top: 0;
    z-index: 2;
}

.more-hub-search {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: flex;
    gap: var(--erp-space-2);
    min-width: 0;
    padding: var(--erp-space-2) var(--erp-space-3);
}

.more-hub-search > .bi {
    color: var(--erp-text-muted);
}

.more-hub-search .form-control {
    border: 0;
    box-shadow: none;
    min-height: 40px;
    min-width: 0;
    padding-inline: 0;
}

.more-hub-tabs {
    display: flex;
    gap: var(--erp-space-2);
    overflow-x: auto;
    padding-bottom: var(--erp-space-1);
    scroll-padding-inline: var(--erp-space-4);
    scrollbar-width: thin;
}

.more-hub-tab {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text-muted);
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 800;
    gap: var(--erp-space-2);
    min-height: 42px;
    max-width: min(72vw, 240px);
    padding: var(--erp-space-2) var(--erp-space-3);
}

.more-hub-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-hub-tab.is-active {
    background: var(--erp-primary-soft);
    border-color: rgba(var(--erp-primary-rgb), .28);
    color: var(--erp-primary);
}

.more-hub-module-grid {
    display: grid;
    gap: var(--erp-space-3);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.more-module-card,
.desktop-hub-workspace,
.desktop-hub-module {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
    min-width: 0;
    overflow: hidden;
}

.more-module-header {
    align-items: center;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    gap: var(--erp-space-3);
    min-width: 0;
    padding: var(--erp-space-3);
}

.more-module-header > span:last-child {
    display: grid;
    min-width: 0;
}

.more-module-header strong,
.more-module-header small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-module-header small {
    color: var(--erp-text-muted);
    font-size: .75rem;
}

.more-module-icon {
    align-items: center;
    background: var(--erp-primary-soft);
    border-radius: var(--erp-radius-md);
    color: var(--erp-primary);
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.more-module-toggle {
    align-items: center;
    background: var(--erp-bg-subtle);
    border: 0;
    border-top: 1px solid var(--erp-border);
    color: var(--erp-primary);
    display: flex;
    font-weight: 800;
    gap: var(--erp-space-2);
    justify-content: center;
    min-height: 42px;
    width: 100%;
}

.more-hub-empty {
    align-items: center;
    color: var(--erp-text-muted);
    display: grid;
    gap: var(--erp-space-2);
    justify-items: center;
    min-height: 220px;
    text-align: center;
}

.more-hub-empty i {
    color: var(--erp-primary);
    font-size: 1.8rem;
}

.hub-row-depth-1 {
    padding-inline-start: 2.25rem;
}

.hub-row-depth-2 {
    padding-inline-start: 3.5rem;
}

.hub-row-depth-3 {
    padding-inline-start: 4.75rem;
}

.hub-row-depth-4 {
    padding-inline-start: 6rem;
}

.nav-chip-grid {
    display: grid;
    gap: var(--erp-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nav-chip {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: flex;
    gap: var(--erp-space-2);
    min-height: 48px;
    min-width: 0;
    padding: var(--erp-space-3);
}

.more-workspace-section {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
    overflow: hidden;
}

.more-workspace-title {
    align-items: center;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    gap: var(--erp-space-2);
    font-weight: 800;
    padding: var(--erp-space-3);
}

.more-link-list {
    display: grid;
}

.more-link-row {
    align-items: stretch;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    min-width: 0;
}

.more-link-row:last-child {
    border-bottom: 0;
}

.more-link {
    align-items: center;
    background: transparent;
    border: 0;
    display: flex;
    flex: 1 1 auto;
    gap: var(--erp-space-3);
    min-width: 0;
    padding: var(--erp-space-3);
}

.more-link.is-disabled {
    color: var(--erp-text-muted);
    cursor: default;
    font-weight: 800;
    opacity: .84;
}

.more-link.is-parent {
    background: var(--erp-bg-subtle);
    font-weight: 800;
}

.more-link.is-parent > i {
    color: var(--erp-primary);
}

.more-link.is-active {
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
}

.more-link.is-active {
    box-shadow: inset 3px 0 0 var(--erp-primary);
}

[dir="rtl"] .more-link.is-active {
    box-shadow: inset -3px 0 0 var(--erp-primary);
}

.more-link.is-ancestor-active {
    background: var(--erp-bg-subtle);
    color: var(--erp-text);
    border-inline-start: 3px solid var(--erp-primary);
}

.more-link span {
    display: grid;
    min-width: 0;
}

.more-link strong,
.more-link small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-link small {
    color: var(--erp-text-muted);
    font-size: .75rem;
}

.favorite-toggle {
    align-items: center;
    border: 0;
    border-inline-start: 1px solid var(--erp-border);
    border-radius: 0;
    color: var(--erp-text-muted);
    display: inline-flex;
    flex: 0 0 48px;
    justify-content: center;
    width: 48px;
}

.favorite-toggle.is-active {
    color: var(--erp-warning);
}

.command-palette {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-md);
    color: var(--erp-text);
    inset-inline: 50%;
    max-height: min(620px, calc(100vh - 2rem));
    max-width: 720px;
    min-width: 0;
    overflow: hidden;
    position: fixed;
    top: var(--erp-space-4);
    transform: translateX(-50%);
    width: min(720px, calc(100vw - 1rem));
    z-index: 1065;
}

[dir="rtl"] .command-palette {
    transform: translateX(50%);
}

.command-palette-search {
    align-items: center;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    gap: var(--erp-space-2);
    padding: var(--erp-space-3);
}

.command-palette-search > .bi {
    color: var(--erp-text-muted);
}

.command-palette-search .form-control {
    border: 0;
    box-shadow: none;
    min-height: 44px;
}

.command-palette-hints {
    align-items: center;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
    padding: var(--erp-space-2) var(--erp-space-3);
}

.command-hint {
    align-items: center;
    background: var(--erp-bg-subtle);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-full);
    color: var(--erp-text-muted);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    min-height: 24px;
    padding-inline: var(--erp-space-2);
}

.command-hint.is-active {
    background: var(--erp-primary-soft);
    border-color: color-mix(in srgb, var(--erp-primary) 22%, transparent);
    color: var(--erp-primary);
}

.command-palette-results {
    display: grid;
    max-height: 520px;
    overflow-y: auto;
    padding: var(--erp-space-2);
}

.command-result {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--erp-radius-md);
    display: flex;
    gap: var(--erp-space-3);
    min-width: 0;
    padding: var(--erp-space-3);
}

.command-result:hover,
.command-result.is-selected {
    background: var(--erp-primary-soft);
}

.command-result-icon {
    align-items: center;
    background: var(--erp-surface-muted);
    border-radius: var(--erp-radius-md);
    color: var(--erp-primary);
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.command-result-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.command-result-copy strong,
.command-result-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-result-copy small {
    color: var(--erp-text-muted);
}

.command-result-enter {
    color: var(--erp-text-soft);
}

.command-result-mode {
    background: var(--erp-bg-subtle);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-full);
    color: var(--erp-text-muted);
    flex: 0 0 auto;
    font-size: .68rem;
    font-weight: 800;
    padding: var(--erp-space-1) var(--erp-space-2);
}

.command-empty {
    align-items: center;
    color: var(--erp-text-muted);
    display: grid;
    gap: var(--erp-space-2);
    justify-items: center;
    min-height: 180px;
    text-align: center;
}

@media (max-width: 991.98px) {
    .desktop-workspace-shell {
        display: none;
    }

    .mobile-bottom-nav,
    .mobile-action-bar {
        display: flex;
    }

    .mobile-first-shell .erp-main {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        padding: var(--erp-space-4);
        padding-bottom: calc(var(--erp-space-4) + 78px + env(safe-area-inset-bottom));
        width: 100%;
    }

    .erp-topbar {
        max-width: 100%;
        min-width: 0;
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 1030;
    }

    .topbar-context {
        flex: 1 1 0;
        max-width: none;
        min-width: 0;
    }

    .topbar-page-context {
        flex: 1 1 0;
        min-width: 42px;
    }

    .topbar-breadcrumb {
        display: none;
    }

    .command-palette {
        border-radius: var(--erp-radius-lg) var(--erp-radius-lg) 0 0;
        inset-inline: 0;
        max-height: 88vh;
        max-width: none;
        top: auto;
        bottom: 0;
        transform: none;
        width: 100%;
    }

    [dir="rtl"] .command-palette {
        transform: none;
    }
}

@media (max-width: 420px) {
    .mobile-workspace-switcher {
        flex-basis: 178px;
        max-width: 58vw;
    }

    .topbar-page-context {
        flex: 1 1 32px;
    }

    .erp-topbar {
        padding-inline: var(--erp-space-2) !important;
    }

    .erp-topbar .erp-icon-btn {
        min-height: 36px;
    }
}

/* HR mobile-first pilot refinements */
.erp-page-header > div:first-child,
.erp-card-header > div:first-child,
.topbar-context,
.topbar-actions {
    min-width: 0;
}

.erp-page-header .btn,
.erp-card-header .btn,
.erp-filter-bar .btn,
.erp-pagination .btn {
    align-items: center;
    display: inline-flex;
    gap: var(--erp-space-2);
}

.erp-page .form-control,
.erp-page .form-select {
    min-height: 42px;
}

.erp-page .form-control::placeholder {
    color: var(--erp-text-soft);
}

.erp-page .form-control:disabled,
.erp-page .form-select:disabled,
.erp-page .btn:disabled {
    cursor: not-allowed;
    opacity: .68;
}

.erp-page a:focus-visible,
.erp-page button:focus-visible,
.erp-page input:focus-visible,
.erp-page select:focus-visible,
.erp-page textarea:focus-visible,
.mobile-action-bar-item:focus-visible,
.desktop-rail-item:focus-visible,
.desktop-nav-link:focus-visible,
.more-link:focus-visible,
.more-hub-tab:focus-visible,
.command-result:focus-visible {
    outline: 3px solid var(--erp-focus-ring);
    outline-offset: 2px;
}

.erp-card {
    overflow: hidden;
}

.erp-card.allow-overflow {
    overflow: visible;
}

.erp-stat-card {
    min-width: 0;
}

.erp-stat-card > div:last-child {
    min-width: 0;
}

.erp-stat-label,
.erp-stat-value {
    overflow-wrap: anywhere;
}

.payroll-summary-grid {
    display: grid;
    gap: var(--erp-space-3);
    grid-template-columns: 1fr;
}

.payroll-summary-card {
    width: 100%;
}

.payroll-summary-card .erp-stat-icon {
    flex: 0 0 46px;
}

.payroll-summary-card .erp-stat-label {
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payroll-summary-card .erp-stat-value {
    font-variant-numeric: tabular-nums;
    overflow-wrap: normal;
}

.payroll-summary-card-money .erp-stat-value {
    font-size: 1.35rem;
    white-space: nowrap;
}

@media (min-width: 576px) {
    .payroll-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .payroll-summary-grid {
        grid-template-columns: minmax(132px, 0.85fr) minmax(132px, 0.85fr) minmax(210px, 1.3fr) minmax(210px, 1.3fr);
    }
}

.erp-stat-primary {
    border-inline-start-color: var(--erp-primary);
}

.erp-stat-success {
    border-inline-start-color: var(--erp-success);
}

.erp-stat-success .erp-stat-icon {
    background: color-mix(in srgb, var(--erp-success) 12%, transparent);
    color: var(--erp-success);
}

.erp-stat-info {
    border-inline-start-color: var(--erp-info);
}

.erp-stat-info .erp-stat-icon {
    background: color-mix(in srgb, var(--erp-info) 12%, transparent);
    color: var(--erp-info);
}

.erp-stat-warning {
    border-inline-start-color: var(--erp-warning);
}

.erp-stat-warning .erp-stat-icon {
    background: color-mix(in srgb, var(--erp-warning) 14%, transparent);
    color: var(--erp-warning);
}

.erp-stat-danger {
    border-inline-start-color: var(--erp-danger);
}

.erp-stat-danger .erp-stat-icon {
    background: color-mix(in srgb, var(--erp-danger) 12%, transparent);
    color: var(--erp-danger);
}

[dir="rtl"] .erp-stat-primary {
    border-inline-end-color: var(--erp-primary);
}

[dir="rtl"] .erp-stat-success {
    border-inline-end-color: var(--erp-success);
}

[dir="rtl"] .erp-stat-info {
    border-inline-end-color: var(--erp-info);
}

[dir="rtl"] .erp-stat-warning {
    border-inline-end-color: var(--erp-warning);
}

[dir="rtl"] .erp-stat-danger {
    border-inline-end-color: var(--erp-danger);
}

.erp-table-wrap {
    background: var(--erp-surface);
    max-width: 100%;
}

.erp-table-wrap::-webkit-scrollbar {
    height: 9px;
    width: 9px;
}

.erp-table-wrap::-webkit-scrollbar-thumb {
    background: var(--erp-border-strong);
    border-radius: 999px;
}

.erp-table td,
.erp-table th {
    min-width: 0;
    vertical-align: middle;
}

.erp-table tbody td {
    border-color: var(--erp-border);
}

.erp-segmented-control {
    align-items: center;
    background: var(--erp-surface-level-0, var(--erp-bg));
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md, .375rem);
    display: inline-flex;
    gap: var(--erp-space-1);
    padding: var(--erp-space-1);
}

.erp-segmented-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--erp-radius-sm, .125rem);
    color: var(--erp-muted);
    display: inline-flex;
    font-size: .875rem;
    font-weight: 600;
    gap: var(--erp-space-2);
    min-height: 32px;
    padding-block: var(--erp-space-1);
    padding-inline: var(--erp-space-3);
}

.erp-segmented-button:hover,
.erp-segmented-button:focus-visible {
    background: color-mix(in srgb, var(--erp-primary) 8%, transparent);
    color: var(--erp-text);
}

.erp-segmented-button.active {
    background: var(--erp-surface);
    color: var(--erp-primary);
    box-shadow: var(--erp-shadow-sm);
}

.account-view-actions,
.account-tree-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
    justify-content: space-between;
}

.account-tree-toolbar {
    margin-bottom: var(--erp-space-3);
}

.account-tree-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-1);
    min-inline-size: 0;
}

.account-tree-item {
    min-inline-size: 0;
}

.account-tree-row {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-md, .375rem);
    display: grid;
    gap: var(--erp-space-3);
    grid-template-columns: minmax(260px, 1fr) max-content;
    min-block-size: 44px;
    padding-block: var(--erp-space-2);
    padding-inline: var(--erp-space-2);
}

.account-tree-row:hover {
    background: color-mix(in srgb, var(--erp-primary) 5%, transparent);
    border-color: color-mix(in srgb, var(--erp-primary) 12%, transparent);
}

.account-tree-node {
    align-items: center;
    display: flex;
    gap: var(--erp-space-2);
    min-inline-size: 0;
    padding-inline-start: calc(var(--account-tree-depth, 0) * 28px);
}

.account-tree-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--erp-muted);
    display: inline-flex;
    height: 28px;
    justify-content: center;
    padding: 0;
    width: 28px;
}

.account-tree-toggle:hover,
.account-tree-toggle:focus-visible {
    color: var(--erp-primary);
}

.account-tree-toggle-placeholder {
    flex: 0 0 28px;
}

.account-tree-icon {
    color: var(--erp-muted);
    font-size: 1rem;
}

.account-tree-posting-icon {
    font-size: .9375rem;
}

.account-tree-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-inline-size: 0;
}

.account-tree-name-line {
    align-items: center;
    display: flex;
    gap: var(--erp-space-1, .25rem);
    min-inline-size: 0;
}

.account-tree-label strong {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-tree-balance-icon {
    color: var(--erp-text-muted);
    flex: 0 0 auto;
    font-size: .75rem;
    line-height: 1;
}

.account-tree-label-muted strong {
    color: var(--erp-color-outline, var(--erp-text-muted));
}

.account-tree-label span {
    color: var(--erp-muted);
    font-family: var(--erp-font-mono, monospace);
    font-size: .75rem;
}

.account-actions-col {
    inline-size: 112px;
}

.account-posting-system-active {
    color: var(--erp-primary);
}

.account-posting-system-inactive {
    color: color-mix(in srgb, var(--erp-primary) 58%, var(--erp-text-muted));
}

.account-posting-user-active {
    color: var(--erp-text-muted);
}

.account-posting-user-inactive {
    color: color-mix(in srgb, var(--erp-text-muted) 58%, var(--erp-surface));
}

.account-row-actions {
    align-items: center;
    display: inline-flex;
    gap: var(--erp-space-1);
    justify-content: flex-end;
    min-inline-size: max-content;
}

.account-tree-controls {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--erp-transition-fast, 150ms ease), visibility var(--erp-transition-fast, 150ms ease);
    visibility: hidden;
}

.account-tree-row:hover .account-tree-controls,
.account-tree-row:focus-within .account-tree-controls,
.account-tree-controls:focus-within {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.account-inline-row {
    background: var(--erp-surface-muted);
    border-radius: var(--erp-radius-md, .375rem);
    margin-block: var(--erp-space-1) var(--erp-space-2);
    padding: var(--erp-space-2);
    white-space: normal;
}

.account-inline-heading {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
    justify-content: space-between;
}

.account-tree-inline-editor {
    inline-size: calc(100% - (var(--account-tree-depth, 0) * 28px));
    margin-inline-start: calc(var(--account-tree-depth, 0) * 28px);
    max-inline-size: 100%;
    min-inline-size: 0;
}

.account-tree-inline-grid {
    align-items: end;
    display: grid;
    gap: var(--erp-space-2);
    grid-template-columns: minmax(84px, 104px) minmax(140px, .9fr) minmax(140px, .9fr) max-content max-content;
}

.account-tree-inline-grid > div {
    min-inline-size: 0;
}

.account-tree-inline-grid .form-label {
    margin-bottom: var(--erp-space-1);
}

.account-tree-inline-option {
    align-items: center;
    display: flex;
    justify-self: start;
    min-block-size: 31px;
    min-inline-size: max-content;
}

.account-tree-inline-grid > .account-row-actions {
    justify-self: end;
}

.account-tree-inline-editor .account-code-input {
    max-inline-size: 104px;
}

.account-tree-inline-editor .account-name-input {
    min-inline-size: 0;
}

.account-inline-check {
    align-items: center;
    display: flex;
    gap: var(--erp-space-1);
    margin-bottom: 0;
    white-space: nowrap;
}

.account-tree-inline-editor .account-inline-check {
    display: inline-flex;
    gap: var(--erp-space-2);
    margin: 0;
    padding: 0;
}

.account-tree-inline-editor .account-inline-check .form-check-input {
    flex: 0 0 auto;
    float: none;
    margin: 0;
    margin-inline: 0;
    position: static;
}

.account-tree-inline-editor .account-inline-check .form-check-label {
    cursor: pointer;
    line-height: 1.2;
    margin: 0;
}

[dir="rtl"] .account-tree-inline-editor .account-inline-check {
    flex-direction: row;
}

@media (max-width: 1200px) {
    .account-tree-inline-grid {
        grid-template-columns: minmax(84px, 104px) minmax(140px, 1fr) minmax(140px, 1fr);
    }

    .account-tree-inline-option {
        grid-column: 1 / 2;
    }

    .account-tree-inline-grid > .account-row-actions {
        grid-column: 2 / 4;
    }
}

@media (max-width: 768px) {
    .account-tree-row {
        align-items: flex-start;
        grid-template-columns: minmax(0, 1fr);
    }

    .account-tree-row > .account-row-actions {
        justify-content: flex-start;
        padding-inline-start: calc(var(--account-tree-depth, 0) * 28px + 56px);
    }

    .account-tree-controls {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .account-tree-inline-grid {
        grid-template-columns: minmax(160px, 1fr);
    }

    .account-tree-inline-grid > div:nth-child(3),
    .account-tree-inline-option,
    .account-tree-inline-grid > .account-row-actions {
        grid-column: 1;
    }

    .account-tree-inline-grid > .account-row-actions {
        justify-self: stretch;
    }

    .account-tree-inline-editor {
        inline-size: 100%;
        margin-inline-start: 0;
    }
}

@media (hover: none), (pointer: coarse) {
    .account-tree-controls {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }
}

.erp-pagination {
    align-items: center;
    border-top: 1px solid var(--erp-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-3);
    justify-content: space-between;
    padding-top: var(--erp-space-4);
}

.erp-topbar {
    backdrop-filter: blur(14px);
    position: relative;
}

.topbar-actions {
    gap: var(--erp-space-1);
}

.desktop-workspace-shell {
    box-shadow: 1px 0 0 rgba(15, 23, 42, .02);
}

.desktop-nav-link,
.more-link,
.command-result {
    transition: background-color var(--erp-transition-fast), border-color var(--erp-transition-fast), color var(--erp-transition-fast);
}

.mobile-action-bar {
    backdrop-filter: blur(16px);
}

.mobile-action-bar-item {
    touch-action: manipulation;
}

.more-hub,
.command-palette {
    overscroll-behavior: contain;
}

.more-hub-tabs,
.desktop-workspace-panel,
.command-palette-results {
    scrollbar-width: thin;
    scrollbar-color: var(--erp-border-strong) transparent;
}

@media (max-width: 767.98px) {
    .erp-page-header {
        gap: var(--erp-space-3);
        margin-bottom: var(--erp-space-4);
    }

    .erp-page-header > div,
    .erp-page-header > .d-flex {
        width: 100%;
    }

    .erp-page-header .btn {
        justify-content: center;
    }

    .erp-filter-bar {
        align-items: stretch;
    }

    .erp-filter-bar > div {
        width: 100%;
    }

    .erp-card-header,
    .erp-card-body {
        padding-inline: var(--erp-space-4);
    }

    .erp-table-wrap {
        margin-inline: calc(var(--erp-space-1) * -1);
        width: calc(100% + var(--erp-space-2));
    }

    .erp-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .mobile-action-bar-item {
        min-height: 58px;
    }
}

/* Alafkar ERP design-system contract from DESIGN.md */
:root {
    --erp-color-surface: #faf8ff;
    --erp-color-surface-dim: #d9d9e5;
    --erp-color-surface-bright: #faf8ff;
    --erp-color-surface-container-lowest: #ffffff;
    --erp-color-surface-container-low: #f3f2ff;
    --erp-color-surface-container: #ededf9;
    --erp-color-surface-container-high: #e7e7f4;
    --erp-color-surface-container-highest: #e2e1ee;
    --erp-color-on-surface: #191b24;
    --erp-color-on-surface-variant: #434655;
    --erp-color-inverse-surface: #2e3039;
    --erp-color-inverse-on-surface: #f0f0fc;
    --erp-color-outline: #737686;
    --erp-color-outline-variant: #c3c6d7;
    --erp-color-surface-tint: #0053da;
    --erp-color-primary: #0051d5;
    --erp-color-on-primary: #ffffff;
    --erp-color-primary-container: #306bf3;
    --erp-color-on-primary-container: #fefcff;
    --erp-color-inverse-primary: #b4c5ff;
    --erp-color-secondary: #495c94;
    --erp-color-on-secondary: #ffffff;
    --erp-color-secondary-container: #acbffe;
    --erp-color-on-secondary-container: #394c84;
    --erp-color-tertiary: #8f2cac;
    --erp-color-on-tertiary: #ffffff;
    --erp-color-tertiary-container: #ab49c7;
    --erp-color-on-tertiary-container: #fffbff;
    --erp-color-error: #ba1a1a;
    --erp-color-on-error: #ffffff;
    --erp-color-error-container: #ffdad6;
    --erp-color-on-error-container: #93000a;
    --erp-color-primary-fixed: #dbe1ff;
    --erp-color-primary-fixed-dim: #b4c5ff;
    --erp-color-on-primary-fixed: #00174b;
    --erp-color-on-primary-fixed-variant: #003ea7;
    --erp-color-secondary-fixed: #dbe1ff;
    --erp-color-secondary-fixed-dim: #b3c5ff;
    --erp-color-on-secondary-fixed: #00174a;
    --erp-color-on-secondary-fixed-variant: #31447b;
    --erp-color-tertiary-fixed: #fcd7ff;
    --erp-color-tertiary-fixed-dim: #f2afff;
    --erp-color-on-tertiary-fixed: #340043;
    --erp-color-on-tertiary-fixed-variant: #770994;
    --erp-color-background: #faf8ff;
    --erp-color-on-background: #191b24;
    --erp-color-surface-variant: #e2e1ee;
    --erp-font-family: "Inter", "Segoe UI", Tahoma, Arial, sans-serif;
    --erp-font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
    --erp-type-display-lg-size: 30px;
    --erp-type-display-lg-line: 38px;
    --erp-type-display-lg-weight: 700;
    --erp-type-display-lg-tracking: 0;
    --erp-type-display-mobile-size: 24px;
    --erp-type-display-mobile-line: 32px;
    --erp-type-headline-md-size: 20px;
    --erp-type-headline-md-line: 28px;
    --erp-type-headline-md-weight: 600;
    --erp-type-title-sm-size: 16px;
    --erp-type-title-sm-line: 24px;
    --erp-type-title-sm-weight: 600;
    --erp-type-body-md-size: 14px;
    --erp-type-body-md-line: 20px;
    --erp-type-body-sm-size: 13px;
    --erp-type-body-sm-line: 18px;
    --erp-type-label-md-size: 12px;
    --erp-type-label-md-line: 16px;
    --erp-type-label-md-weight: 600;
    --erp-type-label-md-tracking: .01em;
    --erp-type-code-sm-size: 12px;
    --erp-type-code-sm-line: 16px;
    --erp-space-unit: 4px;
    --erp-space-1: 4px;
    --erp-space-2: 8px;
    --erp-space-3: 12px;
    --erp-space-4: 16px;
    --erp-space-5: 20px;
    --erp-space-6: 24px;
    --erp-space-8: 32px;
    --erp-container-margin: 24px;
    --erp-gutter: 16px;
    --erp-radius-sm: .125rem;
    --erp-radius-default: .25rem;
    --erp-radius-md: .375rem;
    --erp-radius-lg: .5rem;
    --erp-radius-xl: .75rem;
    --erp-radius-full: 9999px;
    --erp-sidebar-width: 320px;
    --erp-sidebar-expanded-width: 320px;
    --erp-sidebar-collapsed-width: 64px;
    --erp-desktop-rail-width: 64px;
    --erp-topbar-height: 64px;
    --erp-row-height-compact: 36px;
    --erp-control-height: 36px;
    --erp-control-height-sm: 32px;
    --erp-surface-level-0: var(--erp-color-background);
    --erp-surface-level-1: var(--erp-color-surface-container-lowest);
    --erp-surface-level-2: var(--erp-color-surface-container-lowest);
    --erp-border: #c5c6d2;
    --erp-border-strong: var(--erp-color-outline);
    --erp-shadow-xs: 0 1px 2px rgba(25, 27, 36, .04);
    --erp-shadow-sm: 0 1px 3px rgba(25, 27, 36, .08);
    --erp-shadow-md: 0 12px 28px rgba(25, 27, 36, .12);
    --erp-focus-ring: rgba(0, 81, 213, .18);
    --erp-success: #15803d;
    --erp-warning: #b45309;
    --erp-danger: var(--erp-color-error);
    --erp-info: #0369a1;
    --erp-primary: var(--erp-color-primary);
    --erp-primary-rgb: 0, 81, 213;
    --erp-primary-hover: #003ea7;
    --erp-primary-soft: var(--erp-color-primary-fixed);
    --erp-primary-contrast: var(--erp-color-on-primary);
    --erp-secondary: var(--erp-color-secondary);
    --erp-bg: var(--erp-color-background);
    --erp-bg-subtle: var(--erp-color-surface-container-low);
    --erp-surface: var(--erp-color-surface-container-lowest);
    --erp-surface-muted: var(--erp-color-surface-container-low);
    --erp-text: var(--erp-color-on-surface);
    --erp-text-muted: var(--erp-color-on-surface-variant);
    --erp-text-soft: var(--erp-color-outline);
    --erp-sidebar-bg: var(--erp-color-surface-container-lowest);
    --erp-sidebar-bg-soft: var(--erp-color-surface-container-low);
    --erp-sidebar-border: var(--erp-color-outline-variant);
    --erp-sidebar-text: var(--erp-color-on-surface-variant);
    --erp-sidebar-muted: var(--erp-color-outline);
    --primary: var(--erp-primary);
    --primary-hover: var(--erp-primary-hover);
    --primary-soft: var(--erp-primary-soft);
    --secondary: var(--erp-secondary);
    --surface: var(--erp-surface);
    --surface-elevated: var(--erp-surface);
    --surface-hover: var(--erp-surface-muted);
    --surface-2: var(--erp-surface-muted);
    --background: var(--erp-bg);
    --text-primary: var(--erp-text);
    --text-secondary: var(--erp-text-muted);
    --text-muted: var(--erp-text-soft);
    --border: var(--erp-border);
    --border-hover: var(--erp-border-strong);
    --success: var(--erp-success);
    --warning: var(--erp-warning);
    --danger: var(--erp-danger);
}

:root[data-color-scheme="emerald"] {
    --erp-color-primary: #047857;
    --erp-primary-rgb: 4, 120, 87;
    --erp-color-primary-fixed: #d1fae5;
    --erp-color-on-primary-fixed: #022c22;
    --erp-primary-hover: #065f46;
}

:root[data-color-scheme="purple"] {
    --erp-color-primary: #7e22ce;
    --erp-primary-rgb: 126, 34, 206;
    --erp-color-primary-fixed: #f3e8ff;
    --erp-color-on-primary-fixed: #3b0764;
    --erp-primary-hover: #6b21a8;
}

:root[data-color-scheme="orange"] {
    --erp-color-primary: #c2410c;
    --erp-primary-rgb: 194, 65, 12;
    --erp-color-primary-fixed: #ffedd5;
    --erp-color-on-primary-fixed: #431407;
    --erp-primary-hover: #9a3412;
}

:root[data-color-scheme="slate"] {
    --erp-color-primary: #334155;
    --erp-primary-rgb: 51, 65, 85;
    --erp-color-primary-fixed: #e2e8f0;
    --erp-color-on-primary-fixed: #0f172a;
    --erp-primary-hover: #1e293b;
}

:root[data-theme-mode="dark"] {
    --erp-color-background: #191b24;
    --erp-color-surface: #191b24;
    --erp-color-surface-container-lowest: #2e3039;
    --erp-color-surface-container-low: #242731;
    --erp-color-surface-container: #2e3039;
    --erp-color-surface-container-high: #383a44;
    --erp-color-surface-container-highest: #42444f;
    --erp-color-on-surface: #f0f0fc;
    --erp-color-on-surface-variant: #d9d9e5;
    --erp-color-outline: #aeb1c2;
    --erp-color-outline-variant: #525666;
    --erp-bg: var(--erp-color-background);
    --erp-bg-subtle: var(--erp-color-surface-container-low);
    --erp-surface: var(--erp-color-surface-container-lowest);
    --erp-surface-muted: var(--erp-color-surface-container);
    --erp-text: var(--erp-color-on-surface);
    --erp-text-muted: var(--erp-color-on-surface-variant);
    --erp-text-soft: var(--erp-color-outline);
    --erp-border: var(--erp-color-outline-variant);
    --erp-border-strong: var(--erp-color-outline);
    --erp-primary-soft: rgba(var(--erp-primary-rgb), .18);
    --erp-sidebar-bg: var(--erp-color-surface-container-lowest);
    --erp-sidebar-bg-soft: var(--erp-color-surface-container);
    --erp-sidebar-border: var(--erp-color-outline-variant);
    --erp-sidebar-text: var(--erp-color-on-surface-variant);
    --erp-sidebar-muted: var(--erp-color-outline);
    --surface-elevated: var(--erp-surface);
    --surface-hover: var(--erp-surface-muted);
}

body {
    background: var(--erp-bg);
    color: var(--erp-text);
    font-family: var(--erp-font-family);
    font-size: var(--erp-type-body-md-size);
    line-height: var(--erp-type-body-md-line);
}

.erp-main {
    background: var(--erp-bg);
    padding: var(--erp-container-margin);
}

.erp-page {
    max-width: 1600px;
}

.erp-page-title {
    font-size: var(--erp-type-display-lg-size);
    font-weight: var(--erp-type-display-lg-weight);
    letter-spacing: var(--erp-type-display-lg-tracking);
    line-height: var(--erp-type-display-lg-line);
}

.erp-page-subtitle,
.erp-card-subtitle,
.erp-section-subtitle {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-body-md-size);
    line-height: var(--erp-type-body-md-line);
}

.erp-page-kicker,
.form-label,
.erp-card-title,
.erp-section-title,
.erp-table thead th,
.table thead th {
    letter-spacing: var(--erp-type-label-md-tracking);
}

.erp-card,
.card,
.modal-content,
.auth-surface {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border) !important;
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    color: var(--erp-text);
}

.erp-card-header {
    border-bottom: 1px solid var(--erp-border);
    padding: var(--erp-space-4);
}

.erp-card-body {
    padding: var(--erp-space-4);
}

.btn {
    align-items: center;
    border-radius: var(--erp-radius-default);
    display: inline-flex;
    font-size: var(--erp-type-body-md-size);
    font-weight: 600;
    gap: var(--erp-space-2);
    justify-content: center;
    min-height: var(--erp-control-height);
    padding: var(--erp-space-2) var(--erp-space-4);
}

.btn-sm {
    font-size: var(--erp-type-body-sm-size);
    min-height: var(--erp-control-height-sm);
    padding: var(--erp-space-1) var(--erp-space-3);
}

.btn-primary {
    --bs-btn-bg: var(--erp-primary);
    --bs-btn-border-color: var(--erp-primary);
    --bs-btn-color: var(--erp-primary-contrast);
    --bs-btn-hover-bg: var(--erp-primary-hover);
    --bs-btn-hover-border-color: var(--erp-primary-hover);
    --bs-btn-active-bg: var(--erp-primary-hover);
    --bs-btn-active-border-color: var(--erp-primary-hover);
}

.btn-outline-secondary,
.btn-secondary {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--erp-border);
    --bs-btn-color: var(--erp-secondary);
    --bs-btn-hover-bg: var(--erp-surface-muted);
    --bs-btn-hover-border-color: var(--erp-border-strong);
    --bs-btn-hover-color: var(--erp-secondary);
    --bs-btn-active-bg: var(--erp-surface-muted);
    --bs-btn-active-border-color: var(--erp-border-strong);
    --bs-btn-active-color: var(--erp-secondary);
}

.erp-icon-btn,
.erp-row-action,
.branch-action,
.org-action,
.employee-action,
.employee-lookup-action,
.shift-action {
    border-radius: var(--erp-radius-default);
}

.erp-icon-btn {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    color: var(--erp-text-muted);
    min-height: var(--erp-control-height);
    min-width: var(--erp-control-height);
    padding: 0 var(--erp-space-2);
}

.form-label {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-md-size);
    font-weight: var(--erp-type-label-md-weight);
    line-height: var(--erp-type-label-md-line);
    margin-bottom: var(--erp-space-1);
}

.form-control,
.form-select,
.input-group-text,
.auth-control {
    background-color: var(--erp-surface);
    border-color: var(--erp-border);
    border-radius: var(--erp-radius-default);
    color: var(--erp-text);
    font-size: var(--erp-type-body-md-size);
    min-height: var(--erp-control-height);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
    border-radius: var(--erp-radius-default);
}

.form-control:focus,
.form-select:focus,
.auth-control:focus-within,
.auth-control:focus {
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 2px var(--erp-focus-ring);
}

.form-control::placeholder {
    color: var(--erp-text-soft);
}

.erp-table-wrap {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    overflow: auto;
}

.erp-table,
.table {
    color: var(--erp-text);
    font-size: var(--erp-type-body-sm-size);
    margin-bottom: 0;
}

.erp-table thead th,
.table thead th {
    background: var(--erp-surface-muted);
    border-color: var(--erp-border);
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-md-size);
    font-weight: var(--erp-type-label-md-weight);
    height: 38px;
    line-height: var(--erp-type-label-md-line);
    padding: var(--erp-space-2) var(--erp-space-3);
    text-transform: uppercase;
    white-space: nowrap;
}

.erp-table tbody td,
.table tbody td {
    border-color: var(--erp-border);
    min-height: var(--erp-row-height-compact);
    padding: var(--erp-space-2) var(--erp-space-3);
    vertical-align: middle;
}

.erp-table tbody tr:hover,
.table tbody tr:hover {
    background: color-mix(in srgb, var(--erp-surface-muted) 72%, var(--erp-primary) 8%);
}

.font-code-sm,
.erp-code {
    font-family: var(--erp-font-mono);
    font-size: var(--erp-type-code-sm-size);
    line-height: var(--erp-type-code-sm-line);
}

.erp-status-chip {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-full);
    color: var(--erp-text-muted);
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    gap: var(--erp-space-1);
    line-height: 1;
    min-height: 20px;
    padding: 0 var(--erp-space-2);
    white-space: nowrap;
}

.erp-status-chip-primary {
    background: color-mix(in srgb, var(--erp-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--erp-primary) 22%, transparent);
    color: var(--erp-primary);
}

.erp-status-chip-success {
    background: color-mix(in srgb, var(--erp-success) 12%, transparent);
    border-color: color-mix(in srgb, var(--erp-success) 22%, transparent);
    color: var(--erp-success);
}

.erp-status-chip-warning {
    background: color-mix(in srgb, var(--erp-warning) 13%, transparent);
    border-color: color-mix(in srgb, var(--erp-warning) 24%, transparent);
    color: var(--erp-warning);
}

.erp-status-chip-danger {
    background: color-mix(in srgb, var(--erp-danger) 12%, transparent);
    border-color: color-mix(in srgb, var(--erp-danger) 22%, transparent);
    color: var(--erp-danger);
}

.erp-status-chip-info {
    background: color-mix(in srgb, var(--erp-info) 12%, transparent);
    border-color: color-mix(in srgb, var(--erp-info) 22%, transparent);
    color: var(--erp-info);
}

.erp-status-chip-muted {
    background: var(--erp-surface-muted);
    border-color: var(--erp-border);
    color: var(--erp-text-muted);
}

.desktop-workspace-shell {
    background: var(--erp-sidebar-bg);
    border-inline-end: 1px solid var(--erp-sidebar-border);
    flex: 0 0 var(--erp-sidebar-expanded-width);
    height: 100vh;
    max-width: var(--erp-sidebar-expanded-width);
    min-width: var(--erp-sidebar-expanded-width);
    transition: flex-basis var(--erp-transition-fast), max-width var(--erp-transition-fast), min-width var(--erp-transition-fast);
}

.desktop-workspace-shell.is-collapsed {
    border-inline-end-color: var(--erp-border);
    flex-basis: var(--erp-sidebar-collapsed-width);
    max-width: var(--erp-sidebar-collapsed-width);
    min-width: var(--erp-sidebar-collapsed-width);
}

.desktop-rail {
    background: var(--erp-surface-muted);
    border-inline-end: 1px solid var(--erp-border);
    padding: var(--erp-space-3) var(--erp-space-2);
    width: var(--erp-desktop-rail-width);
}

.desktop-workspace-shell.is-collapsed .desktop-rail {
    border-inline-end: 0;
}

.desktop-rail-item {
    border-radius: var(--erp-radius-default);
    color: var(--erp-text-muted);
    min-height: 44px;
    width: 48px;
}

.desktop-rail-collapse {
    margin-block-start: auto;
}

.desktop-rail-item span {
    display: none;
}

.desktop-rail-item:hover,
.desktop-rail-item.is-active {
    background: var(--erp-primary-soft);
    border-color: transparent;
    color: var(--erp-primary);
}

.desktop-workspace-panel {
    gap: var(--erp-space-3);
    padding: var(--erp-space-3);
}

.desktop-workspace-shell.is-collapsed .desktop-workspace-panel {
    display: none;
}

.desktop-workspace-header {
    padding-bottom: var(--erp-space-3);
}

.desktop-company-switcher {
    position: relative;
}

.company-switcher-trigger {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-2);
    min-height: 48px;
    min-width: 0;
    padding: var(--erp-space-2);
    text-align: start;
    width: 100%;
}

.company-switcher-logo,
.company-switcher-option-logo {
    align-items: center;
    background: var(--erp-primary);
    border-radius: var(--erp-radius-default);
    color: var(--erp-primary-contrast);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: var(--erp-type-label-md-size);
    font-weight: 800;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.company-switcher-copy,
.company-switcher-option-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.company-switcher-copy small,
.company-switcher-option-copy small {
    color: var(--erp-text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.company-switcher-copy strong,
.company-switcher-option-copy strong {
    color: var(--erp-text);
    font-size: var(--erp-type-body-sm-size);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-switcher-chevron {
    color: var(--erp-text-soft);
    flex: 0 0 auto;
}

.company-switcher-menu {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-md);
    display: grid;
    gap: var(--erp-space-1);
    inset-inline: 0;
    margin-top: var(--erp-space-1);
    min-width: 0;
    padding: var(--erp-space-2);
    position: absolute;
    z-index: 1050;
}

.company-switcher-option {
    align-items: center;
    background: var(--erp-primary-soft);
    border: 1px solid color-mix(in srgb, var(--erp-primary) 22%, transparent);
    border-radius: var(--erp-radius-default);
    display: flex;
    gap: var(--erp-space-2);
    min-width: 0;
    padding: var(--erp-space-2);
}

.company-switcher-note {
    color: var(--erp-text-muted);
    font-size: 11px;
    margin: 0;
    padding: var(--erp-space-1) var(--erp-space-2);
}

.desktop-nav-link {
    border-radius: var(--erp-radius-default);
    min-height: 36px;
    padding: var(--erp-space-2) var(--erp-space-3);
    position: relative;
}

.desktop-nav-link:hover,
.desktop-nav-link.is-active {
    background: var(--erp-primary-soft);
    border-color: transparent;
    color: var(--erp-primary);
}

.desktop-nav-link.is-active::before,
.desktop-nav-link.is-ancestor-active::before {
    background: var(--erp-primary);
    border-radius: var(--erp-radius-default);
    content: "";
    inset-block: 8px;
    inset-inline-start: 0;
    position: absolute;
    width: 2px;
}

.desktop-nav-link.is-parent {
    background: var(--erp-surface-muted);
    border-color: var(--erp-border);
}

[dir="rtl"] .desktop-nav-chevron,
[dir="rtl"] .sidebar-chevron,
[dir="rtl"] .mobile-workspace-chevron,
[dir="rtl"] .topbar-breadcrumb li:not(:last-child)::after {
    transform: scaleX(-1);
}

.erp-form-grid {
    display: grid;
    gap: var(--erp-space-4);
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.erp-form-main {
    grid-column: span 8;
}

.erp-form-aside {
    grid-column: span 4;
}

.erp-list-card-grid {
    display: none;
}

.erp-mobile-list-card {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    display: grid;
    gap: var(--erp-space-3);
    padding: var(--erp-space-4);
}

.erp-mobile-list-card-title {
    color: var(--erp-text);
    font-size: var(--erp-type-title-sm-size);
    font-weight: var(--erp-type-title-sm-weight);
    line-height: var(--erp-type-title-sm-line);
    margin: 0;
}

.erp-mobile-list-card-meta {
    color: var(--erp-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
}

.erp-mobile-list-card-metrics {
    display: grid;
    gap: var(--erp-space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.erp-mobile-list-card-metric {
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-default);
    padding: var(--erp-space-2);
}

.erp-mobile-list-card-metric small {
    color: var(--erp-text-muted);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.erp-mobile-list-card-metric strong {
    color: var(--erp-text);
    display: block;
    font-size: var(--erp-type-body-md-size);
}

/* Full-system rollout helpers */
.erp-auth-layout {
    background: var(--erp-bg);
    color: var(--erp-text);
    display: flex;
    min-height: 100vh;
}

.erp-auth-compact-card {
    inline-size: min(350px, calc(100vw - (var(--erp-space-4) * 2)));
}

.erp-loader-overlay {
    align-items: center;
    background: color-mix(in srgb, var(--erp-color-inverse-surface) 58%, transparent);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 9999;
}

.erp-loader-spinner {
    color: var(--erp-primary-contrast);
    height: 3rem;
    width: 3rem;
}

.erp-modal-layer {
    z-index: 1055;
}

.erp-modal-table-scroll {
    max-height: 400px;
    overflow: auto;
}

.erp-clickable-row,
.erp-sortable-column,
.erp-pointer,
.cursor-pointer,
.upload-label,
.profile-upload-label {
    cursor: pointer;
}

.erp-draggable-card {
    cursor: grab;
}

.erp-search-control,
.branch-search,
.employee-lookup-search,
.org-search {
    inline-size: min(100%, 320px);
}

.erp-search-control-wide {
    inline-size: min(100%, 360px);
}

.erp-status-filter {
    inline-size: min(100%, 220px);
}

.erp-hidden-input {
    display: none;
}

.erp-column-width-sm {
    inline-size: 80px;
}

.erp-column-width-md {
    inline-size: 150px;
}

.erp-column-width-lg {
    inline-size: 180px;
}

.erp-min-width-progress {
    min-inline-size: 160px;
}

.erp-progress,
.progress {
    background: var(--erp-surface-muted);
    border-radius: var(--erp-radius-full);
    min-height: 8px;
}

.erp-progress .progress-bar,
.progress .progress-bar {
    background-color: var(--erp-primary);
    border-radius: inherit;
    width: var(--erp-progress-value, auto);
}

.progress .bg-info {
    background-color: var(--erp-info) !important;
}

.erp-stat-panel,
.branch-stat,
.org-stat,
.employee-lookup-stat,
.operation-stat,
.metric-card,
.attendance-card,
.employee-360-hero,
.company-tile {
    align-items: center;
    background: var(--erp-surface) !important;
    border: 1px solid var(--erp-border) !important;
    border-inline-start: 4px solid var(--erp-primary) !important;
    border-radius: var(--erp-radius-lg) !important;
    box-shadow: var(--erp-shadow-sm) !important;
    color: var(--erp-text) !important;
}

.branch-stat-icon,
.org-stat-icon,
.employee-lookup-stat-icon,
.operation-stat-icon,
.metric-icon,
.attendance-icon {
    background: var(--erp-surface-muted) !important;
    border-radius: var(--erp-radius-lg) !important;
    color: var(--erp-primary) !important;
}

.branch-stat-value,
.org-stat-value,
.employee-lookup-stat-value,
.operation-stat-value,
.metric-value,
.attendance-value {
    color: var(--erp-text) !important;
}

.branch-search i,
.org-search i,
.employee-lookup-search i {
    color: var(--erp-text-muted) !important;
    inset-block-start: 50%;
    inset-inline-start: var(--erp-space-3) !important;
    left: auto !important;
    right: auto !important;
    position: absolute;
    transform: translateY(-50%);
}

.branch-search .form-control,
.org-search .form-control,
.employee-lookup-search .form-control {
    padding-inline-start: 2.5rem !important;
}

.branch-table-wrap,
.org-table-wrap,
.employee-lookup-table-wrap,
.operation-panel,
.branch-edit-panel,
.org-edit-panel,
.employee-lookup-edit-panel,
.employee-360-card,
.pos-panel {
    background: var(--erp-surface) !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: var(--erp-radius-lg) !important;
    box-shadow: var(--erp-shadow-sm);
}

.branch-edit-row > td,
.org-edit-row > td,
.employee-lookup-edit-row > td {
    background: var(--erp-surface-muted) !important;
    padding: var(--erp-space-4) !important;
}

.branch-empty,
.org-empty,
.employee-lookup-empty,
.attendance-empty {
    color: var(--erp-text-muted) !important;
    padding: var(--erp-space-8) !important;
}

.branch-check,
.org-check,
.employee-lookup-check {
    background: var(--erp-surface-muted) !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: var(--erp-radius-default) !important;
}

.metric-card.warning,
.erp-tone-warning {
    border-inline-start-color: var(--erp-warning) !important;
}

.metric-card.success,
.erp-tone-success {
    border-inline-start-color: var(--erp-success) !important;
}

.metric-card.danger,
.erp-tone-danger {
    border-inline-start-color: var(--erp-danger) !important;
}

.erp-tone-info {
    border-inline-start-color: var(--erp-info) !important;
}

.erp-kanban-page,
.task-page {
    inline-size: 100%;
    max-inline-size: calc(100vw - var(--erp-sidebar-expanded-width) - var(--erp-container-margin));
    min-inline-size: 0;
    overflow: hidden;
}

.kanban-wrapper {
    margin-block-end: var(--erp-space-5);
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow: hidden;
    position: relative;
}

.kanban-container {
    border: 1px solid var(--erp-border) !important;
    border-radius: var(--erp-radius-lg) !important;
    box-sizing: border-box;
    display: block;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-color: var(--erp-border-strong) transparent;
    scrollbar-width: thin;
}

.kanban-flex-wrapper {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: var(--erp-space-4);
    inline-size: max-content;
    min-inline-size: max-content;
    padding: var(--erp-space-3);
}

.kanban-panel {
    background: var(--erp-surface) !important;
    border: 1px solid var(--erp-border) !important;
    border-inline-start: 3px solid var(--erp-primary) !important;
    border-radius: var(--erp-radius-lg) !important;
    flex: 0 0 280px;
    min-block-size: 480px;
    inline-size: 280px !important;
}

.kanban-panel-draft,
.kanban-panel-assigned {
    border-inline-start-color: var(--erp-primary) !important;
}

.kanban-panel-inprogress,
.kanban-panel-overdue {
    border-inline-start-color: var(--erp-danger) !important;
}

.kanban-panel-onhold {
    border-inline-start-color: var(--erp-warning) !important;
}

.kanban-panel-completed {
    border-inline-start-color: var(--erp-success) !important;
}

.kanban-panel-cancelled {
    border-inline-start-color: var(--erp-text-soft) !important;
}

.kanban-task-card {
    background: var(--erp-surface) !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: var(--erp-radius-default) !important;
    color: var(--erp-text);
    cursor: grab;
}

.erp-public-page,
.employee-public-page,
.employee-qr-page {
    background: var(--erp-bg);
    color: var(--erp-text);
    min-block-size: 100vh;
}

.employee-public-card {
    inline-size: min(40rem, calc(100vw - (var(--erp-space-4) * 2)));
    margin-block-start: var(--erp-space-8);
}

.employee-public-card-sm,
.employee-qr-card {
    inline-size: min(30rem, calc(100vw - (var(--erp-space-4) * 2)));
    margin-block-start: var(--erp-space-8);
}

.employee-qr-card {
    inline-size: min(18rem, calc(100vw - (var(--erp-space-4) * 2)));
}

.employee-label-cell {
    inline-size: 35%;
}

.pos-shell {
    background: var(--erp-bg) !important;
    color: var(--erp-text);
}

.pos-muted-surface {
    background: var(--erp-surface-muted) !important;
}

.topbar-search-input,
.auth-management-search {
    inline-size: min(100%, 200px);
}

.auth-management-sidebar {
    background: var(--erp-sidebar-bg);
    border-inline-end: 1px solid var(--erp-sidebar-border);
    color: var(--erp-sidebar-text);
    inline-size: 250px;
}

.auth-management-sidebar .nav-link {
    border-radius: var(--erp-radius-default);
}

img,
svg,
canvas,
video {
    max-inline-size: 100%;
}

/* Catalog workspace helpers */
.catalog-dashboard-grid {
    display: grid;
    gap: var(--erp-space-4);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
}

.erp-table-toolbar {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin-block-end: var(--erp-space-2);
}

.erp-pagination-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
    justify-content: flex-end;
    margin-block-start: var(--erp-space-3);
}

.erp-inline-editor {
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: grid;
    gap: var(--erp-space-3);
    padding: var(--erp-space-4);
}

.erp-inline-editor .row {
    margin-inline: 0;
}

.erp-inline-editor .col-form-label,
.erp-subpanel .form-label,
.erp-check-tile .form-check-label {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-md-size);
    font-weight: var(--erp-type-label-md-weight);
    line-height: var(--erp-type-label-md-line);
}

.erp-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
    justify-content: flex-end;
}

.erp-subpanel {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: grid;
    gap: var(--erp-space-3);
    padding: var(--erp-space-3);
}

.erp-repeater-row {
    align-items: center;
    display: grid;
    gap: var(--erp-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.erp-price-list-item {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    padding: var(--erp-space-3);
}

.erp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-1);
}

.erp-check-tile-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
}

.erp-check-tile {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-default);
    display: inline-flex;
    gap: var(--erp-space-2);
    margin: 0;
    min-height: 36px;
    padding: var(--erp-space-2) var(--erp-space-3);
}

.erp-sku-image,
.erp-sku-image-upload {
    aspect-ratio: 1;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    object-fit: cover;
}

.erp-sku-image {
    inline-size: 56px;
}

.erp-sku-image-upload {
    inline-size: 72px;
}

.erp-logo-thumb,
.erp-logo-upload {
    align-items: center;
    aspect-ratio: 1;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    color: var(--erp-text-muted);
    display: inline-flex;
    justify-content: center;
    object-fit: cover;
}

.erp-logo-thumb {
    inline-size: 44px;
}

.erp-logo-upload {
    cursor: pointer;
    inline-size: 84px;
}

.sku-bundle-editor,
.sku-bundle-editor .erp-subpanel,
.sku-bundle-component-row,
.sku-bundle-component-picker {
    overflow: visible;
}

.sku-bundle-component-row {
    align-items: end;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    display: grid;
    gap: var(--erp-space-3);
    grid-template-columns: minmax(260px, 1fr) minmax(140px, 180px) auto;
    padding: var(--erp-space-3);
}

.sku-bundle-component-picker,
.sku-bundle-component-quantity {
    min-inline-size: 0;
}

.sku-bundle-component-action {
    display: flex;
    justify-content: flex-end;
    padding-block-end: var(--erp-space-1);
}

[dir="rtl"] .branch-stat,
[dir="rtl"] .org-stat,
[dir="rtl"] .employee-lookup-stat,
[dir="rtl"] .operation-stat,
[dir="rtl"] .metric-card,
[dir="rtl"] .attendance-card,
[dir="rtl"] .company-tile,
[dir="rtl"] .kanban-panel {
    border-inline-start-width: 0 !important;
    border-inline-end: 4px solid var(--erp-primary) !important;
}

@media (max-width: 991.98px) {
    .catalog-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .desktop-workspace-shell {
        display: none;
    }

    .erp-kanban-page,
    .task-page {
        max-inline-size: calc(100vw - (var(--erp-space-4) * 2));
    }
}

@media (max-width: 767.98px) {
    .erp-main {
        padding: var(--erp-space-4);
    }

    .erp-page-title {
        font-size: var(--erp-type-display-mobile-size);
        line-height: var(--erp-type-display-mobile-line);
    }

    .erp-form-grid {
        display: block;
    }

    .erp-form-main,
    .erp-form-aside {
        grid-column: auto;
    }

    .erp-form-aside {
        margin-top: var(--erp-space-4);
    }

    .erp-list-card-grid {
        display: grid;
        gap: var(--erp-space-3);
    }

    .erp-table-wrap.has-mobile-cards {
        display: none;
    }

    .erp-mobile-list-card-metrics {
        grid-template-columns: 1fr;
    }

    .erp-repeater-row,
    .sku-bundle-component-row {
        grid-template-columns: 1fr;
    }

    .sku-bundle-component-action {
        justify-content: flex-start;
        padding-block-end: 0;
    }
}

/* Enterprise Next admin shell */
:root {
    --erp-color-background: #f6f7fb;
    --erp-color-surface-container-lowest: #ffffff;
    --erp-color-surface-container-low: #f1f4fa;
    --erp-color-surface-container: #e9eef7;
    --erp-color-surface-container-high: #e2e8f3;
    --erp-color-surface-container-highest: #dbe3ef;
    --erp-color-on-surface: #172033;
    --erp-color-on-surface-variant: #4b5872;
    --erp-color-outline: #707b91;
    --erp-color-outline-variant: #c7cfdd;
    --erp-bg: var(--erp-color-background);
    --erp-bg-subtle: var(--erp-color-surface-container-low);
    --erp-surface: var(--erp-color-surface-container-lowest);
    --erp-surface-muted: var(--erp-color-surface-container-low);
    --erp-surface-level-0: var(--erp-color-background);
    --erp-surface-level-1: var(--erp-color-surface-container-lowest);
    --erp-surface-level-2: var(--erp-color-surface-container-lowest);
    --erp-text: var(--erp-color-on-surface);
    --erp-text-muted: var(--erp-color-on-surface-variant);
    --erp-text-soft: var(--erp-color-outline);
    --erp-border: var(--erp-color-outline-variant);
    --erp-border-strong: var(--erp-color-outline);
    --erp-sidebar-expanded-width: 304px;
    --erp-sidebar-width: var(--erp-sidebar-expanded-width);
    --erp-sidebar-bg: #ffffff;
    --erp-sidebar-bg-soft: #f1f4fa;
    --erp-sidebar-border: #c7cfdd;
    --erp-sidebar-text: #344056;
    --erp-sidebar-muted: #667085;
    --erp-radius-default: .25rem;
    --erp-radius-md: .375rem;
    --erp-radius-lg: .5rem;
    --erp-radius-xl: .75rem;
    --erp-shadow-xs: 0 1px 2px color-mix(in srgb, var(--erp-text) 8%, transparent);
    --erp-shadow-sm: 0 1px 3px color-mix(in srgb, var(--erp-text) 10%, transparent);
    --erp-shadow-md: 0 14px 32px color-mix(in srgb, var(--erp-text) 14%, transparent);
}

:root[data-theme-mode="dark"] {
    --erp-color-background: #111827;
    --erp-color-surface-container-lowest: #182131;
    --erp-color-surface-container-low: #202b3d;
    --erp-color-surface-container: #293548;
    --erp-color-surface-container-high: #344155;
    --erp-color-surface-container-highest: #3f4d62;
    --erp-color-on-surface: #f5f7fb;
    --erp-color-on-surface-variant: #d7deeb;
    --erp-color-outline: #aeb8c8;
    --erp-color-outline-variant: #3f4d62;
    --erp-sidebar-bg: #182131;
    --erp-sidebar-bg-soft: #202b3d;
    --erp-sidebar-border: #3f4d62;
    --erp-sidebar-text: #d7deeb;
    --erp-sidebar-muted: #aeb8c8;
}

:root .erp-main {
    background: linear-gradient(180deg, color-mix(in srgb, var(--erp-primary) 6%, var(--erp-bg)) 0, var(--erp-bg) 260px);
    padding: var(--erp-space-5);
}

:root .erp-page {
    display: grid;
    gap: var(--erp-space-4);
    max-width: 1680px;
}

:root .erp-topbar {
    align-items: center;
    background: color-mix(in srgb, var(--erp-surface) 96%, transparent);
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    gap: var(--erp-space-3);
    height: var(--erp-topbar-height);
    min-height: var(--erp-topbar-height);
    padding-block: 0;
    padding-inline: var(--erp-space-4);
    box-shadow: none;
}

:root .topbar-command-btn {
    background: var(--erp-surface-muted);
    color: var(--erp-primary);
}

:root .topbar-page-context {
    border-inline-start: 1px solid var(--erp-border);
    padding-inline-start: var(--erp-space-3);
}

:root .theme-selector {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: inline-flex;
    gap: var(--erp-space-1) !important;
    min-height: 36px;
    padding: 2px;
}

:root .theme-selector .form-select {
    background-color: transparent;
    border-color: transparent;
    min-height: 30px;
    padding-block: 2px;
}

:root .theme-selector .erp-icon-btn {
    background: var(--erp-surface);
    min-height: 30px;
    min-width: 30px;
}

:root .desktop-workspace-shell {
    background: var(--erp-sidebar-bg);
    box-shadow: var(--erp-shadow-xs);
}

:root .desktop-rail {
    background: var(--erp-surface-muted);
}

:root .desktop-rail-item {
    border: 1px solid transparent;
    border-radius: var(--erp-radius-md);
    min-height: 40px;
}

:root .desktop-rail-item.is-active {
    background: var(--erp-primary);
    color: var(--erp-primary-contrast);
}

:root .desktop-workspace-panel {
    gap: var(--erp-space-2);
    padding: var(--erp-space-3);
}

:root .company-switcher-trigger {
    background: var(--erp-surface-muted);
    border-color: var(--erp-border);
    border-radius: var(--erp-radius-lg);
    min-height: 44px;
}

:root .company-switcher-logo,
:root .company-switcher-option-logo {
    border-radius: var(--erp-radius-md);
    height: 30px;
    width: 30px;
}

:root .desktop-workspace-header {
    border-bottom: 1px solid var(--erp-border);
    padding-block: var(--erp-space-2);
}

:root .workspace-board {
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    padding: var(--erp-space-2);
}

:root .workspace-board-grid {
    gap: var(--erp-space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

:root .workspace-board-tile {
    background: var(--erp-surface);
    border-color: var(--erp-border);
    border-radius: var(--erp-radius-md);
    min-height: 56px;
    padding: var(--erp-space-2);
}

:root .workspace-board-tile:hover,
:root .workspace-board-tile:focus {
    background: var(--erp-primary-soft);
    border-color: color-mix(in srgb, var(--erp-primary) 30%, var(--erp-border));
    color: var(--erp-primary);
}

:root .desktop-nav-section {
    gap: var(--erp-space-1);
}

:root .desktop-nav-section h3 {
    color: var(--erp-text-soft);
    font-size: 11px;
    font-weight: 800;
    line-height: 16px;
    margin-block: var(--erp-space-2) var(--erp-space-1);
    text-transform: uppercase;
}

:root .desktop-nav-link {
    border: 1px solid transparent;
    border-radius: var(--erp-radius-md);
    min-height: 34px;
    padding: var(--erp-space-2);
}

:root .desktop-nav-link i:first-child {
    color: var(--erp-text-soft);
}

:root .desktop-nav-link:hover,
:root .desktop-nav-link.is-active,
:root .desktop-nav-link.is-ancestor-active {
    background: var(--erp-primary-soft);
    border-color: color-mix(in srgb, var(--erp-primary) 24%, transparent);
    color: var(--erp-primary);
}

:root .desktop-nav-link.is-active::before,
:root .desktop-nav-link.is-ancestor-active::before {
    inset-block: 7px;
    width: 2px;
}

:root .erp-page-header {
    align-items: flex-start;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-sm);
    gap: var(--erp-space-3);
    padding: var(--erp-space-4);
}

:root .erp-page-title {
    font-size: var(--erp-type-headline-md-size);
    line-height: var(--erp-type-headline-md-line);
}

:root .erp-page-subtitle {
    max-width: 72ch;
}

:root .erp-page-header > .d-flex,
:root .erp-card-header > .d-flex,
:root .erp-filter-bar > div:last-child {
    justify-content: flex-end;
}

:root .erp-filter-bar,
:root .erp-table-toolbar {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
    gap: var(--erp-space-2);
    padding: var(--erp-space-2);
}

:root .erp-filter-bar::before,
:root .erp-table-toolbar::before {
    align-items: center;
    background: var(--erp-primary-soft);
    border-radius: var(--erp-radius-md);
    color: var(--erp-primary);
    content: "\F52A";
    display: inline-flex;
    flex: 0 0 var(--erp-control-height);
    font-family: "bootstrap-icons";
    font-size: 14px;
    height: var(--erp-control-height);
    justify-content: center;
    width: var(--erp-control-height);
}

:root .erp-card,
:root .card,
:root .modal-content {
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
}

:root .erp-card-header,
:root .card-header,
:root .modal-header {
    background: var(--erp-surface);
    border-bottom: 1px solid var(--erp-border);
    padding: var(--erp-space-3) var(--erp-space-4);
}

:root .erp-card-title,
:root .card-title,
:root .modal-title {
    color: var(--erp-text);
    font-size: var(--erp-type-title-sm-size);
    font-weight: var(--erp-type-title-sm-weight);
    line-height: var(--erp-type-title-sm-line);
}

:root .erp-card-body,
:root .card-body,
:root .modal-body {
    padding: var(--erp-space-4);
}

:root .modal-footer {
    background: var(--erp-surface-muted);
    border-top: 1px solid var(--erp-border);
    padding: var(--erp-space-3) var(--erp-space-4);
}

:root .form-label,
:root label {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-md-size);
    font-weight: var(--erp-type-label-md-weight);
}

:root .form-control,
:root .form-select,
:root .input-group-text {
    background-color: var(--erp-surface);
    border-color: var(--erp-border);
    border-radius: var(--erp-radius-default);
}

:root .input-group {
    border-radius: var(--erp-radius-default);
}

:root .input-group-text {
    color: var(--erp-text-soft);
}

:root .dropdown-menu,
:root .autocomplete-menu,
:root .company-switcher-menu {
    background: var(--erp-surface-level-2);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-md);
}

:root .dropdown-item {
    border-radius: var(--erp-radius-md);
    color: var(--erp-text);
    min-height: 32px;
}

:root .dropdown-item:hover,
:root .dropdown-item:focus,
:root .dropdown-item.active {
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
}

:root .btn {
    box-shadow: none !important;
}

:root .btn-primary {
    font-weight: 700;
}

:root .btn-outline-danger,
:root .btn-danger {
    margin-inline-start: var(--erp-space-1);
}

:root .btn-group,
:root .action-group {
    gap: var(--erp-space-1);
}

:root .btn-group > .btn {
    border-radius: var(--erp-radius-default) !important;
}

:root .erp-icon-btn,
:root .erp-row-action,
:root .branch-action,
:root .org-action,
:root .employee-action,
:root .employee-lookup-action,
:root .shift-action {
    min-width: var(--erp-control-height);
}

:root .erp-table-wrap {
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
}

:root .erp-table,
:root .table {
    --bs-table-bg: var(--erp-surface);
    --bs-table-color: var(--erp-text);
    --bs-table-border-color: var(--erp-border);
    --bs-table-hover-bg: color-mix(in srgb, var(--erp-primary) 7%, var(--erp-surface));
    font-size: var(--erp-type-body-sm-size);
}

:root .erp-table thead th,
:root .table thead th {
    background: var(--erp-surface-muted);
    border-bottom: 1px solid var(--erp-border-strong);
    color: var(--erp-text-muted);
    height: 34px;
    padding: var(--erp-space-2) var(--erp-space-3);
}

:root .erp-table tbody td,
:root .table tbody td {
    height: var(--erp-row-height-compact);
    padding: var(--erp-space-2) var(--erp-space-3);
}

:root .erp-table tbody tr,
:root .table tbody tr {
    transition: background var(--erp-transition-fast);
}

:root .erp-table tbody tr:hover,
:root .table tbody tr:hover {
    background: var(--bs-table-hover-bg);
}

:root .pagination {
    gap: var(--erp-space-1);
    margin-bottom: 0;
}

:root .page-link {
    background: var(--erp-surface);
    border-color: var(--erp-border);
    border-radius: var(--erp-radius-default);
    color: var(--erp-text-muted);
    min-height: var(--erp-control-height-sm);
}

:root .page-item.active .page-link {
    background: var(--erp-primary);
    border-color: var(--erp-primary);
    color: var(--erp-primary-contrast);
}

:root .erp-status-chip,
:root .badge {
    min-height: 20px;
}

:root .command-palette {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-xl);
    box-shadow: var(--erp-shadow-md);
}

:root .command-palette-search {
    background: var(--erp-surface-muted);
    border-bottom: 1px solid var(--erp-border);
}

:root .command-result {
    border: 1px solid transparent;
    border-radius: var(--erp-radius-lg);
}

:root .command-result:hover,
:root .command-result.is-selected {
    background: var(--erp-primary-soft);
    border-color: color-mix(in srgb, var(--erp-primary) 24%, transparent);
}

:root .more-hub,
:root .mobile-action-bar {
    border-color: var(--erp-border);
    box-shadow: var(--erp-shadow-md);
}

:root .mobile-action-bar-item.is-active,
:root .mobile-action-bar-item:hover,
:root .mobile-action-bar-item:focus {
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
}

@media (max-width: 991.98px) {
    :root .erp-main {
        padding: var(--erp-space-3);
    }

    :root .erp-page {
        gap: var(--erp-space-3);
    }

    :root .erp-page-header,
    :root .erp-filter-bar,
    :root .erp-card-header {
        align-items: stretch;
    }

    :root .theme-selector {
        max-inline-size: 100%;
    }

}

:root .enterprise-nav-shell {
    background: var(--erp-surface);
    border-inline-end: 1px solid var(--erp-border);
    display: flex;
    flex: 0 0 340px;
    height: 100vh;
    min-width: 340px;
}

:root .enterprise-app-switcher {
    background: var(--erp-surface-muted);
    border-inline-end: 1px solid var(--erp-border);
    display: flex;
    flex: 0 0 72px;
    flex-direction: column;
    gap: var(--erp-space-2);
    min-width: 72px;
    padding: var(--erp-space-3) var(--erp-space-2);
}

:root .enterprise-app-list {
    display: grid;
    gap: var(--erp-space-1);
    min-height: 0;
    overflow-y: auto;
}

:root .enterprise-app-button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text-muted);
    display: grid;
    gap: var(--erp-space-1);
    justify-items: center;
    min-height: 54px;
    padding: var(--erp-space-1);
    text-align: center;
}

:root .enterprise-app-button i {
    font-size: 18px;
    line-height: 1;
}

:root .enterprise-app-button span {
    font-size: 10px;
    font-weight: 700;
    line-height: 12px;
    max-inline-size: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root .enterprise-app-button:hover,
:root .enterprise-app-button:focus,
:root .enterprise-app-button.is-active {
    background: var(--erp-primary);
    border-color: var(--erp-primary);
    color: var(--erp-primary-contrast);
}

:root .enterprise-command-button {
    background: var(--erp-surface);
    color: var(--erp-primary);
}

:root .enterprise-nav-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--erp-space-3);
    min-width: 0;
    padding: var(--erp-space-3);
}

:root .enterprise-workspace-header {
    align-items: center;
    display: flex;
    gap: var(--erp-space-2);
    justify-content: space-between;
}

:root .enterprise-workspace-header div {
    display: grid;
    min-width: 0;
}

:root .enterprise-workspace-header span,
:root .enterprise-section-header small {
    color: var(--erp-text-soft);
    font-size: 11px;
    font-weight: 800;
    line-height: 14px;
    text-transform: uppercase;
}

:root .enterprise-workspace-header strong {
    color: var(--erp-text);
    font-size: var(--erp-type-title-sm-size);
    line-height: var(--erp-type-title-sm-line);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root .enterprise-nav-search {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: flex;
    gap: var(--erp-space-2);
    padding: var(--erp-space-1) var(--erp-space-2);
}

:root .enterprise-nav-search > i {
    color: var(--erp-text-soft);
}

:root .enterprise-nav-search .form-control {
    background: transparent;
    border: 0;
    box-shadow: none;
    min-height: var(--erp-control-height-sm);
    padding-inline: 0;
}

:root .enterprise-section-list {
    display: grid;
    gap: var(--erp-space-2);
    min-height: 0;
    overflow-y: auto;
    padding-inline-end: var(--erp-space-1);
}

:root .enterprise-nav-section {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    background: var(--erp-surface);
}

:root .enterprise-nav-section.is-functional-area {
    transition: background var(--erp-transition-fast), border-color var(--erp-transition-fast), box-shadow var(--erp-transition-fast);
}

:root .enterprise-nav-section.is-open-functional-area {
    background: color-mix(in srgb, var(--erp-primary) 5%, var(--erp-surface-level-1));
    border-color: color-mix(in srgb, var(--erp-primary) 28%, var(--erp-border-strong));
    box-shadow: var(--erp-shadow-sm);
    padding: var(--erp-space-1);
}

:root .enterprise-nav-section.is-open-functional-area > .enterprise-section-list {
    padding: 0 var(--erp-space-1) var(--erp-space-1);
}

:root .enterprise-section-header {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-2);
    min-height: 44px;
    padding: var(--erp-space-2);
    text-align: start;
    width: 100%;
}

:root .enterprise-section-icon {
    align-items: center;
    background: var(--erp-surface-muted);
    border-radius: var(--erp-radius-md);
    color: var(--erp-primary);
    display: inline-flex;
    flex: 0 0 28px;
    height: 28px;
    justify-content: center;
    width: 28px;
}

:root .enterprise-section-header > span:nth-child(2) {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

:root .enterprise-section-header strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root .enterprise-section-chevron {
    color: var(--erp-text-soft);
    flex: 0 0 auto;
}

:root .enterprise-link-list {
    border-top: 1px solid var(--erp-border);
    display: grid;
    gap: var(--erp-space-1);
    padding: var(--erp-space-1);
}

:root .enterprise-link-row {
    align-items: center;
    display: flex;
    gap: var(--erp-space-1);
}

:root .enterprise-link-row.depth-1 {
    padding-inline-start: var(--erp-space-2);
}

:root .enterprise-link-row.depth-2,
:root .enterprise-link-row.depth-3,
:root .enterprise-link-row.depth-4 {
    padding-inline-start: var(--erp-space-4);
}

:root .enterprise-nav-link {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-md);
    color: var(--erp-text-muted);
    display: flex;
    flex: 1 1 auto;
    gap: var(--erp-space-2);
    min-height: 34px;
    min-width: 0;
    padding: var(--erp-space-1) var(--erp-space-2);
    text-align: start;
}

:root .enterprise-nav-link i {
    color: var(--erp-text-soft);
    flex: 0 0 auto;
}

:root .enterprise-nav-link span {
    display: grid;
    min-width: 0;
}

:root .enterprise-nav-link strong,
:root .enterprise-nav-link small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root .enterprise-nav-link strong {
    color: var(--erp-text);
    font-size: var(--erp-type-body-sm-size);
    line-height: var(--erp-type-body-sm-line);
}

:root .enterprise-nav-link small {
    color: var(--erp-text-soft);
    font-size: 11px;
    line-height: 14px;
}

:root .enterprise-nav-link:hover,
:root .enterprise-nav-link:focus,
:root .enterprise-nav-link.is-active {
    background: var(--erp-primary-soft);
    border-color: color-mix(in srgb, var(--erp-primary) 24%, transparent);
    color: var(--erp-primary);
}

:root .enterprise-nav-link.is-active {
    border-inline-start: 3px solid var(--erp-primary);
}

:root .enterprise-favorite-toggle {
    align-items: center;
    border: 0;
    border-radius: var(--erp-radius-md);
    color: var(--erp-text-soft);
    display: inline-flex;
    flex: 0 0 30px;
    height: 30px;
    justify-content: center;
    padding: 0;
}

:root .enterprise-favorite-toggle.is-active {
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
}

:root .enterprise-nav-empty {
    align-items: center;
    border: 1px dashed var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text-muted);
    display: grid;
    gap: var(--erp-space-1);
    justify-items: center;
    padding: var(--erp-space-6);
    text-align: center;
}

:root .enterprise-topbar-context {
    display: grid;
    gap: var(--erp-space-1);
    max-inline-size: 100%;
    min-width: 0;
}

:root .enterprise-app-pill {
    align-items: center;
    background: var(--erp-primary-soft);
    border: 1px solid color-mix(in srgb, var(--erp-primary) 18%, transparent);
    border-radius: var(--erp-radius-full);
    color: var(--erp-primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    gap: var(--erp-space-1);
    min-height: 28px;
    padding: var(--erp-space-1) var(--erp-space-2);
}

:root .enterprise-context-trail {
    align-items: center;
    color: var(--erp-text-soft);
    display: flex;
    flex-wrap: nowrap;
    font-size: 12px;
    gap: var(--erp-space-1);
    list-style: none;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
}

:root .enterprise-context-trail li {
    align-items: center;
    display: inline-flex;
    flex: 0 1 auto;
    gap: var(--erp-space-1);
    max-inline-size: 170px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root .enterprise-context-trail .enterprise-workspace-crumb {
    flex: 0 0 auto;
    max-inline-size: none;
    overflow: visible;
}

:root .enterprise-workspace-crumb .enterprise-app-pill {
    font-size: 11px;
    min-height: 24px;
    padding-block: 2px;
}

:root .enterprise-context-trail li:not(:last-child)::after {
    color: var(--erp-text-soft);
    content: "/";
}

:root .enterprise-context-trail li.is-current {
    color: var(--erp-text);
    font-weight: 800;
}

:root .more-hub-controls {
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    padding: var(--erp-space-2);
}

:root .more-hub-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

:root .more-module-card {
    border-radius: var(--erp-radius-lg);
    box-shadow: none;
}

@media (max-width: 991.98px) {
    :root .enterprise-nav-shell {
        display: none;
    }
}

@media (max-width: 767.98px) {
    :root .enterprise-app-pill {
        max-inline-size: 132px;
    }

    :root .enterprise-app-pill,
    :root .enterprise-context-trail li {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

:root {
    --fluent-flow-primary: #1b365d;
    --fluent-flow-primary-soft: color-mix(in srgb, var(--fluent-flow-primary) 10%, var(--erp-surface));
    --fluent-flow-primary-contrast: #ffffff;
    --fluent-flow-secondary: #006a6a;
    --fluent-flow-secondary-soft: #e0f7fa;
    --fluent-flow-chat-bg: #f1f4f9;
    --fluent-flow-panel: var(--erp-surface);
    --fluent-flow-border: var(--erp-border);
    --fluent-flow-rail-width: 260px;
    --fluent-flow-context-width: 320px;
}

.fluent-flow-shell {
    --erp-bg: var(--fluent-flow-chat-bg);
}

.fluent-flow-shell .erp-main {
    background: var(--fluent-flow-chat-bg);
    padding: var(--erp-space-6);
}

.fluent-flow-navigation {
    align-items: stretch;
    background: var(--fluent-flow-chat-bg);
    block-size: 100vh;
    block-size: 100dvh;
    box-sizing: border-box;
    color: var(--erp-text);
    display: flex;
    flex: 0 0 calc(var(--fluent-flow-rail-width) + var(--fluent-flow-context-width));
    gap: var(--erp-space-4);
    max-block-size: 100vh;
    max-block-size: 100dvh;
    max-width: calc(var(--fluent-flow-rail-width) + var(--fluent-flow-context-width));
    min-block-size: 0;
    min-height: 0;
    overflow: hidden;
    padding: var(--erp-space-4);
}

.fluent-flow-mobile-backdrop,
.fluent-flow-mobile-close {
    display: none;
}

.fluent-flow-rail {
    background: var(--fluent-flow-primary);
    block-size: 100%;
    border-radius: var(--erp-radius-xl);
    box-shadow: var(--erp-shadow-md);
    box-sizing: border-box;
    color: var(--fluent-flow-primary-contrast);
    display: flex;
    flex: 0 0 var(--fluent-flow-rail-width);
    flex-direction: column;
    max-block-size: 100%;
    min-block-size: 0;
    min-width: 0;
    overflow: hidden;
    padding: var(--erp-space-5);
}

.fluent-flow-brand {
    align-items: center;
    display: flex;
    gap: var(--erp-space-3);
    margin-block-end: var(--erp-space-6);
    min-width: 0;
}

.fluent-flow-brand-mark {
    align-items: center;
    background: var(--fluent-flow-primary-contrast);
    border-radius: var(--erp-radius-lg);
    color: var(--fluent-flow-primary);
    display: inline-flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.fluent-flow-brand strong,
.fluent-flow-brand small,
.fluent-flow-bubble-header strong,
.fluent-flow-bubble-header small,
.fluent-flow-journey-header span,
.fluent-flow-link strong,
.fluent-flow-link small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fluent-flow-brand strong {
    font-size: var(--erp-font-size-xl);
    line-height: 1.2;
}

.fluent-flow-brand small {
    color: color-mix(in srgb, var(--fluent-flow-primary-contrast) 72%, transparent);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fluent-flow-new-request {
    align-items: center;
    background: var(--fluent-flow-secondary-soft);
    border: 0;
    border-radius: var(--erp-radius-lg);
    color: var(--fluent-flow-secondary);
    display: inline-flex;
    font-weight: 700;
    gap: var(--erp-space-2);
    justify-content: center;
    margin-block-end: var(--erp-space-5);
    min-height: 44px;
    padding-inline: var(--erp-space-4);
}

.fluent-flow-workspaces {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--erp-space-1);
    min-height: 0;
    overflow-y: auto;
    padding-inline-end: var(--erp-space-1);
}

.fluent-flow-workspace {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--erp-radius-lg);
    color: color-mix(in srgb, var(--fluent-flow-primary-contrast) 72%, transparent);
    display: flex;
    font-weight: 700;
    gap: var(--erp-space-3);
    min-height: 44px;
    padding-block: var(--erp-space-2);
    padding-inline: var(--erp-space-3);
    text-align: start;
    transition: background var(--erp-transition-fast), color var(--erp-transition-fast);
    width: 100%;
}

.fluent-flow-workspace i {
    font-size: 1.1rem;
}

.fluent-flow-workspace:hover,
.fluent-flow-workspace:focus-visible {
    background: color-mix(in srgb, var(--fluent-flow-primary-contrast) 12%, transparent);
    color: var(--fluent-flow-primary-contrast);
}

.fluent-flow-workspace.is-active {
    background: var(--fluent-flow-secondary-soft);
    color: var(--fluent-flow-secondary);
}

.fluent-flow-more {
    margin-block-start: var(--erp-space-4);
}

.fluent-flow-context {
    background: color-mix(in srgb, var(--fluent-flow-panel) 92%, transparent);
    block-size: 100%;
    border: 1px solid var(--fluent-flow-border);
    border-radius: var(--erp-radius-xl);
    box-shadow: var(--erp-shadow-sm);
    box-sizing: border-box;
    display: grid;
    flex: 0 0 var(--fluent-flow-context-width);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    max-block-size: 100%;
    min-block-size: 0;
    min-width: 0;
    overflow: hidden;
    padding-block: var(--erp-space-4);
    padding-inline: var(--erp-space-5);
}

.fluent-flow-context-header {
    border-block-end: 1px solid var(--erp-border);
    margin-block: var(--erp-space-3);
    padding-block-end: var(--erp-space-3);
}

.fluent-flow-context-header span,
.fluent-flow-journey-header small {
    color: var(--erp-text-muted);
    display: block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fluent-flow-context-header strong {
    color: var(--fluent-flow-primary);
    display: block;
    font-size: var(--erp-type-headline-md-size);
    line-height: var(--erp-type-headline-md-line);
}

.fluent-flow-search {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: flex;
    gap: var(--erp-space-2);
    margin-block-end: var(--erp-space-3);
    padding-inline: var(--erp-space-3);
}

.fluent-flow-search i {
    color: var(--erp-text-muted);
}

.fluent-flow-search .form-control {
    background: transparent;
    border: 0;
    box-shadow: none;
    min-height: 42px;
    padding-inline: 0;
}

.fluent-flow-search:focus-within {
    border-color: var(--fluent-flow-secondary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fluent-flow-secondary) 18%, transparent);
}

.fluent-flow-thread {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--erp-space-2);
    min-block-size: 0;
    min-height: 0;
    overscroll-behavior: contain;
    overflow-x: hidden;
    overflow-y: auto;
    padding-block: 0 var(--erp-space-8);
    padding-inline: 0 var(--erp-space-1);
    scrollbar-color: var(--erp-border-strong) transparent;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
}

.fluent-flow-bubble,
.fluent-flow-empty {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
}

.fluent-flow-bubble.is-active {
    background: color-mix(in srgb, var(--fluent-flow-secondary) 5%, var(--erp-surface));
    border-color: color-mix(in srgb, var(--fluent-flow-secondary) 34%, var(--erp-border));
    box-shadow: var(--erp-shadow-xs);
}

.fluent-flow-bubble-header,
.fluent-flow-journey-header {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-3);
    min-height: 56px;
    padding-block: var(--erp-space-2);
    padding-inline: var(--erp-space-3);
    text-align: start;
    width: 100%;
}

.fluent-flow-bubble-header > span:not(.fluent-flow-bubble-icon),
.fluent-flow-journey-header span {
    flex: 1;
    min-width: 0;
}

.fluent-flow-bubble-header small,
.fluent-flow-link small {
    color: var(--erp-text-muted);
    font-size: .76rem;
    font-weight: 500;
}

.fluent-flow-bubble-icon {
    align-items: center;
    background: var(--erp-surface-muted);
    border-radius: var(--erp-radius-md);
    color: var(--fluent-flow-primary);
    display: inline-flex;
    flex: 0 0 36px;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.fluent-flow-bubble-body,
.fluent-flow-links {
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-1);
    padding-block: 0 var(--erp-space-3);
    padding-inline: var(--erp-space-3);
}

.fluent-flow-journey {
    background: color-mix(in srgb, var(--erp-surface-muted) 68%, var(--erp-surface));
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    overflow: hidden;
}

.fluent-flow-journey-header {
    padding-block: var(--erp-space-2);
    padding-inline: var(--erp-space-3);
}

.fluent-flow-link-row {
    align-items: center;
    display: flex;
    gap: var(--erp-space-2);
    min-width: 0;
}

.fluent-flow-link {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--erp-radius-md);
    color: var(--erp-text);
    display: flex;
    flex: 1;
    gap: var(--erp-space-3);
    min-height: 38px;
    min-width: 0;
    padding-block: var(--erp-space-2);
    padding-inline: var(--erp-space-3);
    text-align: start;
}

.fluent-flow-link i {
    color: var(--fluent-flow-secondary);
    flex: 0 0 auto;
}

.fluent-flow-link:hover,
.fluent-flow-link:focus-visible,
.fluent-flow-link.is-active {
    background: var(--fluent-flow-secondary-soft);
    border-color: color-mix(in srgb, var(--fluent-flow-secondary) 22%, transparent);
    color: var(--fluent-flow-secondary);
}

.fluent-flow-link.is-active {
    border-inline-start: 3px solid var(--fluent-flow-secondary);
}

.fluent-flow-favorite {
    align-items: center;
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text-muted);
    display: inline-flex;
    flex: 0 0 36px;
    height: 36px;
    justify-content: center;
    padding: 0;
    width: 36px;
}

.fluent-flow-favorite.is-active {
    color: var(--erp-warning);
}

.fluent-flow-empty {
    align-items: center;
    color: var(--erp-text-muted);
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-2);
    padding: var(--erp-space-6);
    text-align: center;
}

.fluent-flow-empty i {
    color: var(--fluent-flow-secondary);
    font-size: 1.5rem;
}

.fluent-flow-empty strong {
    color: var(--erp-text);
}

.guided-workspace-page {
    background: var(--fluent-flow-chat-bg);
    min-height: 100%;
    padding-block: var(--erp-space-3);
    padding-inline: var(--erp-space-4);
}

.guided-chat-surface {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--erp-topbar-height, 64px) - var(--erp-space-6));
    overflow: visible;
}

.guided-chat-topbar {
    align-items: center;
    background: transparent;
    border-block-end: 1px solid color-mix(in srgb, var(--erp-border) 70%, transparent);
    display: flex;
    gap: var(--erp-space-3);
    justify-content: space-between;
    padding-block: 0 var(--erp-space-3);
    padding-inline: 0;
}

.guided-chat-topbar div:first-child {
    display: grid;
    gap: var(--erp-space-1);
    min-width: 0;
}

.guided-chat-topbar span {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-size);
    font-weight: 700;
    text-transform: uppercase;
}

.guided-chat-topbar strong {
    color: var(--fluent-flow-primary);
    font-size: var(--erp-type-title-sm-size);
}

.guided-chat-layout {
    display: grid;
    flex: 1 1 auto;
    gap: var(--erp-space-4);
    grid-template-columns: minmax(0, 1fr) clamp(260px, 23vw, 320px);
    min-height: 0;
    padding-block-start: var(--erp-space-4);
}

.guided-workspace-page[dir="rtl"] .guided-chat-layout {
    grid-template-columns: clamp(260px, 23vw, 320px) minmax(0, 1fr);
}

.guided-chat-layout.is-full-width {
    grid-template-columns: minmax(0, 1fr);
}

.guided-chat-layout.is-full-width .guided-chat-thread {
    grid-column: 1;
}

.guided-workspace-page[dir="ltr"] .guided-chat-layout.has-draft-panel .guided-chat-thread {
    grid-column: 1;
}

.guided-workspace-page[dir="ltr"] .guided-chat-layout.has-draft-panel .guided-draft-panel {
    grid-column: 2;
}

.guided-workspace-page[dir="rtl"] .guided-chat-layout.has-draft-panel .guided-chat-thread {
    grid-column: 2;
}

.guided-workspace-page[dir="rtl"] .guided-chat-layout.has-draft-panel .guided-draft-panel {
    grid-column: 1;
}

.guided-chat-thread {
    background: color-mix(in srgb, var(--erp-surface) 46%, transparent);
    border: 1px solid color-mix(in srgb, var(--erp-border) 70%, transparent);
    border-radius: var(--erp-radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-4);
    min-width: 0;
    overflow: visible;
    padding: var(--erp-space-4);
}

.guided-message {
    align-items: flex-start;
    display: flex;
    gap: var(--erp-space-3);
    max-width: min(760px, 86%);
}

.guided-message.is-user {
    align-self: flex-end;
}

.guided-message-avatar {
    align-items: center;
    background: var(--fluent-flow-secondary-soft);
    border: 1px solid color-mix(in srgb, var(--fluent-flow-secondary) 24%, transparent);
    border-radius: var(--erp-radius-full);
    color: var(--fluent-flow-secondary);
    display: inline-flex;
    flex: 0 0 36px;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.guided-message-stack {
    display: grid;
    min-width: 0;
}

.guided-message-stack small {
    display: none;
}

.guided-message-bubble {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text);
    font-size: var(--erp-type-body-size);
    line-height: var(--erp-type-body-line-height);
    padding: var(--erp-space-3) var(--erp-space-4);
}

.guided-message.is-system .guided-message-bubble {
    border-start-start-radius: var(--erp-radius-sm);
}

.guided-message.is-user .guided-message-bubble {
    background: var(--fluent-flow-primary);
    border-color: var(--fluent-flow-primary);
    border-start-end-radius: var(--erp-radius-sm);
    color: var(--fluent-flow-primary-contrast);
}

.guided-action-grid,
.guided-area-grid {
    display: grid;
    gap: var(--erp-space-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-width: 920px;
}

.guided-action-card,
.guided-area-card {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-3);
    min-height: 96px;
    padding: var(--erp-space-4);
    text-align: start;
    transition: background var(--erp-transition-fast), border-color var(--erp-transition-fast), color var(--erp-transition-fast);
}

.guided-action-card:not(:disabled):hover,
.guided-action-card:not(:disabled):focus-visible,
.guided-area-card:not(:disabled):hover,
.guided-area-card:not(:disabled):focus-visible {
    background: var(--fluent-flow-secondary-soft);
    border-color: color-mix(in srgb, var(--fluent-flow-secondary) 34%, var(--erp-border));
    color: var(--fluent-flow-secondary);
}

.guided-action-card:disabled,
.guided-area-card:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.guided-action-card i,
.guided-area-card i {
    align-items: center;
    background: color-mix(in srgb, var(--fluent-flow-primary) 10%, var(--erp-surface));
    border-radius: var(--erp-radius-md);
    color: var(--fluent-flow-primary);
    display: inline-flex;
    flex: 0 0 44px;
    font-size: 1.2rem;
    height: 44px;
    justify-content: center;
}

.guided-action-card span,
.guided-area-card span {
    display: grid;
    gap: var(--erp-space-1);
    min-width: 0;
}

.guided-action-card small,
.guided-area-card small {
    color: var(--erp-text-muted);
}

.guided-current-step,
.guided-flow-actions,
.guided-success-actions {
    max-width: min(920px, 100%);
}

.guided-current-step {
    background: color-mix(in srgb, var(--fluent-flow-chat-bg) 88%, var(--erp-surface));
    border: 1px solid color-mix(in srgb, var(--erp-border) 70%, transparent);
    border-radius: var(--erp-radius-lg);
    margin-block-start: auto;
    overflow: visible;
    padding: var(--erp-space-3);
}

.guided-message-bar {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-xl);
    display: flex;
    gap: var(--erp-space-2);
    padding: var(--erp-space-2);
}

.guided-message-bar .form-control {
    background: transparent;
    border: 0;
    min-height: 40px;
}

.guided-message-bar .form-control:focus {
    box-shadow: none;
}

.guided-selector-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: var(--erp-space-3);
    overflow: visible;
    padding: 0;
}

.guided-review-panel {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    display: grid;
    gap: var(--erp-space-3);
    padding: var(--erp-space-4);
}

.guided-choice-grid {
    display: grid;
    gap: var(--erp-space-2);
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    max-width: 920px;
}

.guided-choice-card {
    align-items: flex-start;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    color: var(--erp-text);
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-1);
    min-height: 64px;
    padding: var(--erp-space-3);
    text-align: start;
}

.guided-choice-card:hover,
.guided-choice-card:focus-visible,
.guided-choice-card.is-default {
    background: var(--fluent-flow-primary-soft);
    border-color: color-mix(in srgb, var(--fluent-flow-primary) 34%, var(--erp-border));
}

.guided-choice-card small {
    color: var(--fluent-flow-primary);
    font-size: var(--erp-font-size-xs);
    font-weight: 700;
}

.guided-edit-field {
    justify-self: end;
    white-space: nowrap;
}

.guided-flow-actions,
.guided-review-actions,
.guided-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
}

.guided-review-panel header,
.guided-draft-panel header {
    display: grid;
    gap: var(--erp-space-1);
}

.guided-review-panel header span,
.guided-draft-panel header span {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-size);
}

.guided-review-grid,
.guided-draft-list {
    display: grid;
    gap: var(--erp-space-2);
}

.guided-review-row,
.guided-draft-row,
.guided-draft-progress {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    display: flex;
    gap: var(--erp-space-2);
    justify-content: space-between;
    min-height: 40px;
    padding: var(--erp-space-2) var(--erp-space-3);
}

.guided-review-row span,
.guided-draft-row span,
.guided-draft-progress span {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-size);
    font-weight: 700;
}

.guided-review-row strong,
.guided-draft-row strong,
.guided-draft-progress strong {
    color: var(--erp-text);
    font-size: var(--erp-type-body-sm-size);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guided-review-row.is-missing,
.guided-draft-row.is-missing {
    background: var(--erp-surface-muted);
    border-color: var(--erp-border);
}

.guided-review-row.is-missing strong,
.guided-draft-row.is-missing strong {
    background: color-mix(in srgb, var(--erp-warning) 12%, var(--erp-surface));
    border: 1px solid color-mix(in srgb, var(--erp-warning) 34%, var(--erp-border));
    border-radius: var(--erp-radius-full);
    color: var(--erp-warning);
    flex: 0 0 auto;
    font-size: var(--erp-font-size-xs);
    line-height: 1;
    padding-block: var(--erp-space-1);
    padding-inline: var(--erp-space-2);
}

.guided-draft-panel {
    background: var(--erp-surface);
    border: 1px solid color-mix(in srgb, var(--erp-border) 80%, transparent);
    border-radius: var(--erp-radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-4);
    min-width: 0;
    overflow: visible;
    padding: var(--erp-space-4);
}

.guided-draft-warning {
    align-items: center;
    background: color-mix(in srgb, var(--erp-warning) 10%, var(--erp-surface));
    border: 1px solid color-mix(in srgb, var(--erp-warning) 38%, var(--erp-border));
    border-radius: var(--erp-radius-md);
    color: var(--erp-warning);
    display: flex;
    gap: var(--erp-space-2);
    padding: var(--erp-space-3);
}

@media (max-width: 1199.98px) {
    .fluent-flow-navigation {
        block-size: 100vh;
        block-size: 100dvh;
        flex-basis: calc(var(--fluent-flow-rail-width) + var(--fluent-flow-context-width));
        max-width: calc(var(--fluent-flow-rail-width) + var(--fluent-flow-context-width));
        padding: var(--erp-space-3);
    }

    .fluent-flow-rail {
        flex-basis: var(--fluent-flow-rail-width);
        padding: var(--erp-space-4);
    }

    .fluent-flow-brand {
        margin-block-end: var(--erp-space-4);
    }
}

@media (max-width: 991.98px) {
    .fluent-flow-mobile-backdrop {
        background: color-mix(in srgb, var(--erp-text) 42%, transparent);
        border: 0;
        display: block;
        inset: var(--erp-topbar-height) 0 74px;
        padding: 0;
        position: fixed;
        z-index: 1019;
    }

    .fluent-flow-navigation {
        block-size: auto;
        display: none;
        flex-basis: auto;
        flex-direction: column;
        gap: var(--erp-space-3);
        inset-block: var(--erp-topbar-height) 74px;
        inset-inline: 0;
        max-block-size: none;
        max-width: none;
        min-block-size: 0;
        min-height: 0;
        padding: var(--erp-space-3);
        position: fixed;
        overflow: hidden;
        width: 100%;
        z-index: 1020;
    }

    .fluent-flow-navigation.is-mobile-open {
        display: flex;
    }

    .fluent-flow-shell .erp-main {
        padding-block-end: calc(var(--erp-space-8) + 72px);
    }

    .fluent-flow-rail {
        border-radius: var(--erp-radius-lg);
        flex: 0 0 auto;
        max-height: 176px;
        padding: var(--erp-space-3);
        width: 100%;
    }

    .fluent-flow-brand {
        display: none;
    }

    .fluent-flow-new-request {
        margin-block-end: var(--erp-space-3);
        min-height: 40px;
    }

    .fluent-flow-new-request span,
    .fluent-flow-workspace span {
        display: block;
    }

    .fluent-flow-workspaces {
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-block-end: var(--erp-space-1);
        padding-inline-end: 0;
    }

    .fluent-flow-workspace {
        flex: 0 0 auto;
        flex-direction: column;
        font-size: .72rem;
        gap: var(--erp-space-1);
        justify-content: center;
        min-height: 58px;
        min-width: 76px;
        padding-inline: var(--erp-space-2);
        text-align: center;
        width: auto;
    }

    .fluent-flow-more {
        margin-block-start: 0;
    }

    .fluent-flow-context {
        display: grid;
        flex: 1 1 auto;
        grid-template-rows: auto auto auto minmax(0, 1fr);
        max-block-size: 100%;
        min-block-size: 0;
        min-height: 0;
        padding-block: var(--erp-space-3);
        padding-inline: var(--erp-space-4);
        position: relative;
        width: 100%;
    }

    .fluent-flow-mobile-close {
        display: inline-flex;
        position: absolute;
        inset-block-start: var(--erp-space-3);
        inset-inline-end: var(--erp-space-3);
        z-index: 1;
    }

    .fluent-flow-context-header {
        margin-block: var(--erp-space-3);
        padding-inline-end: 42px;
    }

    .fluent-flow-thread {
        border-radius: var(--erp-radius-lg);
        padding-block-end: var(--erp-space-5);
        padding-inline: var(--erp-space-3);
    }

    .fluent-flow-bubble-header,
    .fluent-flow-journey-header,
    .fluent-flow-link {
        min-width: 0;
    }

    .guided-workspace-page {
        padding: 0;
    }

    .guided-chat-surface {
        border-radius: 0;
        min-height: calc(100vh - var(--erp-topbar-height, 64px));
    }

    .guided-chat-layout {
        display: block;
        padding-block-start: 0;
        overflow-y: auto;
    }

    .guided-chat-thread {
        background: transparent;
        border: 0;
        border-radius: 0;
        overflow: visible;
        padding: var(--erp-space-4);
    }

    .guided-draft-panel {
        border-block-start: 1px solid var(--erp-border);
        border-inline: 0;
        border-radius: 0;
    }

    .guided-message {
        max-width: 100%;
    }
}

/* UI/UX redesign pilot: reusable shell and HR workflow refinements. */
:root .enterprise-topbar-context {
    min-width: 0;
}

:root .enterprise-context-trail {
    color: var(--erp-text-soft);
    font-size: var(--erp-type-label-md-size);
    margin-block: 0;
}

:root .enterprise-nav-section.is-open-functional-area {
    background: color-mix(in srgb, var(--erp-primary) 5%, var(--erp-surface));
    border: 1px solid color-mix(in srgb, var(--erp-primary) 18%, var(--erp-border));
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
}

:root .enterprise-section-header {
    min-height: 40px;
}

:root .hr-pilot-page,
:root .hr-dashboard-page {
    display: grid;
    gap: var(--erp-space-4);
}

:root .hr-pilot-stats,
:root .hr-dashboard-stats {
    display: grid;
    gap: var(--erp-space-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

:root .hr-dashboard-grid {
    display: grid;
    gap: var(--erp-space-4);
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
}

:root .hr-quick-grid,
:root .hr-access-list {
    display: grid;
    gap: var(--erp-space-2);
}

:root .hr-quick-action,
:root .hr-access-row {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    color: var(--erp-text);
    display: flex;
    gap: var(--erp-space-3);
    min-height: 56px;
    padding-block: var(--erp-space-3);
    padding-inline: var(--erp-space-3);
    text-decoration: none;
}

:root .hr-quick-action:hover,
:root .hr-quick-action:focus-visible {
    background: var(--erp-primary-soft);
    border-color: color-mix(in srgb, var(--erp-primary) 28%, var(--erp-border));
    color: var(--erp-primary);
}

:root .hr-quick-icon,
:root .hr-access-state {
    align-items: center;
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    display: inline-flex;
    flex: 0 0 36px;
    height: 36px;
    justify-content: center;
    width: 36px;
}

:root .hr-quick-action span:not(.hr-quick-icon),
:root .hr-access-row span:last-child {
    display: grid;
    gap: var(--erp-space-1);
    min-width: 0;
}

:root .hr-quick-action small,
:root .hr-access-row small {
    color: var(--erp-text-muted);
    font-size: var(--erp-type-label-md-size);
}

:root .hr-quick-arrow {
    margin-inline-start: auto;
}

:root .hr-access-state.is-allowed {
    background: color-mix(in srgb, var(--erp-success) 12%, var(--erp-surface));
    border-color: color-mix(in srgb, var(--erp-success) 28%, var(--erp-border));
    color: var(--erp-success);
}

:root .hr-access-state.is-muted {
    color: var(--erp-text-soft);
}

:root .hr-pilot-search,
:root .employee-lookup-search,
:root .org-search {
    align-items: center;
    display: flex;
    gap: var(--erp-space-2);
    min-width: min(100%, 320px);
}

:root .hr-pilot-search i,
:root .employee-lookup-search i,
:root .org-search i {
    color: var(--erp-text-soft);
}

:root .hr-pilot-page-size,
:root .employee-lookup-page-size,
:root .org-page-size {
    width: 88px;
}

:root .erp-value-pill {
    align-items: center;
    background: var(--erp-surface-muted);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-full);
    color: var(--erp-text);
    display: inline-flex;
    font-size: var(--erp-type-label-md-size);
    font-weight: 700;
    min-height: 24px;
    padding-block: var(--erp-space-1);
    padding-inline: var(--erp-space-2);
}

:root .erp-inline-edit-row > td {
    background: color-mix(in srgb, var(--erp-primary) 4%, var(--erp-surface));
}

:root .erp-inline-edit-panel,
:root .employee-lookup-edit-panel,
:root .org-edit-panel {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-xs);
    display: grid;
    gap: var(--erp-space-3);
    padding: var(--erp-space-4);
}

:root .erp-inline-edit-heading {
    align-items: start;
    display: flex;
    justify-content: space-between;
    gap: var(--erp-space-3);
}

:root .erp-inline-edit-heading span {
    color: var(--erp-text-muted);
    display: block;
    font-size: var(--erp-type-body-sm-size);
    margin-block-start: var(--erp-space-1);
}

:root .erp-inline-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
    justify-content: flex-end;
}

:root .erp-table-footer,
:root .employee-lookup-pagination {
    align-items: center;
    border-block-start: 1px solid var(--erp-border);
    color: var(--erp-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: var(--erp-space-2);
    justify-content: flex-end;
    margin-block-start: var(--erp-space-3);
    padding-block-start: var(--erp-space-3);
}

@media (max-width: 991.98px) {
    :root .hr-dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
