/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #1e3a5f; --navy2: #15304f;
    --blue: #2563eb; --blue-lt: #eff6ff; --blue-md: #bfdbfe;
    --green: #16a34a; --green-lt: #f0fdf4;
    --red: #dc2626; --red-lt: #fef2f2;
    --amber: #d97706; --amber-lt: #fffbeb;
    --gray: #64748b; --gray-lt: #f8fafc;
    --border: #e2e8f0; --border2: #cbd5e1;
    --text: #0f172a; --text2: #475569; --text3: #94a3b8;
    --radius: 8px; --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.12);
    --app-bg: #f0f2f5;
    --topnav-bg: #1e3a5f;
    --topnav-bg-2: #15304f;
    --brand-bg: #2563eb;
    --panel-bg: #fff;
    --panel-soft: #f8fafc;
    --table-hover: #fafcff;
}

body.skin-lotus,
.skin-lotus {
    --navy: #1e3a5f; --navy2: #15304f;
    --blue: #2563eb; --blue-lt: #eff6ff; --blue-md: #bfdbfe;
    --app-bg: #f0f2f5; --topnav-bg: #1e3a5f; --topnav-bg-2: #15304f; --brand-bg: #2563eb;
    --panel-bg: #fff; --panel-soft: #f8fafc; --table-hover: #fafcff;
}

body.skin-ocean,
.skin-ocean {
    --navy: #0f4c5c; --navy2: #0b3b47;
    --blue: #0891b2; --blue-lt: #ecfeff; --blue-md: #a5f3fc;
    --app-bg: #eef7f8; --topnav-bg: #0f4c5c; --topnav-bg-2: #0b3b47; --brand-bg: #0891b2;
    --panel-bg: #ffffff; --panel-soft: #f0fdfa; --table-hover: #ecfeff;
}

body.skin-emerald,
.skin-emerald {
    --navy: #14532d; --navy2: #0f3f23;
    --blue: #059669; --blue-lt: #ecfdf5; --blue-md: #a7f3d0;
    --app-bg: #f0f7f2; --topnav-bg: #14532d; --topnav-bg-2: #0f3f23; --brand-bg: #059669;
    --panel-bg: #ffffff; --panel-soft: #f7fee7; --table-hover: #f0fdf4;
}

body.skin-rose,
.skin-rose {
    --navy: #7f1d1d; --navy2: #641616;
    --blue: #e11d48; --blue-lt: #fff1f2; --blue-md: #fecdd3;
    --app-bg: #faf4f5; --topnav-bg: #7f1d1d; --topnav-bg-2: #641616; --brand-bg: #e11d48;
    --panel-bg: #ffffff; --panel-soft: #fff1f2; --table-hover: #fff7ed;
}

/* Skin overrides for screens that still use inline colors. */
body[class*="skin-"] .lotus-topnav,
[class*="skin-"] .lotus-topnav,
body[class*="skin-"] *[style*="background:#1e3a5f"],
body[class*="skin-"] *[style*="background: #1e3a5f"],
[class*="skin-"] *[style*="background:#1e3a5f"],
[class*="skin-"] *[style*="background: #1e3a5f"] {
    background: var(--topnav-bg) !important;
}

body[class*="skin-"] .lotus-brand-logo,
body[class*="skin-"] .lotus-user-avatar,
[class*="skin-"] .lotus-brand-logo,
[class*="skin-"] .lotus-user-avatar,
body[class*="skin-"] *[style*="background:#2563eb"],
body[class*="skin-"] *[style*="background: #2563eb"],
[class*="skin-"] *[style*="background:#2563eb"],
[class*="skin-"] *[style*="background: #2563eb"] {
    background: var(--brand-bg) !important;
}

body[class*="skin-"] .btn-primary,
body[class*="skin-"] .pag-btn.active,
[class*="skin-"] .btn-primary,
[class*="skin-"] .pag-btn.active {
    background: var(--blue) !important;
    border-color: var(--blue) !important;
}

body[class*="skin-"] main,
body[class*="skin-"] .lotus-main,
body[class*="skin-"] .layout-loading,
[class*="skin-"] main,
[class*="skin-"] .lotus-main,
[class*="skin-"] .layout-loading,
body[class*="skin-"] *[style*="background:#f0f2f5"],
body[class*="skin-"] *[style*="background: #f0f2f5"],
[class*="skin-"] *[style*="background:#f0f2f5"],
[class*="skin-"] *[style*="background: #f0f2f5"] {
    background: var(--app-bg) !important;
}

body[class*="skin-"] *[style*="background:#f8fafc"],
body[class*="skin-"] *[style*="background: #f8fafc"],
body[class*="skin-"] *[style*="background:#fafbfc"],
body[class*="skin-"] *[style*="background: #fafbfc"],
[class*="skin-"] *[style*="background:#f8fafc"],
[class*="skin-"] *[style*="background: #f8fafc"],
[class*="skin-"] *[style*="background:#fafbfc"],
[class*="skin-"] *[style*="background: #fafbfc"] {
    background: var(--panel-soft) !important;
}

body[class*="skin-"] *[style*="background:#eff6ff"],
body[class*="skin-"] *[style*="background: #eff6ff"],
[class*="skin-"] *[style*="background:#eff6ff"],
[class*="skin-"] *[style*="background: #eff6ff"] {
    background: var(--blue-lt) !important;
}

body[class*="skin-"] *[style*="color:#1d4ed8"],
body[class*="skin-"] *[style*="color: #1d4ed8"],
[class*="skin-"] *[style*="color:#1d4ed8"],
[class*="skin-"] *[style*="color: #1d4ed8"] {
    color: var(--blue) !important;
}

body[class*="skin-"] .form-ctrl:focus,
[class*="skin-"] .form-ctrl:focus {
    border-color: var(--blue) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent) !important;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: var(--app-bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
.app-body   { display: flex; flex: 1; overflow: hidden; height: calc(100vh - 50px); }
.main-content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ── Main Layout ───────────────────────────────────────────────── */
.layout-loading {
    display:flex;align-items:center;justify-content:center;height:100vh;
    flex-direction:column;gap:12px;background:var(--app-bg);
}
.layout-loading-logo {
    width:40px;height:40px;background:var(--topnav-bg);border-radius:10px;
    display:flex;align-items:center;justify-content:center;color:#fff;
    font-weight:700;font-size:16px;
}
.layout-loading-text { color:#64748b;font-size:13px; }
.lotus-shell {
    display:flex;
    flex-direction:column;
    height:100vh;
    min-height:100vh;
    overflow:hidden;
}
.lotus-topnav {
    background:var(--topnav-bg);min-height:52px;display:flex;align-items:center;
    align-content:center;flex-wrap:wrap;padding:8px 16px;gap:4px 2px;flex-shrink:0;box-shadow:0 2px 8px rgba(0,0,0,.2);
    position:sticky;top:0;z-index:200;overflow:visible;
}
.lotus-brand {
    display:flex;align-items:center;gap:8px;text-decoration:none;
    margin-right:10px;flex-shrink:0;
}
.lotus-brand-logo {
    width:30px;height:30px;background:var(--brand-bg);border-radius:7px;
    display:flex;align-items:center;justify-content:center;color:#fff;
    font-weight:700;font-size:12px;
}
.lotus-brand-text { color:#fff;font-weight:600;font-size:13px;white-space:nowrap; }
.lotus-nav-sep { width:1px;height:22px;background:rgba(255,255,255,.2);margin:0 6px;flex-shrink:0; }
.lotus-nav-primary {
    display:flex;align-items:center;align-content:center;flex:1 1 520px;
    min-width:0;flex-wrap:wrap;gap:2px;
}
.lotus-nav-link {
    display:inline-flex;align-items:center;gap:4px;padding:6px 10px;
    border-radius:6px;color:rgba(255,255,255,.8);font-size:12.5px;
    cursor:pointer;white-space:nowrap;text-decoration:none;user-select:none;
}
.lotus-nav-link:hover { background:rgba(255,255,255,.14);color:#fff; }
.lotus-nav-dd { position:relative;flex-shrink:0; }
.lotus-nav-menu {
    position:absolute;top:100%;left:0;background:#fff;border-radius:8px;
    min-width:210px;max-height:80vh;overflow-y:auto;box-shadow:0 8px 24px rgba(0,0,0,.15);
    border:1px solid #e2e8f0;z-index:1000;padding:6px;margin-top:4px;
}
.lotus-nav-group {
    font-size:10px;font-weight:600;color:#94a3b8;text-transform:uppercase;
    letter-spacing:.5px;padding:4px 10px 2px;
}
.lotus-nav-item {
    display:block;padding:6px 10px;border-radius:6px;color:#374151;
    font-size:12.5px;text-decoration:none;white-space:nowrap;
}
.lotus-nav-item:hover { background:#f1f5f9;color:#1d4ed8; }
.lotus-nav-divider { height:1px;background:#f1f5f9;margin:4px 0; }
.lotus-nav-spacer { flex:1;min-width:12px; }
.lotus-nav-actions {
    display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;
    min-width:0;flex-wrap:wrap;gap:6px;margin-left:auto;
}
.lotus-icon-btn {
    width:32px;height:32px;border-radius:8px;border:none;background:rgba(255,255,255,.1);
    cursor:pointer;color:rgba(255,255,255,.8);font-size:15px;display:flex;
    align-items:center;justify-content:center;flex-shrink:0;transition:background .15s;
}
.lotus-icon-btn:hover { background:rgba(255,255,255,.18); }
.lotus-skin-select option { color:#0f172a;background:#fff; }
.lotus-user-chip {
    display:flex;align-items:center;gap:7px;padding:4px 10px 4px 5px;
    background:rgba(255,255,255,.1);border-radius:20px;border:none;cursor:pointer;
    flex-shrink:0;font-family:inherit;
}
.lotus-user-chip:hover { background:rgba(255,255,255,.16); }
.lotus-user-avatar {
    width:26px;height:26px;border-radius:50%;background:#2563eb;color:#fff;
    display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;
}
.lotus-user-name { color:#fff;font-size:12px;white-space:nowrap; }
.lotus-user-logout { color:rgba(255,255,255,.5);font-size:10px; }
.lotus-main {
    flex:1 1 auto;
    min-height:0;
    padding:16px 20px;
    background:var(--app-bg);
    overflow:hidden;
    display:flex;
    flex-direction:column;
}

@media (max-width: 760px) {
    .lotus-topnav { height:auto;min-height:52px;padding:8px 10px; }
    .lotus-brand-text, .lotus-brand-wordmark { display:none; }
    .lotus-nav-primary { order:3;flex:1 0 100%;width:100%; }
    .lotus-nav-actions { order:2;flex:1 1 auto;justify-content:flex-end; }
    .lotus-nav-sep { display:none; }
    .lotus-nav-spacer { flex-basis:100%;height:0;min-width:0; }
    .lotus-company-select { max-width:calc(100vw - 24px) !important; }
    .lotus-nav-menu { max-width:calc(100vw - 20px); }
    .lotus-nav-item { white-space:normal; }
    .lotus-user-name { display:none; }
    .lotus-main { padding:12px; }
}

@media (max-width: 520px) {
    .lotus-nav-actions { flex-basis:100%;justify-content:flex-start;margin-left:0; }
    .lotus-skin-select { max-width:132px; }
    .lotus-lang-select { max-width:86px; }
}

/* ── Authentication Center ───────────────────────────────────── */
.auth-center-shell-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.auth-center-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--border));
    background: color-mix(in srgb, var(--blue-lt) 72%, var(--panel-bg));
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.auth-center-tabs {
    display: flex;
    align-items: stretch;
    gap: 6px;
    min-height: 44px;
    margin-bottom: 14px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

.auth-center-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 7px;
    color: var(--text2);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
}

.auth-center-tab:hover {
    background: var(--panel-soft);
    color: var(--text);
}

.auth-center-tab.is-active {
    background: var(--blue);
    color: #fff;
}

.auth-center-tab-icon {
    font-size: 13px;
    line-height: 1;
    flex: 0 0 auto;
}

.auth-center-dashboard {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 10px;
}

.auth-metric,
.auth-panel,
.auth-roadmap {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
}

.auth-metric {
    min-height: 78px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-metric span {
    color: var(--text2);
    font-size: 11.5px;
    font-weight: 700;
}

.auth-metric strong {
    color: var(--text);
    font-size: 26px;
    line-height: 1;
}

.auth-center-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 14px;
    align-items: start;
}

.auth-panel {
    overflow: hidden;
}

.auth-panel-head,
.auth-roadmap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.auth-panel-head {
    border-bottom: 1px solid var(--border);
    background: var(--panel-soft);
}

.auth-panel h3,
.auth-roadmap h3 {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--text);
}

.auth-panel p,
.auth-roadmap p {
    margin: 0;
    color: var(--text2);
    font-size: 12.5px;
    line-height: 1.5;
}

.auth-action-list,
.auth-session-list {
    display: flex;
    flex-direction: column;
}

.auth-action {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.auth-action:last-child,
.auth-session-row:last-child {
    border-bottom: 0;
}

.auth-action:hover {
    background: var(--table-hover);
}

.auth-action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--blue) 11%, var(--panel-bg));
    color: var(--blue);
    font-size: 15px;
}

.auth-action strong,
.auth-session-row strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}

.auth-action small,
.auth-session-row small {
    display: block;
    margin-top: 3px;
    color: var(--text2);
    font-size: 11.5px;
    line-height: 1.4;
}

.auth-action em {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    text-align: center;
}

.auth-session-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
}

.auth-session-row time {
    color: var(--text3);
    font-size: 11.5px;
}

.auth-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--text3);
}

.auth-dot.is-online {
    background: var(--green);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
}

.auth-empty {
    padding: 28px 16px;
    color: var(--text3);
    text-align: center;
}

.auth-stage-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--blue);
    border-radius: 8px;
    background: var(--panel-bg);
}

.auth-stage-banner strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
    font-size: 14px;
}

.auth-stage-banner span {
    color: var(--text2);
    font-size: 12.5px;
    line-height: 1.45;
}

.auth-provider-grid,
.auth-config-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.auth-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.auth-provider-card {
    min-height: 220px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-provider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.auth-provider-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
}

.auth-provider-card p {
    margin: 0;
    color: var(--text2);
    font-size: 12.5px;
    line-height: 1.45;
}

.auth-provider-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.auth-provider-meta span,
.auth-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--text2);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.auth-status-pill.is-live {
    border-color: color-mix(in srgb, var(--green) 28%, var(--border));
    background: color-mix(in srgb, var(--green-lt) 68%, var(--panel-bg));
    color: var(--green);
}

.auth-status-pill.is-planned {
    border-color: color-mix(in srgb, var(--blue) 24%, var(--border));
    background: color-mix(in srgb, var(--blue-lt) 70%, var(--panel-bg));
    color: var(--blue);
}

.auth-status-pill.is-risk {
    border-color: color-mix(in srgb, var(--red) 26%, var(--border));
    background: color-mix(in srgb, var(--red-lt) 70%, var(--panel-bg));
    color: var(--red);
}

.auth-form-pad {
    padding: 14px 16px;
}

.auth-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-field-grid label span {
    display: block;
    margin-bottom: 5px;
    color: var(--text2);
    font-size: 11.5px;
    font-weight: 700;
}

.auth-toggle-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    margin-top: 14px;
}

.auth-toggle-list label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    color: var(--text);
    font-size: 12.5px;
}

.auth-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 180px) minmax(150px, 180px) auto auto;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-soft);
}

.auth-table-wrap {
    overflow-x: auto;
}

.auth-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.auth-table th,
.auth-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 12.5px;
    text-align: left;
    vertical-align: middle;
}

.auth-table th {
    background: var(--panel-soft);
    color: var(--text2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-table tbody tr:hover {
    background: var(--table-hover);
}

@media (max-width: 980px) {
    .auth-metrics,
    .auth-center-grid,
    .auth-provider-grid,
    .auth-config-grid {
        grid-template-columns: 1fr 1fr;
    }

    .auth-toolbar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .auth-center-shell-head,
    .auth-roadmap,
    .auth-stage-banner {
        flex-direction: column;
    }

    .auth-metrics,
    .auth-center-grid,
    .auth-provider-grid,
    .auth-config-grid,
    .auth-field-grid,
    .auth-toggle-list,
    .auth-toolbar {
        grid-template-columns: 1fr;
    }
}

/* ── TopNav ───────────────────────────────────────────────────── */
.topnav {
    height: 50px; background: var(--navy);
    display: flex; align-items: center; padding: 0 20px; gap: 12px;
    position: sticky; top: 0; z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.logo-box { width: 32px; height: 32px; background: var(--blue); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.logo-title { color: #fff; font-size: 14px; font-weight: 600; }
.logo-sub { color: rgba(255,255,255,.45); font-size: 10px; }
.nav-sep { width: 1px; height: 24px; background: rgba(255,255,255,.2); }
.topnav-breadcrumb { color: rgba(255,255,255,.6); font-size: 12px; flex: 1; }
.topnav-breadcrumb span { color: #fff; font-weight: 500; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-icon-btn { width: 32px; height: 32px; border-radius: 8px; border: none; background: rgba(255,255,255,.1); cursor: pointer; color: rgba(255,255,255,.7); font-size: 14px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.nav-icon-btn:hover { background: rgba(255,255,255,.18); }
.user-chip { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; background: rgba(255,255,255,.1); border-radius: 20px; cursor: pointer; }
.user-av { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; }
.user-name { color: #fff; font-size: 12px; font-weight: 500; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar { width: 220px; background: var(--navy); overflow-y: auto; flex-shrink: 0; padding-bottom: 16px; }
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.tree-group { margin-top: 4px; }
.tree-group-hdr { display: flex; align-items: center; gap: 7px; padding: 7px 14px 5px; color: rgba(255,255,255,.45); font-size: 10.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; cursor: pointer; user-select: none; }
.tree-group-hdr:hover { color: rgba(255,255,255,.7); }
.tree-group-hdr .caret { margin-left: auto; font-size: 9px; transition: transform .2s; }
.tree-group-hdr.open .caret { transform: rotate(90deg); }
.tree-children { overflow: hidden; transition: max-height .2s ease; }

.tree-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 20px; color: rgba(255,255,255,.6); cursor: pointer; font-size: 12.5px; transition: all .12s; border-left: 2px solid transparent; }
.tree-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.tree-item.active { background: rgba(37,99,235,.25); color: #93c5fd; border-left-color: #3b82f6; }
.tree-item .icon { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 13px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 12.5px; font-family: inherit; cursor: pointer; background: var(--panel-bg); color: var(--text2); transition: all .12s; font-weight: 400; white-space: nowrap; }
.btn:hover { background: var(--gray-lt); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: #1d4ed8; }
.btn-navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-navy:hover { background: var(--navy2); }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-lt); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }
.auto-btn-icon {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1.05em;
    min-width:1.05em;
    height:1.05em;
    line-height:1;
    font-size:1.05em;
    font-weight:700;
    flex-shrink:0;
}
.btn-xs .auto-btn-icon,
.btn-sm .auto-btn-icon { font-size:1em; }

/* ── Form controls ────────────────────────────────────────────── */
.form-ctrl { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12.5px; font-family: inherit; background: var(--panel-bg); color: var(--text); outline: none; transition: border .15s; }
.form-ctrl:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.form-label { font-size: 11.5px; color: var(--text2); font-weight: 500; display: block; margin-bottom: 4px; }
.form-label .req { color: var(--red); margin-left: 2px; }
.form-row { margin-bottom: 12px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.form-err { font-size: 11px; color: var(--red); margin-top: 3px; }

/* ── Card ─────────────────────────────────────────────────────── */
.card { background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.page-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.page-sub { font-size: 12px; color: var(--gray); }
.page-head { padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel-bg); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: sticky; top: 0; z-index: 40; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Stats ────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.stat-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.stat-val { font-size: 20px; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--gray); margin-top: 2px; }

/* ── Table / ListView ─────────────────────────────────────────── */
.tbl-card,
.lotus-listview {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tbl-card:has(> .tbl-body-scroll),
.lotus-listview {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tbl-header,
.lotus-listview-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-soft);
    flex-shrink: 0;
}

.tbl-footer,
.lotus-listview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    font-size: 12px;
    color: var(--gray);
    flex-shrink: 0;
}

.tbl-body-scroll,
.catalog-table-scroll,
.lotus-listview-scroll,
.employee-related-table,
.table-scroll-both,
.card:has(table.data-table),
div[style*="overflow:auto"]:has(> table),
div[style*="overflow: auto"]:has(> table),
div[style*="overflow-y:auto"]:has(> table),
div[style*="overflow-y: auto"]:has(> table) {
    overflow-x: auto;
    overflow-y: auto;
    min-height: 0;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
}

.tbl-body-scroll,
.lotus-listview-scroll,
.table-scroll-both {
    flex: 1;
    max-height: var(--listview-max-height, min(640px, calc(100vh - 220px)));
}

.tbl-body-scroll > table,
.catalog-table-scroll > table,
.lotus-listview-scroll > table,
.employee-related-table > table,
.employee-related-table table,
.table-scroll-both > table,
.card:has(table.data-table) table.data-table,
div[style*="overflow:auto"] > table,
div[style*="overflow: auto"] > table,
div[style*="overflow-y:auto"] > table,
div[style*="overflow-y: auto"] > table {
    width: max-content;
    min-width: 100%;
}

.tbl-body-scroll::-webkit-scrollbar,
.catalog-table-scroll::-webkit-scrollbar,
.lotus-listview-scroll::-webkit-scrollbar,
.employee-related-table::-webkit-scrollbar,
.table-scroll-both::-webkit-scrollbar,
.card:has(table.data-table)::-webkit-scrollbar,
div[style*="overflow:auto"]:has(> table)::-webkit-scrollbar,
div[style*="overflow: auto"]:has(> table)::-webkit-scrollbar,
div[style*="overflow-y:auto"]:has(> table)::-webkit-scrollbar,
div[style*="overflow-y: auto"]:has(> table)::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.tbl-body-scroll::-webkit-scrollbar-thumb,
.catalog-table-scroll::-webkit-scrollbar-thumb,
.lotus-listview-scroll::-webkit-scrollbar-thumb,
.employee-related-table::-webkit-scrollbar-thumb,
.table-scroll-both::-webkit-scrollbar-thumb,
.card:has(table.data-table)::-webkit-scrollbar-thumb,
div[style*="overflow:auto"]:has(> table)::-webkit-scrollbar-thumb,
div[style*="overflow: auto"]:has(> table)::-webkit-scrollbar-thumb,
div[style*="overflow-y:auto"]:has(> table)::-webkit-scrollbar-thumb,
div[style*="overflow-y: auto"]:has(> table)::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 2px solid var(--panel-bg);
}

.tbl-body-scroll::-webkit-scrollbar-track,
.catalog-table-scroll::-webkit-scrollbar-track,
.lotus-listview-scroll::-webkit-scrollbar-track,
.employee-related-table::-webkit-scrollbar-track,
.table-scroll-both::-webkit-scrollbar-track,
.card:has(table.data-table)::-webkit-scrollbar-track,
div[style*="overflow:auto"]:has(> table)::-webkit-scrollbar-track,
div[style*="overflow: auto"]:has(> table)::-webkit-scrollbar-track,
div[style*="overflow-y:auto"]:has(> table)::-webkit-scrollbar-track,
div[style*="overflow-y: auto"]:has(> table)::-webkit-scrollbar-track {
    background: #f1f5f9;
}

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th { padding: 9px 12px; text-align: left; font-weight: 500; color: var(--gray); font-size: 11.5px; background: var(--panel-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--table-hover); }

.tbl-body-scroll thead th,
.catalog-table-scroll thead th,
.lotus-listview-scroll thead th,
.employee-related-table thead th,
.table-scroll-both thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ── Department Tree ──────────────────────────────────────────── */
.employee-page-shell {
    display: flex;
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100vh - 52px);
    margin: -16px -20px;
    overflow: hidden;
    background: var(--panel-bg);
}

.dept-tree-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    padding: 8px 10px 12px;
    background: var(--panel-bg);
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
}

.dept-tree-scroll > .dept-tree-all-row,
.dept-tree-node {
    width: max-content;
    min-width: 100%;
}

.dept-tree-all-row,
.dept-tree-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    min-width: 276px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
    color: var(--text2);
    transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease, transform .14s ease;
}

.dept-tree-all-row:hover,
.dept-tree-row:hover {
    background: color-mix(in srgb, var(--blue-lt) 58%, var(--panel-bg));
    border-color: color-mix(in srgb, var(--blue-md) 55%, var(--border));
    color: var(--text);
}

.dept-tree-all-row.is-active,
.dept-tree-row.is-active {
    background: color-mix(in srgb, var(--blue-lt) 82%, var(--panel-bg));
    border-color: color-mix(in srgb, var(--blue) 30%, var(--blue-md));
    color: var(--blue);
    box-shadow: inset 3px 0 0 var(--blue), 0 8px 18px rgba(37, 99, 235, .08);
}

.dept-tree-toggle {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: 0;
    line-height: 1;
    flex: 0 0 auto;
    transition: background .14s ease, color .14s ease, transform .14s ease;
}

.dept-tree-toggle::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .14s ease;
}

.dept-tree-toggle.is-expanded::before {
    transform: rotate(45deg);
}

.dept-tree-toggle:not(.is-empty):hover {
    background: color-mix(in srgb, var(--blue-lt) 72%, var(--panel-bg));
    color: var(--blue);
}

.dept-tree-toggle.is-empty {
    color: transparent;
}

.dept-tree-toggle.is-empty::before {
    content: none;
}

.dept-tree-folder,
.dept-tree-all-icon {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    flex: 0 0 auto;
}

.dept-tree-folder {
    background: color-mix(in srgb, var(--blue-lt) 78%, #fff);
    border: 1px solid color-mix(in srgb, var(--blue-md) 70%, #fff);
}

.dept-tree-folder::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 2px;
    width: 6px;
    height: 4px;
    border-radius: 3px 3px 1px 1px;
    background: color-mix(in srgb, var(--blue) 50%, #fff);
}

.dept-tree-folder::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 3px;
    height: 7px;
    border-radius: 2px;
    background: var(--blue);
}

.dept-tree-all-icon {
    background: color-mix(in srgb, var(--blue-lt) 82%, #fff);
    border: 1px solid color-mix(in srgb, var(--blue-md) 74%, #fff);
}

.dept-tree-all-icon::before,
.dept-tree-all-icon::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: var(--blue);
}

.dept-tree-all-icon::before {
    width: 6px;
    height: 6px;
    left: 5px;
    top: 3px;
}

.dept-tree-all-icon::after {
    width: 10px;
    height: 5px;
    left: 3px;
    bottom: 4px;
}

.dept-tree-check {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    accent-color: var(--blue);
    cursor: pointer;
    margin: 0;
    vertical-align: middle;
}
.dept-tree-name {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 17px;
}

.dept-tree-all-label {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.dept-tree-count {
    margin-left: 8px;
    background: color-mix(in srgb, var(--panel-soft) 80%, var(--blue-lt));
    color: var(--text2);
    border: 1px solid color-mix(in srgb, var(--border) 70%, var(--blue-md));
    font-size: 10px;
    line-height: 16px;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    text-align: center;
    flex: 0 0 auto;
}

.dept-tree-all-row.is-active .dept-tree-count,
.dept-tree-row.is-active .dept-tree-count {
    background: color-mix(in srgb, var(--blue) 12%, var(--panel-bg));
    color: var(--blue);
    border-color: color-mix(in srgb, var(--blue) 28%, var(--blue-md));
}

.dept-tree-children {
    position: relative;
    width: max-content;
    min-width: 100%;
    margin-left: 10px;
    padding-left: 20px;
    border-left: 1px solid color-mix(in srgb, var(--border) 80%, var(--blue-md));
}

.dept-tree-children .dept-tree-row::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 50%;
    width: 18px;
    height: 1px;
    background: color-mix(in srgb, var(--border) 80%, var(--blue-md));
}

.dept-tree-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.dept-tree-scroll::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text3) 52%, var(--panel-bg));
    border-radius: 999px;
    border: 2px solid var(--panel-bg);
}

/* ── Dept Sidebar collapsible ─────────────────────────────────── */
.dept-sidebar {
    width: clamp(288px, 22vw, 360px);
    flex-shrink: 0;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 8px 0 24px rgba(15, 23, 42, .06);
    transition: width 0.22s cubic-bezier(.4,0,.2,1), box-shadow .22s ease;
}
.dept-sidebar.is-collapsed {
    width: 36px;
    box-shadow: none;
}
.dept-sidebar-hd {
    position: relative;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--panel-soft) 82%, var(--panel-bg));
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 46px;
}
.dept-sidebar.is-collapsed .dept-sidebar-hd {
    padding: 9px 0;
    justify-content: center;
}
.dept-sidebar-mark {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--blue) 12%, var(--panel-bg));
    border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--border));
    flex: 0 0 auto;
}
.dept-sidebar-mark::before,
.dept-sidebar-mark::after {
    content: "";
    position: absolute;
    background: var(--blue);
}
.dept-sidebar-mark::before {
    left: 6px;
    top: 5px;
    width: 12px;
    height: 6px;
    border-radius: 2px;
}
.dept-sidebar-mark::after {
    left: 4px;
    right: 4px;
    bottom: 5px;
    height: 8px;
    border-radius: 2px;
    opacity: .78;
}
.dept-sidebar.is-collapsed .dept-sidebar-mark {
    display: none;
}
.dept-sidebar-title {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dept-sidebar-btn {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--text2);
    font-size: 0;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.dept-sidebar-btn::before {
    content: "";
    width: 7px;
    height: 7px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateX(1px) rotate(45deg);
}
.dept-sidebar-btn.is-collapsed::before {
    border-left: 0;
    border-bottom: 0;
    border-right: 1.5px solid currentColor;
    border-top: 1.5px solid currentColor;
    transform: translateX(-1px) rotate(45deg);
}
.dept-sidebar-btn:hover {
    background: color-mix(in srgb, var(--blue-lt) 72%, var(--panel-bg));
    color: var(--blue);
    border-color: color-mix(in srgb, var(--blue) 26%, var(--blue-md));
    box-shadow: 0 6px 14px rgba(37, 99, 235, .12);
}
.dept-sidebar-search {
    padding: 9px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.dept-search-box {
    position: relative;
}
.dept-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    width: 13px;
    height: 13px;
    border: 1.7px solid var(--text3);
    border-radius: 999px;
    transform: translateY(-50%);
    pointer-events: none;
}
.dept-search-icon::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 6px;
    height: 1.7px;
    border-radius: 999px;
    background: var(--text3);
    transform: rotate(45deg);
}
.dept-search-input {
    width: 100%;
    height: 32px;
    padding: 6px 10px 6px 31px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--text);
    font-size: 12.5px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.dept-search-input:focus {
    border-color: color-mix(in srgb, var(--blue) 42%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}
.dept-sidebar.is-collapsed .dept-sidebar-search,
.dept-sidebar.is-collapsed .dept-tree-scroll {
    display: none;
}

.dept-tree-scroll::-webkit-scrollbar-track {
    background: var(--panel-soft);
}

@media (max-width: 760px) {
    .employee-page-shell {
        height: calc(100vh - 52px);
        margin: -12px;
    }

    .dept-sidebar {
        width: min(82vw, 320px);
    }
}

/* ── Badge ────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-amber  { background: #fef3c7; color: #b45309; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f1f5f9; color: #64748b; }

/* ── Avatar ───────────────────────────────────────────────────── */
.av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.flex-cell { display: flex; align-items: center; gap: 8px; }

/* ── Pagination ───────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); background: #fafbfc; font-size: 12px; }
.pag-btns { display: flex; gap: 4px; }
.pag-btn { min-width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0 6px; color: var(--gray); transition: all .12s; font-family: inherit; }
.pag-btn:hover { background: #f1f5f9; }
.pag-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pag-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 560px; max-width: 95vw; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal-hdr { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-hdr h3 { font-size: 14px; font-weight: 600; }
.modal-body { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent; cursor: pointer; color: var(--gray); font-size: 17px; }
.modal-close:hover { background: #f1f5f9; }

/* ── Drawer ───────────────────────────────────────────────────── */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 400; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 680px; background: #fff; z-index: 401; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.12); }
.drawer-hdr { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: #fafbfc; flex-shrink: 0; }

/* ── Loading ──────────────────────────────────────────────────── */
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 40px; flex-direction: column; gap: 12px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loading { 0%,100% { transform: translateX(-100%); } 50% { transform: translateX(100%); } }

/* ── Search & Filter ──────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
.search-inp { padding-left: 32px !important; }
.filter-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 14px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Catalog screens: match employee list rhythm ──────────────── */
.catalog-page {
    height: 100%;
    margin: -16px -20px;
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.catalog-head {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.catalog-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.catalog-search { width: min(260px, 32vw); }
.catalog-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text2);
    cursor: pointer;
    white-space: nowrap;
}
.catalog-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--text2);
    font-size: 12px;
    white-space: nowrap;
}
.catalog-selection {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text2);
    font-size: 12px;
    flex-shrink: 0;
}
.catalog-table {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.catalog-table-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.catalog-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}
.catalog-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--gray);
    font-size: 12px;
    flex-shrink: 0;
}
.catalog-modal {
    width: 720px;
    max-width: 96vw;
}
.catalog-modal .modal-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    align-items: start;
}
.catalog-modal .modal-body > .form-row {
    margin-bottom: 0;
}
.catalog-modal .catalog-check-row {
    align-self: end;
}
.catalog-modal .catalog-form-wide {
    grid-column: 1 / -1;
}
.catalog-inline-check {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    color: var(--text2);
    font-size: 12.5px;
    font-weight: 500;
}
.catalog-inline-check input[type="checkbox"] {
    accent-color: var(--blue);
}
.catalog-modal .modal-hdr {
    background: var(--navy);
    color: #fff;
}
.catalog-modal .modal-close {
    color: #fff;
}
.catalog-modal .modal-close:hover {
    background: rgba(255,255,255,.12);
}

@media (max-width: 760px) {
    .catalog-head {
        align-items: stretch;
        flex-direction: column;
    }
    .catalog-actions {
        justify-content: flex-start;
    }
    .catalog-search {
        width: 100%;
    }
    .catalog-modal .modal-body {
        grid-template-columns: 1fr;
    }
}

/* ── Toast ────────────────────────────────────────────────────── */
#blazor-error-ui { background: #fee2e2; padding: 10px 16px; position: fixed; bottom: 0; width: 100%; z-index: 999; display: none; align-items: center; gap: 8px; font-size: 13px; }

/* ── Login page ───────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(15,45,100,.50) 0%, transparent 62%),
        linear-gradient(rgba(255,255,255,.032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.032) 1px, transparent 1px),
        linear-gradient(180deg, #07111f 0%, #050d1c 60%, #040b17 100%);
    background-size: auto, 52px 52px, 52px 52px, auto;
    color: #e2e8f0;
    overflow: hidden;
}

.login-page *:not(input):not(select):not(button):focus,
.login-page *:not(input):not(select):not(button):focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ── Top bar ── */
.login-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    height: 58px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.login-topbar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}
.login-topbar-text strong {
    display: block;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .4px;
}
.login-topbar-text span {
    display: block;
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-top: 1px;
}
.login-topbar-lang {
    display: flex;
    align-items: center;
    gap: 8px;
}
.login-topbar-lang select {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}
.login-topbar-lang select:focus {
    border-color: #3b82f6;
}

/* ── Nav items ── */
.login-topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.login-topbar-nav-item {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    cursor: default;
    white-space: nowrap;
    transition: color .15s, background .15s;
}
.login-topbar-nav-item--active {
    background: rgba(59,130,246,.18);
    color: #e2e8f0;
}

/* ── Language flag ── */
.login-language-flag {
    position: relative;
    width: 26px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.15);
}
.login-language-flag::before {
    content: "";
    position: absolute;
    inset: 0;
}
.login-language-flag.flag-vi {
    background: #da251d;
}
.login-language-flag.flag-vi::before {
    content: "★";
    inset: auto;
    color: #ffde00;
    font-size: 12px;
    line-height: 1;
    text-align: center;
}
.login-language-flag.flag-en {
    background: repeating-linear-gradient(to bottom,#b22234 0 2px,#fff 2px 4px);
}
.login-language-flag.flag-en::before {
    width: 11px;
    height: 9px;
    background: #3c3b6e;
}
.login-language-flag.flag-ja {
    background: #fff;
}
.login-language-flag.flag-ja::before {
    width: 10px;
    height: 10px;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #bc002d;
}

/* ── Body ── */
.login-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
}
.login-cards-row {
    display: flex;
    align-items: stretch;
    gap: 20px;
}

/* ── Left info card ── */
.login-info-card {
    flex: 0 0 480px;
    border-radius: 16px;
    padding: 40px 36px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
}
.login-info-title {
    margin: 0 0 18px;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 900;
    letter-spacing: 6px;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.1;
    outline: none !important;
    user-select: none;
    pointer-events: none;
}
.login-info-title:focus,
.login-info-title:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}
.login-info-desc {
    margin: 0 0 30px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.72;
}
.login-feat-grid {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 24px;
}
.login-feat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 6px;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.09);
    text-align: center;
    min-width: 0;
}
.login-feat-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: rgba(59,130,246,.15);
    border: 1px solid rgba(59,130,246,.25);
    display: grid;
    place-items: center;
    color: #60a5fa;
    flex-shrink: 0;
}
.login-feat-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}
.login-feat strong {
    font-size: 10.5px;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ── Sign-in card ── */
.login-card {
    position: relative;
    z-index: 1;
    flex: 0 0 360px;
    border-radius: 22px;
    padding: 40px 32px 32px;
    background: rgba(10,20,45,.72);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(28px) saturate(1.2);
    -webkit-backdrop-filter: blur(28px) saturate(1.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-title {
    color: #f1f5f9;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
}
.login-sub {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 28px;
}
.login-error {
    background: rgba(239,68,68,.12);
    color: #f87171;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 14px;
    border: 1px solid rgba(239,68,68,.2);
}
.login-field {
    position: relative;
    height: 52px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    background: rgba(255,255,255,.11);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    margin-bottom: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.login-field:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.18);
    background: rgba(255,255,255,.14);
}
.login-field-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: #64748b;
    width: 20px;
}
.login-field-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}
.login-field input {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 0;
    outline: none !important;
    background: transparent;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    line-height: 36px;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
    vertical-align: middle;
}
.login-field input:focus {
    outline: none !important;
    box-shadow: none !important;
}
.login-field input::placeholder {
    color: #64748b;
    line-height: 36px;
}
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #e2e8f0 !important;
    -webkit-box-shadow: 0 0 0 1000px #253047 inset !important;
    caret-color: #e2e8f0;
    transition: background-color 9999s ease-in-out 0s;
}
.login-eye {
    position: static;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color .15s;
}
.login-eye:hover {
    color: #94a3b8;
}
.login-eye svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}
.login-submit {
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 50px;
    background: linear-gradient(90deg, #00b4d8, #0077e6);
    color: #fff;
    font-size: 15px;
    font-weight: 750;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,119,230,.40);
    transition: transform .15s, box-shadow .15s, filter .15s;
    margin-top: 8px;
    letter-spacing: .3px;
}
.login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 14px 36px rgba(0,119,230,.50);
}
.login-submit:disabled {
    cursor: not-allowed;
    opacity: .6;
}
.login-submit .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}
.login-copyright {
    margin-top: auto;
    padding-top: 26px;
    text-align: center;
    color: #334155;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .login-topbar-nav {
        display: none;
    }
}
@media (max-width: 900px) {
    .login-body {
        padding: 24px 20px;
    }
    .login-cards-row {
        flex-direction: column;
        align-items: center;
    }
    .login-info-card,
    .login-card {
        flex: none;
        width: 100%;
        max-width: 480px;
    }
}
@media (max-width: 560px) {
    .login-topbar {
        padding: 0 16px;
    }
    .login-topbar-text span {
        display: none;
    }
    .login-info-title {
        font-size: 28px;
        letter-spacing: 5px;
    }
    .login-module-grid {
        gap: 8px;
    }
    .login-card {
        padding: 28px 20px 24px;
    }
}
.section-title { font-size: 12px; font-weight: 600; color: var(--navy); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--blue-md); }

/* ── Modal Large ──────────────────────────────────────────────── */
.modal-lg {
    width: 860px;
    max-width: 96vw;
}
.modal-backdrop {
    align-items: center;
    justify-content: center;
}

/* ── Top Navigation ──────────────────────────────────────────── */

    .nav-top-item {
        display:inline-flex;align-items:center;gap:5px;
        padding:6px 10px;border-radius:6px;border:none;
        background:transparent;color:rgba(255,255,255,.75);
        font-size:12.5px;font-family:inherit;cursor:pointer;
        white-space:nowrap;text-decoration:none;
        transition:all .15s;
    }
    .nav-top-item:hover, .nav-top-active {
        background:rgba(255,255,255,.15);
        color:#fff !important;
    }
    .nav-dropdown { position:relative; }
    .nav-dropdown-btn { }
    .nav-dropdown-menu {
        display:none;position:absolute;top:calc(100% + 6px);left:0;
        background:#fff;border-radius:8px;min-width:200px;
        box-shadow:0 8px 24px rgba(0,0,0,.15);
        border:1px solid #e2e8f0;z-index:300;padding:6px;
    }
    .nav-dropdown-wide { min-width:580px; }
    .nav-dropdown:hover .nav-dropdown-menu { display:block; }
    .nav-drop-item {
        display:block;padding:7px 10px;border-radius:6px;
        color:#374151;font-size:12.5px;text-decoration:none;
        transition:background .1s;
    }
    .nav-drop-item:hover { background:#f1f5f9;color:#1d4ed8; }
    .nav-drop-item.active { background:#eff6ff;color:#1d4ed8;font-weight:500; }
    .nav-drop-group {
        font-size:10.5px;font-weight:600;color:#94a3b8;
        text-transform:uppercase;letter-spacing:.5px;
        padding:6px 10px 3px;
    }
    /* Scrollbar */
    ::-webkit-scrollbar { width:5px;height:5px; }
    ::-webkit-scrollbar-thumb { background:#cbd5e1;border-radius:3px; }

/* ── Horizontal Nav ───────────────────────────────────────────── */
.nt-btn {
    display:inline-flex;align-items:center;padding:6px 10px;
    border-radius:6px;color:rgba(255,255,255,.75);font-size:12.5px;
    cursor:pointer;white-space:nowrap;user-select:none;
    transition:all .15s;
}
.nt-btn:hover { background:rgba(255,255,255,.15);color:#fff; }
.nt-dd { position:relative; }
.nt-menu {
    display:none;position:absolute;top:calc(100% + 6px);left:0;
    background:#fff;border-radius:8px;min-width:200px;
    box-shadow:0 8px 24px rgba(0,0,0,.15);
    border:1px solid #e2e8f0;z-index:500;padding:6px;
}
.nt-dd:hover .nt-menu { display:block; }
.nt-item {
    display:block;padding:7px 10px;border-radius:6px;
    color:#374151;font-size:12.5px;text-decoration:none;
    transition:background .1s;white-space:nowrap;
}
.nt-item:hover { background:#f1f5f9;color:#1d4ed8; }
.nt-grp {
    font-size:10.5px;font-weight:600;color:#94a3b8;
    text-transform:uppercase;letter-spacing:.5px;
    padding:6px 10px 3px;
}

/* ── Dark Mode ────────────────────────────────────────────────── */
body.dark {
    --text:      #e2e8f0; --text2: #cbd5e1; --text3: #94a3b8;
    --gray:      #94a3b8;
    --border:    #334155; --border2: #475569;
    --gray-lt:   #1e293b;
    --shadow:    0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.4);
    --panel-bg:   #1e293b;
    --panel-soft: #172032;
    --table-hover:#243046;
    background: #0f172a;
    color: #e2e8f0;
}

/* Layout containers */
body.dark main { background: #0f172a !important; }
body.dark .layout-loading { background:#0f172a !important; }
body.dark .lotus-main { background:#0f172a !important; }
body.dark .lotus-nav-menu { background:#1e293b !important;border-color:#334155 !important; }
body.dark .lotus-nav-item { color:#cbd5e1 !important; }
body.dark .lotus-nav-item:hover { background:#243046 !important;color:#60a5fa !important; }
body.dark .lotus-nav-divider { background:#334155 !important; }

/* White panels → dark slate */
body.dark *[style*="background:#fff"]     { background: #1e293b !important; }
body.dark *[style*="background: #fff"]    { background: #1e293b !important; }

/* Light gray headers / footers */
body.dark *[style*="background:#f8fafc"]  { background: #172032 !important; }
body.dark *[style*="background:#fafbfc"]  { background: #172032 !important; }
body.dark *[style*="background:#f0f2f5"]  { background: #0f172a !important; }
body.dark *[style*="background:#f1f5f9"]  { background: #1a2332 !important; }

/* Selected item blue tint — keep blue-ish but darker */
body.dark *[style*="background:#eff6ff"]  { background: #1e3a5f !important; }

/* Borders */
body.dark *[style*="border:1px solid #e2e8f0"]        { border-color: #334155 !important; }
body.dark *[style*="border-bottom:1px solid #e2e8f0"] { border-bottom-color: #334155 !important; }
body.dark *[style*="border-right:1px solid #e2e8f0"]  { border-right-color:  #334155 !important; }
body.dark *[style*="border-top:1px solid #e2e8f0"]    { border-top-color:    #334155 !important; }
body.dark *[style*="border-bottom:1px solid #f1f5f9"] { border-bottom-color: #263248 !important; }

/* Text colors */
body.dark *[style*="color:#374151"] { color: #cbd5e1 !important; }
body.dark *[style*="color:#0f172a"] { color: #e2e8f0 !important; }
body.dark *[style*="color:#475569"],
body.dark *[style*="color: #475569"],
body.dark *[style*="color:#64748b"],
body.dark *[style*="color: #64748b"] { color: #94a3b8 !important; }
body.dark *[style*="color:#1d4ed8"] { color: #60a5fa !important; }

/* Table */
body.dark tbody tr:hover td { background: #243046 !important; }

/* CSS-class elements */
body.dark .card            { background: #1e293b !important; border-color: #334155 !important; }
body.dark .tbl-card        { background: #1e293b !important; border-color: #334155 !important; }
body.dark .tbl-header      { background: #172032 !important; border-color: #334155 !important; }
body.dark .tbl-footer      { background: #172032 !important; border-color: #334155 !important; }
body.dark .filter-card     { background: #1e293b !important; border-color: #334155 !important; }
body.dark .catalog-page,
body.dark .catalog-head    { background: #1e293b !important; border-color: #334155 !important; }
body.dark .catalog-selection,
body.dark .catalog-footer  { background: #172032 !important; border-color: #334155 !important; }
body.dark .catalog-count   { background: #172032 !important; border-color: #334155 !important; color: #cbd5e1 !important; }
body.dark .btn             { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }
body.dark .btn:hover       { background: #243046 !important; }
body.dark .btn-primary     { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }
body.dark .form-ctrl       { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0 !important; }
body.dark .form-ctrl:focus { border-color: #60a5fa !important; }
body.dark .modal           { background: #1e293b !important; }
body.dark .modal-hdr       { border-color: #334155 !important; background: #172032 !important; }
body.dark .modal-footer    { border-color: #334155 !important; background: #172032 !important; }
body.dark .modal-body      { background: #1e293b !important; }
body.dark .pagination      { background: #172032 !important; border-color: #334155 !important; }
body.dark .pag-btn         { background: #1e293b !important; border-color: #334155 !important; color: #94a3b8 !important; }
body.dark .pag-btn.active  { background: var(--blue) !important; color: #fff !important; }
body.dark .section-title   { color: #93c5fd !important; border-bottom-color: #334155 !important; }
body.dark .page-title      { color: #e2e8f0 !important; }
body.dark thead th         { background: #172032 !important; color: #94a3b8 !important; border-bottom-color: #334155 !important; }
body.dark tbody td         { border-bottom-color: #263248 !important; }
body.dark .layout-loading-text { color: #94a3b8 !important; }
body.dark .badge-gray      { background: #334155 !important; color: #cbd5e1 !important; }

/* Department tree */
body.dark .employee-page-shell,
body.dark .dept-sidebar {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark .dept-sidebar {
    box-shadow: 8px 0 24px rgba(0, 0, 0, .24);
}

body.dark .dept-sidebar.is-collapsed {
    box-shadow: none;
}

body.dark .dept-sidebar-hd {
    background: #172032 !important;
    border-color: #334155 !important;
}

body.dark .dept-sidebar-title {
    color: #e2e8f0 !important;
}

body.dark .dept-sidebar-mark,
body.dark .dept-sidebar-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.dark .dept-sidebar-mark::before,
body.dark .dept-sidebar-mark::after {
    background: #60a5fa !important;
}

body.dark .dept-sidebar-btn:hover {
    background: #243046 !important;
    border-color: #475569 !important;
    color: #93c5fd !important;
}

body.dark .dept-sidebar-search {
    border-color: #334155 !important;
}

body.dark .dept-search-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark .dept-search-input:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .16) !important;
}

body.dark .dept-search-icon {
    border-color: #94a3b8 !important;
}

body.dark .dept-search-icon::after {
    background: #94a3b8 !important;
}

body.dark .dept-tree-scroll {
    background: #1e293b !important;
}

body.dark .dept-tree-all-row,
body.dark .dept-tree-row {
    color: #cbd5e1 !important;
}

body.dark .dept-tree-all-row:hover,
body.dark .dept-tree-row:hover {
    background: #243046 !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark .dept-tree-all-row.is-active,
body.dark .dept-tree-row.is-active {
    background: #1e3a5f !important;
    border-color: #60a5fa !important;
    color: #bfdbfe !important;
    box-shadow: inset 3px 0 0 #60a5fa, 0 8px 18px rgba(96, 165, 250, .08) !important;
}

body.dark .dept-tree-toggle {
    color: #94a3b8 !important;
}

body.dark .dept-tree-toggle:not(.is-empty):hover {
    background: #334155 !important;
    color: #bfdbfe !important;
}

body.dark .dept-tree-toggle.is-empty {
    color: transparent !important;
}

body.dark .dept-tree-folder,
body.dark .dept-tree-all-icon {
    background: #172032 !important;
    border-color: #334155 !important;
}

body.dark .dept-tree-folder::before {
    background: #93c5fd !important;
}

body.dark .dept-tree-folder::after,
body.dark .dept-tree-all-icon::before,
body.dark .dept-tree-all-icon::after {
    background: #60a5fa !important;
}

body.dark .dept-tree-count {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

body.dark .dept-tree-all-row.is-active .dept-tree-count,
body.dark .dept-tree-row.is-active .dept-tree-count {
    background: #bfdbfe !important;
    border-color: #93c5fd !important;
    color: #1e3a8a !important;
}

body.dark .dept-tree-children {
    border-left-color: #475569 !important;
}

body.dark .dept-tree-children .dept-tree-row::before {
    background: #475569 !important;
}

body.dark .dept-tree-scroll::-webkit-scrollbar-thumb {
    background: #64748b !important;
    border-color: #1e293b !important;
}

body.dark .dept-tree-scroll::-webkit-scrollbar-track {
    background: #172032 !important;
}

/* Inputs, selects */
body.dark input:not([type=checkbox]):not([type=radio]),
body.dark select,
body.dark textarea {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Scrollbar */
body.dark ::-webkit-scrollbar-thumb { background: #475569 !important; }

/* ── Form Theme Guard ────────────────────────────────────────────
   Keep every data-entry surface readable when screens mix inline styles,
   skins, and dark mode. */
.modal,
.drawer,
.catalog-modal,
.employee-edit-modal,
.filter-card,
.tbl-card,
.card,
.catalog-table,
.catalog-head,
.catalog-page {
    background-color: var(--panel-bg) !important;
    color: var(--text) !important;
}

.modal-body,
.drawer-body {
    background-color: var(--panel-bg) !important;
    color: var(--text) !important;
}

.modal-footer,
.drawer-footer,
.catalog-footer,
.tbl-footer,
.pagination {
    background-color: var(--panel-soft) !important;
    color: var(--text2) !important;
}

.form-label,
.catalog-check,
.modal-body label,
.modal-body span,
.drawer-body label,
.drawer-body span {
    color: var(--text2);
}

.modal-body h1,
.modal-body h2,
.modal-body h3,
.modal-body h4,
.drawer-body h1,
.drawer-body h2,
.drawer-body h3,
.drawer-body h4 {
    color: var(--text);
}

.form-ctrl,
input:not([type=checkbox]):not([type=radio]),
select,
textarea {
    background-color: var(--panel-bg);
    color: var(--text);
    border-color: var(--border);
}

.form-ctrl::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text3);
    opacity: 1;
}

select option {
    background-color: var(--panel-bg);
    color: var(--text);
}

.form-ctrl:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--panel-soft) !important;
    color: var(--text3) !important;
    opacity: 1;
}

body.dark {
    --panel-bg: #1e293b;
    --panel-soft: #172032;
    --table-hover: #243046;
}

body.dark .modal,
body.dark .drawer,
body.dark .catalog-modal,
body.dark .employee-edit-modal,
body.dark .filter-card,
body.dark .tbl-card,
body.dark .card,
body.dark .catalog-table,
body.dark .catalog-head,
body.dark .catalog-page {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark .modal-body,
body.dark .drawer-body {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

body.dark .modal-footer,
body.dark .drawer-footer,
body.dark .catalog-footer,
body.dark .tbl-footer,
body.dark .pagination {
    background-color: #172032 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark .modal-hdr,
body.dark .drawer-hdr {
    background-color: #172032 !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark .catalog-modal .modal-hdr,
body.dark .employee-edit-modal > div:first-child {
    background-color: var(--topnav-bg) !important;
    color: #fff !important;
}

body.dark .catalog-inline-check {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark .catalog-inline-check span {
    color: inherit !important;
}

body.dark .modal-hdr h1,
body.dark .modal-hdr h2,
body.dark .modal-hdr h3,
body.dark .modal-hdr div,
body.dark .modal-hdr span,
body.dark .catalog-modal .modal-hdr *,
body.dark .employee-edit-modal > div:first-child * {
    color: inherit !important;
}

body.dark .form-label,
body.dark .catalog-check,
body.dark .modal-body label,
body.dark .modal-body span,
body.dark .drawer-body label,
body.dark .drawer-body span {
    color: #cbd5e1 !important;
}

body.dark .form-ctrl,
body.dark input:not([type=checkbox]):not([type=radio]),
body.dark select,
body.dark textarea {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

body.dark .form-ctrl::placeholder,
body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #94a3b8 !important;
}

body.dark select option {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

body.dark .form-ctrl:disabled,
body.dark input:disabled,
body.dark select:disabled,
body.dark textarea:disabled {
    background-color: #172032 !important;
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8;
}

body.dark *[style*="color:#111827"],
body.dark *[style*="color: #111827"],
body.dark *[style*="color:#1f2937"],
body.dark *[style*="color: #1f2937"],
body.dark *[style*="color:#334155"],
body.dark *[style*="color: #334155"],
body.dark *[style*="color:#1e293b"],
body.dark *[style*="color: #1e293b"] {
    color: #e2e8f0 !important;
}

body.dark *[style*="color:#6b7280"],
body.dark *[style*="color: #6b7280"],
body.dark *[style*="color:#9ca3af"],
body.dark *[style*="color: #9ca3af"],
body.dark *[style*="color:#94a3b8"],
body.dark *[style*="color: #94a3b8"] {
    color: #94a3b8 !important;
}

body.dark .modal-body *[style*="background:#fff"],
body.dark .modal-body *[style*="background: #fff"],
body.dark .drawer-body *[style*="background:#fff"],
body.dark .drawer-body *[style*="background: #fff"] {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

button,
input,
select,
textarea,
.btn,
.form-ctrl,
.modal,
.drawer,
.card,
.tbl-card,
.data-table,
.catalog-page {
    font-family: 'Inter', sans-serif;
}

.ai-dashboard-shell,
.ai-dashboard-shell button,
.ai-dashboard-shell input,
.ai-dashboard-shell select,
.ai-dashboard-shell textarea,
.ai-dashboard-shell .btn,
.ai-dashboard-shell .form-ctrl,
.ai-dashboard-shell .card,
.ai-dashboard-shell .data-table {
    font-family: 'Manrope', sans-serif;
}

input,
select,
textarea,
.form-ctrl {
    font-size: 12.5px;
    line-height: 1.4;
}

/* Unified listview shell: header + scroll body + footer pinned to the bottom.
   This keeps catalog pages, form listviews, and paged tables on the same rhythm. */
.tbl-card:has(> .tbl-footer),
.tbl-card:has(> .pagination),
.catalog-table,
.lotus-listview {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.tbl-card:has(> .tbl-footer),
.tbl-card:has(> .pagination) {
    height: var(--listview-height, min(720px, calc(100vh - 180px)));
    max-height: var(--listview-shell-max-height, calc(100vh - 116px));
}

.lotus-main .tbl-card:has(> .tbl-footer),
.lotus-main .tbl-card:has(> .pagination),
.lotus-main .catalog-table,
.lotus-main .lotus-listview {
    height: var(--listview-height, 100%);
    min-height: 0;
}

.lotus-main .tbl-card[style*="display:flex"][style*="flex-direction:column"][style*="overflow:hidden"],
.lotus-main .tbl-card[style*="display: flex"][style*="flex-direction: column"][style*="overflow: hidden"] {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.lotus-main .filter-card ~ .tbl-card:has(> .tbl-footer),
.lotus-main .filter-card ~ .tbl-card:has(> .pagination),
.lotus-main .page-head ~ .tbl-card:has(> .tbl-footer),
.lotus-main .page-head ~ .tbl-card:has(> .pagination) {
    height: var(--listview-height, calc(100vh - 230px));
}

.catalog-page > .catalog-table,
.catalog-page > .tbl-card,
.lotus-listview-page > .tbl-card {
    flex: 1 1 auto !important;
    height: auto !important;
    max-height: none !important;
}

.lotus-main > .catalog-page,
.lotus-main > .lotus-listview-page,
.lotus-main > .tbl-card,
.lotus-main > .lotus-listview,
.lotus-main > div[style*="height:calc(100vh"],
.lotus-main > div[style*="height: calc(100vh"] {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.tbl-card:has(> .tbl-footer) > .tbl-body-scroll,
.tbl-card:has(> .tbl-footer) > .catalog-table-scroll,
.tbl-card:has(> .tbl-footer) > .lotus-listview-scroll,
.tbl-card:has(> .tbl-footer) > div[style*="overflow:auto"]:has(> table),
.tbl-card:has(> .tbl-footer) > div[style*="overflow: auto"]:has(> table),
.tbl-card:has(> .tbl-footer) > div[style*="overflow-y:auto"]:has(> table),
.tbl-card:has(> .tbl-footer) > div[style*="overflow-y: auto"]:has(> table),
.tbl-card:has(> .pagination) > .tbl-body-scroll,
.tbl-card:has(> .pagination) > .catalog-table-scroll,
.tbl-card:has(> .pagination) > .lotus-listview-scroll,
.tbl-card:has(> .pagination) > div[style*="overflow:auto"]:has(> table),
.tbl-card:has(> .pagination) > div[style*="overflow: auto"]:has(> table),
.tbl-card:has(> .pagination) > div[style*="overflow-y:auto"]:has(> table),
.tbl-card:has(> .pagination) > div[style*="overflow-y: auto"]:has(> table),
.catalog-table > .tbl-body-scroll,
.catalog-table > .catalog-table-scroll,
.lotus-listview > .lotus-listview-scroll,
.lotus-main .tbl-card[style*="display:flex"][style*="flex-direction:column"][style*="overflow:hidden"] > div[style*="overflow:auto"],
.lotus-main .tbl-card[style*="display:flex"][style*="flex-direction:column"][style*="overflow:hidden"] > div[style*="overflow: auto"],
.lotus-main .tbl-card[style*="display: flex"][style*="flex-direction: column"][style*="overflow: hidden"] > div[style*="overflow:auto"],
.lotus-main .tbl-card[style*="display: flex"][style*="flex-direction: column"][style*="overflow: hidden"] > div[style*="overflow: auto"] {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
}

.tbl-card:has(> .tbl-footer) > .tbl-footer,
.tbl-card:has(> .pagination) > .pagination,
.catalog-table > .catalog-footer,
.catalog-table > .tbl-footer,
.lotus-listview > .lotus-listview-footer,
.lotus-main .tbl-card[style*="display:flex"][style*="flex-direction:column"][style*="overflow:hidden"] > div[style*="border-top"],
.lotus-main .tbl-card[style*="display: flex"][style*="flex-direction: column"][style*="overflow: hidden"] > div[style*="border-top"] {
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

.assignment-listview-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
}

.assignment-listview-shell > .assignment-listview,
.assignment-listview-shell > .tbl-card {
    flex: 1 1 auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
}

.tbl-footer,
.catalog-footer,
.pagination,
.lotus-listview-footer {
    justify-content: center !important;
    text-align: center !important;
    gap: 16px;
    flex-wrap: wrap;
}

.tbl-footer > *,
.catalog-footer > *,
.pagination > *,
.lotus-listview-footer > * {
    text-align: center !important;
}

.tbl-body-scroll > table,
.catalog-table-scroll > table,
.lotus-listview-scroll > table,
.tbl-card:has(> .tbl-footer) > div[style*="overflow:auto"]:has(> table) > table,
.tbl-card:has(> .tbl-footer) > div[style*="overflow: auto"]:has(> table) > table,
.tbl-card:has(> .pagination) > div[style*="overflow:auto"]:has(> table) > table,
.tbl-card:has(> .pagination) > div[style*="overflow: auto"]:has(> table) > table,
table.data-table {
    width: max-content;
    min-width: 100%;
}

/* ── Dark Mode Hardening For Blazor Grids ─────────────────────────
   Many legacy pages still render inline light colors. Keep this block at
   the end so dark mode wins over normal inline/background styles. */
body.dark,
body.dark .lotus-shell,
body.dark .app-layout {
    --app-bg: #0f172a !important;
    --panel-bg: #1e293b !important;
    --panel-soft: #172032 !important;
    --table-hover: #243046 !important;
    --blue-lt: #1e3a5f !important;
    --green-lt: #113a2f !important;
    --red-lt: #3b1a23 !important;
    --amber-lt: #3a2b12 !important;
    --gray-lt: #172032 !important;
    --border: #334155 !important;
    --border2: #475569 !important;
    --text: #e2e8f0 !important;
    --text2: #cbd5e1 !important;
    --text3: #94a3b8 !important;
    --gray: #94a3b8 !important;
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

body.dark .lotus-main,
body.dark main,
body.dark .main-content,
body.dark .app-body {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

body.dark .card,
body.dark .tbl-card,
body.dark .lotus-listview,
body.dark .catalog-page,
body.dark .catalog-table,
body.dark .filter-card,
body.dark .modal,
body.dark .drawer,
body.dark .panel,
body.dark .metric-card,
body.dark .mini-stat,
body.dark .quick-card,
body.dark .stat-card,
body.dark .employee-related-table,
body.dark .tbl-body-scroll,
body.dark .catalog-table-scroll,
body.dark .lotus-listview-scroll,
body.dark .table-scroll-both,
body.dark .dept-tree-scroll,
body.dark .assignment-listview,
body.dark .assignment-listview-shell,
body.dark .issue-detail-card,
body.dark .issue-stat,
body.dark .issue-description {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark .tbl-header,
body.dark .tbl-footer,
body.dark .lotus-listview-header,
body.dark .lotus-listview-footer,
body.dark .catalog-head,
body.dark .catalog-selection,
body.dark .catalog-footer,
body.dark .page-head,
body.dark .pagination,
body.dark .modal-hdr,
body.dark .modal-footer,
body.dark .drawer-hdr,
body.dark .drawer-footer {
    background-color: #172032 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark table,
body.dark table.data-table,
body.dark .data-table,
body.dark .assignment-table {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark thead,
body.dark thead tr,
body.dark thead th,
body.dark table.data-table thead th,
body.dark .data-table thead th,
body.dark .assignment-table thead th {
    background-color: #172032 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark tbody,
body.dark tbody tr,
body.dark tbody td,
body.dark table.data-table tbody td,
body.dark .data-table tbody td,
body.dark .assignment-table tbody td {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #263248 !important;
}

body.dark tbody tr:hover,
body.dark tbody tr:hover td,
body.dark table.data-table tbody tr:hover td,
body.dark .data-table tbody tr:hover td,
body.dark .assignment-table tbody tr:hover td {
    background-color: #243046 !important;
}

body.dark tr[style*="#eff6ff"],
body.dark tr[style*="#eff6ff"] > td,
body.dark tr[style*="#dbeafe"],
body.dark tr[style*="#dbeafe"] > td,
body.dark tr.active,
body.dark tr.active > td,
body.dark tr.is-active,
body.dark tr.is-active > td {
    background-color: #1e3a5f !important;
    color: #bfdbfe !important;
}

body.dark .form-ctrl,
body.dark input:not([type=checkbox]):not([type=radio]),
body.dark select,
body.dark textarea,
body.dark .pag-btn,
body.dark .btn:not(.btn-primary):not(.btn-navy),
body.dark .catalog-inline-check {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

body.dark .btn:not(.btn-primary):not(.btn-navy):hover,
body.dark .pag-btn:hover {
    background-color: #243046 !important;
    color: #e2e8f0 !important;
}

body.dark .btn-primary,
body.dark .btn-navy,
body.dark .pag-btn.active {
    color: #ffffff !important;
}

body.dark .badge-blue,
body.dark [style*="background:#eff6ff"],
body.dark [style*="background: #eff6ff"],
body.dark [style*="background-color:#eff6ff"],
body.dark [style*="background-color: #eff6ff"],
body.dark [style*="background:#dbeafe"],
body.dark [style*="background: #dbeafe"],
body.dark [style*="background-color:#dbeafe"],
body.dark [style*="background-color: #dbeafe"],
body.dark [style*="background:#eef2ff"],
body.dark [style*="background: #eef2ff"] {
    background-color: #1e3a5f !important;
    color: #bfdbfe !important;
    border-color: #3b82f6 !important;
}

body.dark .badge-green,
body.dark [style*="background:#ecfdf5"],
body.dark [style*="background: #ecfdf5"],
body.dark [style*="background:#f0fdf4"],
body.dark [style*="background: #f0fdf4"],
body.dark [style*="background:#dcfce7"],
body.dark [style*="background: #dcfce7"] {
    background-color: #113a2f !important;
    color: #86efac !important;
    border-color: #166534 !important;
}

body.dark .badge-amber,
body.dark [style*="background:#fef3c7"],
body.dark [style*="background: #fef3c7"],
body.dark [style*="background:#fffbeb"],
body.dark [style*="background: #fffbeb"] {
    background-color: #3a2b12 !important;
    color: #facc15 !important;
    border-color: #92400e !important;
}

body.dark .badge-red,
body.dark [style*="background:#fee2e2"],
body.dark [style*="background: #fee2e2"],
body.dark [style*="background:#fef2f2"],
body.dark [style*="background: #fef2f2"],
body.dark [style*="background:#fff1f2"],
body.dark [style*="background: #fff1f2"] {
    background-color: #3b1a23 !important;
    color: #fca5a5 !important;
    border-color: #991b1b !important;
}

body.dark .badge-gray,
body.dark [style*="background:#f1f5f9"],
body.dark [style*="background: #f1f5f9"],
body.dark [style*="background:#f3f4f6"],
body.dark [style*="background: #f3f4f6"],
body.dark [style*="background:#f8fafc"],
body.dark [style*="background: #f8fafc"],
body.dark [style*="background:#fafbfc"],
body.dark [style*="background: #fafbfc"],
body.dark [style*="background:#fbfdff"],
body.dark [style*="background: #fbfdff"],
body.dark [style*="background-color:#f8fafc"],
body.dark [style*="background-color: #f8fafc"] {
    background-color: #172032 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.dark [style*="background:#fff"],
body.dark [style*="background: #fff"],
body.dark [style*="background:#ffffff"],
body.dark [style*="background: #ffffff"],
body.dark [style*="background:#FFFFFF"],
body.dark [style*="background: #FFFFFF"],
body.dark [style*="background:white"],
body.dark [style*="background: white"],
body.dark [style*="background-color:#fff"],
body.dark [style*="background-color: #fff"],
body.dark [style*="background-color:#ffffff"],
body.dark [style*="background-color: #ffffff"],
body.dark [style*="background-color:white"],
body.dark [style*="background-color: white"] {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark [style*="background:linear-gradient"][style*="#ffffff"],
body.dark [style*="background: linear-gradient"][style*="#ffffff"],
body.dark [style*="background:linear-gradient"][style*="#fff"],
body.dark [style*="background: linear-gradient"][style*="#fff"],
body.dark [style*="background:linear-gradient"][style*="#f8fafc"],
body.dark [style*="background: linear-gradient"][style*="#f8fafc"] {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark [style*="border:1px solid #e2e8f0"],
body.dark [style*="border: 1px solid #e2e8f0"],
body.dark [style*="border-color:#e2e8f0"],
body.dark [style*="border-color: #e2e8f0"],
body.dark [style*="border-left:1px solid #e2e8f0"],
body.dark [style*="border-left: 1px solid #e2e8f0"],
body.dark [style*="border-right:1px solid #e2e8f0"],
body.dark [style*="border-right: 1px solid #e2e8f0"],
body.dark [style*="border-top:1px solid #e2e8f0"],
body.dark [style*="border-top: 1px solid #e2e8f0"],
body.dark [style*="border-bottom:1px solid #e2e8f0"],
body.dark [style*="border-bottom: 1px solid #e2e8f0"],
body.dark [style*="border-bottom:1px solid #f1f5f9"],
body.dark [style*="border-bottom: 1px solid #f1f5f9"] {
    border-color: #334155 !important;
}

body.dark [style*="color:#0f172a"],
body.dark [style*="color: #0f172a"],
body.dark [style*="color:#111827"],
body.dark [style*="color: #111827"],
body.dark [style*="color:#1f2937"],
body.dark [style*="color: #1f2937"],
body.dark [style*="color:#334155"],
body.dark [style*="color: #334155"],
body.dark [style*="color:#374151"],
body.dark [style*="color: #374151"] {
    color: #e2e8f0 !important;
}

body.dark [style*="color:#475569"],
body.dark [style*="color: #475569"],
body.dark [style*="color:#64748b"],
body.dark [style*="color: #64748b"],
body.dark [style*="color:#6b7280"],
body.dark [style*="color: #6b7280"],
body.dark [style*="color:#94a3b8"],
body.dark [style*="color: #94a3b8"],
body.dark .page-sub,
body.dark .stat-lbl,
body.dark .form-label,
body.dark .catalog-check,
body.dark small {
    color: #94a3b8 !important;
}

body.dark [style*="color:#1d4ed8"],
body.dark [style*="color: #1d4ed8"],
body.dark [style*="color:#2563eb"],
body.dark [style*="color: #2563eb"] {
    color: #60a5fa !important;
}

/* Re-apply semantic tints after the generic #fff fallback above. */
body.dark [style*="background:#dbeafe"],
body.dark [style*="background: #dbeafe"],
body.dark [style*="background:#e6f0ff"],
body.dark [style*="background: #e6f0ff"],
body.dark [style*="background:#e8f4ff"],
body.dark [style*="background: #e8f4ff"],
body.dark [style*="background:#eff6ff"],
body.dark [style*="background: #eff6ff"],
body.dark [style*="background:#eef5ff"],
body.dark [style*="background: #eef5ff"] {
    background-color: #1e3a5f !important;
    color: #bfdbfe !important;
    border-color: #3b82f6 !important;
}

body.dark [style*="background:#dcfce7"],
body.dark [style*="background: #dcfce7"],
body.dark [style*="background:#e5fbef"],
body.dark [style*="background: #e5fbef"],
body.dark [style*="background:#ecfdf5"],
body.dark [style*="background: #ecfdf5"],
body.dark [style*="background:#f0fdf4"],
body.dark [style*="background: #f0fdf4"] {
    background-color: #113a2f !important;
    color: #86efac !important;
    border-color: #166534 !important;
}

body.dark [style*="background:#fef3c7"],
body.dark [style*="background: #fef3c7"],
body.dark [style*="background:#fffbeb"],
body.dark [style*="background: #fffbeb"],
body.dark [style*="background:#fff5db"],
body.dark [style*="background: #fff5db"],
body.dark [style*="background:#fff0dd"],
body.dark [style*="background: #fff0dd"] {
    background-color: #3a2b12 !important;
    color: #facc15 !important;
    border-color: #92400e !important;
}

body.dark [style*="background:#fee2e2"],
body.dark [style*="background: #fee2e2"],
body.dark [style*="background:#ffe8e8"],
body.dark [style*="background: #ffe8e8"],
body.dark [style*="background:#ffecec"],
body.dark [style*="background: #ffecec"],
body.dark [style*="background:#fef2f2"],
body.dark [style*="background: #fef2f2"],
body.dark [style*="background:#fff1f2"],
body.dark [style*="background: #fff1f2"] {
    background-color: #3b1a23 !important;
    color: #fca5a5 !important;
    border-color: #991b1b !important;
}

body.dark .tbl-body-scroll::-webkit-scrollbar-track,
body.dark .catalog-table-scroll::-webkit-scrollbar-track,
body.dark .lotus-listview-scroll::-webkit-scrollbar-track,
body.dark .employee-related-table::-webkit-scrollbar-track,
body.dark .table-scroll-both::-webkit-scrollbar-track,
body.dark .dept-tree-scroll::-webkit-scrollbar-track,
body.dark div[style*="overflow:auto"]:has(> table)::-webkit-scrollbar-track,
body.dark div[style*="overflow: auto"]:has(> table)::-webkit-scrollbar-track {
    background: #172032 !important;
}

body.dark .tbl-body-scroll::-webkit-scrollbar-thumb,
body.dark .catalog-table-scroll::-webkit-scrollbar-thumb,
body.dark .lotus-listview-scroll::-webkit-scrollbar-thumb,
body.dark .employee-related-table::-webkit-scrollbar-thumb,
body.dark .table-scroll-both::-webkit-scrollbar-thumb,
body.dark .dept-tree-scroll::-webkit-scrollbar-thumb,
body.dark div[style*="overflow:auto"]:has(> table)::-webkit-scrollbar-thumb,
body.dark div[style*="overflow: auto"]:has(> table)::-webkit-scrollbar-thumb {
    background: #64748b !important;
    border-color: #1e293b !important;
}
