:root {
    --en-navy: #123B56;
    --en-navy-dark: #0C2D42;
    --en-bg: #F4F7FA;
    --en-card: #FFFFFF;
    --en-text: #1F2937;
    --en-muted: #64748B;
    --en-border: #DDE3EA;
    --en-success: #16A34A;
    --en-warning: #F59E0B;
    --en-danger: #DC2626;
    --en-info: #2563EB;
    --en-sidebar: 240px;
    --en-sidebar-collapsed: 76px;
    --en-topbar: 72px;
    --en-content-offset: 88px;
    --en-z-header: 1030;
    --en-z-sidebar: 1040;
    --en-radius: 8px;
    --en-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(18, 59, 86, .06);
    --en-focus: 0 0 0 3px rgba(18, 59, 86, .18);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    background: var(--en-bg);
    color: var(--en-text);
    font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

html { scroll-padding-top: var(--en-content-offset); }

body.en-app-body { min-height: 100vh; }

a { color: var(--en-navy); }
a:hover { color: var(--en-navy-dark); }

:focus-visible {
    outline: 2px solid var(--en-navy);
    outline-offset: 2px;
}

.en-skip-link {
    position: fixed;
    z-index: 1200;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    border-radius: var(--en-radius);
    background: #fff;
    color: var(--en-navy-dark);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform .16s ease;
}
.en-skip-link:focus { transform: translateY(0); }

.en-shell { min-height: 100vh; display: flex; }

.en-sidebar {
    width: var(--en-sidebar);
    background: #fff;
    border-right: 1px solid var(--en-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: var(--en-z-sidebar);
    transition: width .2s ease, transform .2s ease;
}

.en-sidebar-brand {
    height: var(--en-topbar);
    background: var(--en-navy-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 16px;
    flex-shrink: 0;
}

.en-sidebar-brand strong { font-size: 15px; letter-spacing: .01em; }
.en-sidebar-brand span { font-size: 11px; opacity: .78; }

.en-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.en-nav-section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--en-muted);
    padding: 10px 10px 6px;
}
.en-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
}
.en-nav a svg { width: 18px; height: 18px; flex-shrink: 0; color: #94a3b8; }
.en-nav a:hover {
    background: rgba(18, 59, 86, .08);
    color: var(--en-navy);
}
.en-nav a:hover svg { color: var(--en-navy); }
.en-nav a.active {
    background: rgba(18, 59, 86, .12);
    color: var(--en-navy);
}
.en-nav a.active svg { color: var(--en-navy); }

.en-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.en-topbar {
    height: var(--en-topbar);
    background: linear-gradient(90deg, var(--en-navy) 0%, var(--en-navy-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: var(--en-z-header);
    border-bottom: 3px solid rgba(255,255,255,.14);
}

.en-topbar h1, .en-topbar-title { font-size: 16px; font-weight: 600; margin: 0; }
.en-topbar .muted { color: rgba(255,255,255,.78); font-size: 12px; }
.en-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    color: #fff;
}
.en-icon-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

.en-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    background: rgba(255,255,255,.1);
    border: 0;
    color: #fff;
    border-radius: 8px;
    padding: 4px 10px 4px 4px;
}
.en-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: #fff; color: var(--en-navy);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}

.en-content { padding: 20px; flex: 1; scroll-margin-top: var(--en-content-offset); }

.en-card {
    background: var(--en-card);
    border: 1px solid var(--en-border);
    border-radius: var(--en-radius);
    box-shadow: var(--en-shadow);
}

.en-card .card-body, .card .card-body { padding: 16px; }
.card {
    border: 1px solid var(--en-border);
    border-radius: var(--en-radius);
    box-shadow: var(--en-shadow);
}

.btn-primary, .btn-dark {
    --bs-btn-bg: var(--en-navy);
    --bs-btn-border-color: var(--en-navy);
    --bs-btn-hover-bg: var(--en-navy-dark);
    --bs-btn-hover-border-color: var(--en-navy-dark);
    --bs-btn-active-bg: var(--en-navy-dark);
    --bs-btn-disabled-bg: var(--en-navy);
    background: var(--en-navy);
    border-color: var(--en-navy);
}
.btn-primary:hover, .btn-dark:hover { background: var(--en-navy-dark); border-color: var(--en-navy-dark); }

.btn-settle {
    min-height: 52px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
}

.form-control, .form-select {
    border-color: var(--en-border);
    border-radius: 8px;
    min-height: 38px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--en-navy);
    box-shadow: var(--en-focus);
}

.en-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    border: 1px solid var(--en-border);
    border-radius: var(--en-radius);
    background: var(--en-card);
    padding: 12px 14px;
    height: 100%;
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--en-shadow);
    min-height: 92px;
}
.stat-card:hover { border-color: var(--en-navy); color: inherit; }
.stat-card .stat-icon {
    width: 28px; height: 28px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.stat-card .label { color: var(--en-muted); font-size: 12px; font-weight: 500; }
.stat-card .value { font-size: 20px; font-weight: 700; line-height: 1.2; }
.stat-tone-navy .stat-icon { background: rgba(18,59,86,.1); color: var(--en-navy); }
.stat-tone-info .stat-icon { background: rgba(37,99,235,.12); color: var(--en-info); }
.stat-tone-success .stat-icon { background: rgba(22,163,74,.12); color: var(--en-success); }
.stat-tone-warning .stat-icon { background: rgba(245,158,11,.14); color: #b45309; }
.stat-tone-danger .stat-icon { background: rgba(220,38,38,.1); color: var(--en-danger); }

.en-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    background: #fff;
    border: 1px solid var(--en-border);
    border-radius: var(--en-radius);
    padding: 12px;
    margin-bottom: 16px;
    box-shadow: var(--en-shadow);
}

.en-table-wrap { overflow-x: auto; }
.en-table {
    width: 100%;
    margin: 0;
    background: #fff;
}
.en-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--en-border);
    white-space: nowrap;
}
.en-table tbody tr:nth-child(even) { background: #fbfdff; }
.en-table tbody tr:hover { background: #f1f5f9; }
.en-table tbody tr.is-abnormal { background: #fff7ed; }
.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }

.en-badge, .status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    border-radius: 999px; padding: 3px 8px; font-weight: 600; font-size: 12px; white-space: nowrap;
}
.status-draft { background: #f1f5f9; color: #64748b; }
.status-registered { background: #eff6ff; color: #1d4ed8; }
.status-late_registered { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.status-changed { background: #f5f3ff; color: #6d28d9; }
.status-settled { background: #ecfdf3; color: #067647; border: 1px solid #86efac; }
.status-reopened { background: #fffbeb; color: #b45309; }
.status-period_locked { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.status-pending { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.status-approved { background: #ecfdf3; color: #067647; border: 1px solid #86efac; }
.status-rejected { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.en-badge-role { background: rgba(18,59,86,.1); color: var(--en-navy); }
.en-badge-on { background: #ecfdf3; color: #067647; }
.en-badge-off { background: #f1f5f9; color: #64748b; }
.en-badge-wait { background: #fff7ed; color: #c2410c; }
.en-badge-abnormal { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }

.en-page-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
    align-items: center; margin-bottom: 16px;
}

.en-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--en-border);
}
.en-page-header-copy { min-width: min(100%, 320px); flex: 1; }
.en-page-header h1 { margin: 0; color: var(--en-navy-dark); font-size: clamp(21px, 2vw, 27px); line-height: 1.25; font-weight: 700; }
.en-page-header p { max-width: 76ch; margin: 6px 0 0; color: var(--en-muted); }
.en-page-header-actions { min-width: min(100%, 320px); }

.en-app-switch-menu { width: min(320px, calc(100vw - 24px)); padding: 8px; }
.en-app-switch-heading { display: grid; gap: 3px; padding: 8px 10px 12px; }
.en-app-switch-heading strong { color: var(--en-navy-dark); }
.en-app-switch-heading span { color: var(--en-muted); font-size: 12px; }
.en-app-switch-link { min-height: 58px; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 10px; border-radius: 6px; }
.en-app-switch-link > span:nth-child(2) { min-width: 0; }
.en-app-switch-link strong, .en-app-switch-link small { display: block; }
.en-app-switch-link small { color: var(--en-muted); white-space: normal; }
.en-app-switch-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(18,59,86,.09); color: var(--en-navy); }
.en-app-switch-link .en-svg { flex: 0 0 auto; }
.en-account-menu { min-width: 230px; }
.en-error-summary { scroll-margin-top: var(--en-content-offset); }

.en-overlay {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035;
}
body.sidebar-open .en-overlay { display: block; }

.en-toast-stack {
    position: fixed; right: 16px; bottom: 16px; z-index: 1080;
    display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.en-toast {
    background: #fff; border: 1px solid var(--en-border); border-left: 4px solid var(--en-navy);
    border-radius: 8px; box-shadow: var(--en-shadow); padding: 12px 14px;
}
.en-toast.is-success { border-left-color: var(--en-success); }
.en-toast.is-warning { border-left-color: var(--en-warning); }
.en-toast.is-error { border-left-color: var(--en-danger); }

.en-empty { text-align: center; color: var(--en-muted); padding: 40px 16px; }

.dropdown-menu { border-radius: 8px; border-color: var(--en-border); box-shadow: var(--en-shadow); }

body.sidebar-collapsed .en-sidebar { width: var(--en-sidebar-collapsed); }
body.sidebar-collapsed .en-sidebar-brand span,
body.sidebar-collapsed .en-nav a span,
body.sidebar-collapsed .en-nav-section { display: none; }
body.sidebar-collapsed .en-nav a { justify-content: center; }

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #F4F7FA 0%, #E8EEF4 45%, #D6E2EC 100%);
    padding: 24px;
}
.login-card { width: min(920px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; }
.login-card-brand { min-height: 460px; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(28px, 5vw, 56px); background: var(--en-navy-dark); color: #fff; }
.login-product { margin-bottom: auto; font-weight: 700; }
.login-card-brand h1 { margin: 32px 0 14px; font-size: clamp(30px, 4vw, 46px); line-height: 1.12; letter-spacing: -.025em; }
.login-card-brand p { max-width: 52ch; margin: 0; color: rgba(255,255,255,.76); font-size: 15px; }
.login-card-action { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 48px); background: #fff; }
.login-kicker { margin: 0 0 8px; color: var(--en-navy); font-size: 12px; font-weight: 700; }
.login-sso-button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; }
.login-help { margin-top: 14px; color: var(--en-muted); font-size: 12px; }

.en-hm-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.en-credit-preview {
    background: #f0f7fb;
    border: 1px solid #c5d8e6;
    border-radius: var(--en-radius);
    padding: 14px 16px;
}
.en-credit-preview .preview-total {
    font-size: 28px;
    font-weight: 700;
    color: var(--en-navy);
    font-variant-numeric: tabular-nums;
}
.en-credit-preview.is-abnormal {
    background: #fff7ed;
    border-color: #fdba74;
}
.en-credit-preview .preview-warn {
    color: #c2410c;
    font-size: 13px;
    margin-top: 6px;
}

.en-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1085;
}
.en-sheet-backdrop.is-open { display: block; }
.en-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1090;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, .18);
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    transition: transform .22s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.en-sheet.is-open { transform: translateY(0); }
.en-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0 auto 14px;
}
@media (min-width: 768px) {
    .en-sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: min(440px, 92vw);
        border-radius: 12px;
        transform: translate(-50%, -40%) scale(.96);
        opacity: 0;
        pointer-events: none;
        max-height: 80vh;
    }
    .en-sheet.is-open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }
}

.en-panel {
    background: #fff;
    border: 1px solid var(--en-border);
    border-radius: var(--en-radius);
    box-shadow: var(--en-shadow);
    padding: 16px;
    margin-bottom: 16px;
}

@media (max-width: 991.98px) {
    .en-sidebar {
        position: fixed;
        transform: translateX(-105%);
        box-shadow: var(--en-shadow);
    }
    body.sidebar-open .en-sidebar { transform: none; }
    .en-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-card { grid-template-columns: 1fr; max-width: 620px; }
    .login-card-brand { min-height: 260px; }
}
@media (max-width: 575.98px) {
    :root { --en-topbar: 64px; --en-content-offset: 76px; }
    .en-stat-grid { grid-template-columns: 1fr; }
    .en-content { padding: 12px; }
    .en-toast-stack { left: 12px; right: 12px; max-width: none; bottom: 12px; }
    .en-topbar { padding: 0 10px; gap: 8px; }
    .en-page-header { align-items: stretch; }
    .en-page-header-actions { min-width: 100%; }
    .ws-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; }
    .login-shell { padding: 12px; }
    .login-card-brand { min-height: 230px; padding: 24px; }
    .login-card-action { padding: 24px; }
}

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

.ws-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    background: #fff;
    border: 1px solid var(--en-border);
    border-radius: var(--en-radius);
    padding: 10px 14px;
    font-size: 13px;
}
.ws-filters .ws-filter-search { min-width: 180px; flex: 1; }
.ws-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.ws-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 12px;
    color: var(--en-muted);
    margin: 0 0 10px;
}
.ws-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid var(--en-border);
    vertical-align: -2px;
    margin-right: 4px;
}
.ws-grid-wrap {
    overflow: auto;
    max-height: calc(100vh - 240px);
    border: 1px solid var(--en-border);
    border-radius: var(--en-radius);
    background: #fff;
    box-shadow: var(--en-shadow);
}
.ws-grid {
    --ws-code-w: 72px;
    --ws-name-w: 148px;
    --ws-branch-w: 110px;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1100px;
    width: max-content;
}
.ws-grid th,
.ws-grid td {
    border-right: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    padding: 0;
    vertical-align: middle;
}
.ws-grid thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    min-width: 46px;
    height: 42px;
}
.ws-grid .ws-sticky {
    position: sticky;
    z-index: 5;
    background: #fff;
    box-shadow: 1px 0 0 #edf1f5;
}
.ws-grid thead .ws-sticky { z-index: 7; background: #f8fafc; }
.ws-sticky-code,
.ws-sticky-name,
.ws-sticky-branch {
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ws-sticky-code {
    left: 0;
    width: var(--ws-code-w);
    min-width: var(--ws-code-w);
    max-width: var(--ws-code-w);
    padding: 6px 8px !important;
    text-align: left !important;
    white-space: nowrap;
}
.ws-sticky-name {
    left: var(--ws-code-w);
    width: var(--ws-name-w);
    min-width: var(--ws-name-w);
    max-width: var(--ws-name-w);
    padding: 6px 8px !important;
    text-align: left !important;
}
.ws-sticky-branch {
    left: calc(var(--ws-code-w) + var(--ws-name-w));
    width: var(--ws-branch-w);
    min-width: var(--ws-branch-w);
    max-width: var(--ws-branch-w);
    padding: 6px 8px !important;
    text-align: left !important;
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
}
.ws-day-h.is-today,
.ws-grid td.is-today { background: #fff7ed; }
.ws-grid thead th.is-today { background: #ffedd5; color: #9a3412; }
.ws-day-num { display: block; font-size: 13px; line-height: 1.1; }
.ws-day-wk { display: block; font-size: 10px; font-weight: 500; color: #94a3b8; }
.ws-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 100%;
    min-height: 54px;
    border: 0;
    background: transparent;
    padding: 4px 2px;
    font-size: 10px;
    line-height: 1.15;
    color: inherit;
    cursor: pointer;
}
.ws-cell:focus-visible { outline: 2px solid var(--en-navy); outline-offset: -2px; }
.ws-cell-shift {
    font-weight: 700;
    font-size: 10px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 58px;
}
.ws-cell-adjust,
.ws-cell-credit {
    font-size: 9px;
    text-align: center;
    white-space: normal;
    max-width: 58px;
}
.ws-cell-adjust { color: inherit; }
.ws-cell-credit { color: inherit; opacity: 0.9; }
.ws-cell-state { font-size: 9px; white-space: nowrap; }
.ws-cell-marker {
    font-size: 9px;
    font-weight: 700;
    color: #9a3412;
    background: #ffedd5;
    border-radius: 999px;
    padding: 0 4px;
}
.ws-cell--empty { background: #fff; color: #94a3b8; }
.ws-cell--future { background: #dcfce7; color: #166534; }
.ws-cell--today { background: #fef08a; color: #854d0e; }
.ws-cell--settled { background: #fecaca; color: #991b1b; }
.ws-cell--overdue { background: #fdba74; color: #9a3412; }
.ws-cell--exempt { background: #e2e8f0; color: #475569; }
.ws-cell--locked { background: #475569; color: #f8fafc; }
.kpi-cell { align-items:center; justify-content:center; }
.kpi-cell strong { font-size:13px; }
.kpi-cell span { font-size:9px; }
.kpi-cell--empty { background:#fff; color:#94a3b8; }
.kpi-cell--pending { background:#fef08a; color:#854d0e; }
.kpi-cell--approved { background:#dcfce7; color:#166534; }
.kpi-cell--rejected { background:#fecaca; color:#991b1b; }
.kpi-cell--locked { background:#475569; color:#f8fafc; }
.ws-cell--locked .ws-cell-loc,
.ws-cell--locked .ws-cell-state { color: #e2e8f0; }
.ws-row-total,
.ws-total-h {
    min-width: 72px;
    text-align: center !important;
    padding: 6px !important;
    font-size: 12px;
    background: #f8fafc;
}
.ws-row-total span { display: block; color: var(--en-muted); font-size: 11px; }
.ws-exempt-tag,
.ws-self-tag,
.ws-probation-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    padding: 0 6px;
    margin-left: 4px;
}
.ws-self-tag { background: #e0f2fe; color: #075985; }
.ws-probation-tag { background: #f1f5f9; color: #475569; }
.ws-exempt-tag { background: #fef3c7; color: #92400e; }
.ws-grid tbody tr.is-self .ws-sticky { background: #f0f9ff; }
.ws-adjust {
    border: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ws-log-list { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.ws-log-list li { border-bottom: 1px solid #edf1f5; padding: 6px 0; }
.en-sheet-wide { max-width: none; }
@media (min-width: 768px) {
    .en-sheet.en-sheet-wide {
        width: min(640px, 94vw);
    }
}
@media (max-width: 767.98px) {
    .ws-grid {
        --ws-name-w: 112px;
        min-width: 0;
    }
    .ws-grid .ws-sticky-code,
    .ws-grid .ws-sticky-branch {
        position: relative;
        left: auto;
        z-index: 1;
        width: auto;
        min-width: 72px;
        max-width: none;
        box-shadow: none;
    }
    .ws-grid thead .ws-sticky-code,
    .ws-grid thead .ws-sticky-branch {
        position: sticky;
        top: 0;
        left: auto;
        z-index: 4;
    }
    .ws-grid .ws-sticky-name {
        position: sticky;
        left: 0;
        width: var(--ws-name-w);
        min-width: var(--ws-name-w);
        max-width: var(--ws-name-w);
        z-index: 6;
        white-space: nowrap;
    }
    .ws-grid thead .ws-sticky-name { z-index: 8; }
    .ws-grid thead th.ws-day-h,
    .ws-grid td {
        min-width: 52px;
    }
}

/* Visual convergence — Én product shell v2. HRM keeps its dense calendar grid. */
:root {
    --en-accent: #d9147d;
    --en-canvas: #f4f7fa;
    --en-surface: #ffffff;
    --en-text-strong: #172a38;
    --en-border-strong: #b9c8d2;
    --en-shadow-menu: 0 18px 40px rgba(12, 45, 66, .16);
    --en-transition: 160ms ease;
}

body.en-app-body,
body.en-guest-body { background: var(--en-canvas); color: var(--en-text-strong); }

.en-sidebar {
    background: var(--en-surface);
    box-shadow: none;
}
.en-sidebar-brand {
    height: var(--en-topbar);
    padding: 0 14px;
    background: var(--en-surface);
    color: var(--en-text-strong);
    border-bottom: 1px solid var(--en-border);
}
.en-sidebar-brand-link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}
.en-sidebar-brand-link:hover { color: inherit; }
.en-sidebar-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: block;
    object-fit: contain;
}
.en-sidebar-brand-copy { min-width: 0; display: grid; gap: 1px; }
.en-sidebar-brand strong { overflow: hidden; color: var(--en-navy-dark); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.en-sidebar-brand span span,
.en-sidebar-brand-copy > span { overflow: hidden; color: var(--en-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.en-nav { padding: 18px 12px; }
.en-nav-section {
    padding: 16px 10px 7px;
    color: #71818d;
    font-size: 10px;
    letter-spacing: .07em;
}
.en-nav-section:first-child { padding-top: 4px; }
.en-nav a {
    position: relative;
    min-height: 42px;
    margin-bottom: 3px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #475c6a;
    transition: background var(--en-transition), border-color var(--en-transition), color var(--en-transition);
}
.en-nav a:hover { background: #f1f5f8; border-color: #e5ebef; }
.en-nav a.active {
    background: #eaf1f5;
    border-color: #d6e2e9;
    color: var(--en-navy-dark);
    font-weight: 700;
}
.en-nav a.active::before {
    content: "";
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -13px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--en-accent);
}
.en-nav a svg { color: #8295a2; transition: color var(--en-transition); }
.en-nav a.active svg { color: var(--en-navy-dark); }

.en-topbar {
    background: var(--en-navy-dark);
    border-bottom: 3px solid var(--en-accent);
    box-shadow: none;
    padding-inline: clamp(12px, 2vw, 24px);
}
.en-topbar h1,
.en-topbar-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.en-icon-btn,
.en-user-chip {
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
    transition: background var(--en-transition), border-color var(--en-transition);
}
.en-icon-btn:hover,
.en-icon-btn[aria-expanded="true"],
.en-user-chip:hover,
.en-user-chip[aria-expanded="true"] { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.34); }
.en-app-switch-menu,
.en-account-menu,
.dropdown-menu { border-radius: 8px; box-shadow: var(--en-shadow-menu); }

.en-content {
    width: 100%;
    padding: 24px clamp(16px, 2.2vw, 30px) 56px;
}
.en-page-header {
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--en-border);
}
.en-page-route {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    color: var(--en-accent);
    font-size: 12px;
    font-weight: 700;
}
.en-page-route i { width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.en-page-header h1 {
    font-size: clamp(23px, 2vw, 30px);
    letter-spacing: -.025em;
}
.en-page-header p { margin-top: 7px; color: #586b78; font-size: 14px; line-height: 1.55; }
.en-page-header-actions { align-self: center; }

.en-card,
.card,
.en-panel,
.en-toolbar,
.ws-grid-wrap,
.ws-summary {
    border-color: var(--en-border);
    border-radius: 8px;
    box-shadow: none;
}
.en-toolbar {
    position: relative;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 14px;
    padding: 14px 16px;
}
.en-toolbar::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 16px;
    width: 42px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--en-accent);
}
.en-toolbar .form-label { margin-bottom: 5px; color: #536875; font-size: 12px; font-weight: 600; }
.en-toolbar .form-control,
.en-toolbar .form-select { min-height: 42px; }
.btn { border-radius: 7px; font-weight: 600; }
.btn-primary,
.btn-dark { box-shadow: 0 1px 0 rgba(12,45,66,.18); }
.btn-outline-secondary { --bs-btn-color: #425866; --bs-btn-border-color: #b9c8d2; --bs-btn-hover-bg: #edf3f6; --bs-btn-hover-color: #0c2d42; --bs-btn-hover-border-color: #9eb1bd; }

.ws-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(82px, auto));
    gap: 0;
    overflow: hidden;
    padding: 0;
    background: var(--en-surface);
}
.ws-summary span { min-width: 0; display: grid; gap: 3px; padding: 9px 12px; border-left: 1px solid var(--en-border); color: var(--en-muted); font-size: 10px; line-height: 1.25; }
.ws-summary span:first-child { border-left: 0; }
.ws-summary strong { color: var(--en-navy-dark); font-size: 15px; font-variant-numeric: tabular-nums; }

.ws-legend {
    gap: 7px;
    margin-bottom: 10px;
    padding: 0 2px;
    color: #536875;
}
.ws-legend > span { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 8px; border: 1px solid var(--en-border); border-radius: 999px; background: #fff; }
.ws-dot { flex: 0 0 10px; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; }
.ws-grid-wrap { background: #fff; }
.ws-grid thead th { background: #f1f5f8; color: #415866; }
.ws-grid thead .ws-sticky { background: #f1f5f8; }
.ws-grid th,
.ws-grid td { border-color: #e6edf1; }
.ws-grid tbody tr:hover .ws-sticky,
.ws-grid tbody tr:hover td { box-shadow: inset 0 0 0 999px rgba(18,59,86,.025); }
.ws-cell { transition: filter var(--en-transition), box-shadow var(--en-transition); }
.ws-cell:hover { filter: saturate(1.05) brightness(.985); box-shadow: inset 0 0 0 1px rgba(12,45,66,.16); }
.ws-cell-state { display: inline-flex; align-items: center; gap: 4px; }
.ws-cell-state::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border: 1px solid currentColor; border-radius: 50%; background: transparent; }
.ws-cell--future .ws-cell-state::before,
.ws-cell--settled .ws-cell-state::before,
.ws-cell--overdue .ws-cell-state::before,
.ws-cell--today .ws-cell-state::before { background: currentColor; }
.ws-cell--locked .ws-cell-state::before { border-radius: 2px; background: currentColor; }
.ws-cell--empty { color: #718391; }
.ws-cell--future { background: #e9f8ef; color: #176b45; }
.ws-cell--today { background: #fff2bf; color: #755000; }
.ws-cell--settled { background: #fbe3e7; color: #9f2232; }
.ws-cell--overdue { background: #ffdfc4; color: #9a4313; }
.ws-cell--exempt { background: #edf1f4; color: #536572; }
.ws-cell--locked { background: #425866; color: #fff; }
.kpi-cell--pending { background: #fff2bf; color: #755000; }
.kpi-cell--approved { background: #e9f8ef; color: #176b45; }
.kpi-cell--rejected { background: #fbe3e7; color: #9f2232; }

.en-table thead th { background: #f1f5f8; color: #415866; }
.en-table tbody tr:nth-child(even) { background: #fbfcfd; }
.en-table tbody tr:hover { background: #f0f5f8; }

.login-shell {
    position: relative;
    overflow: hidden;
    background: var(--en-canvas);
}
.login-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 0 49.9%, rgba(18,59,86,.055) 50% 50.1%, transparent 50.2%);
}
.login-card { position: relative; z-index: 1; border-color: var(--en-border); box-shadow: 0 24px 60px rgba(12,45,66,.12); }
.login-card-brand { background: var(--en-navy-dark); }
.login-product { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.login-product > span { font-size: 13px; font-weight: 700; }
.login-brand-logo { width: 154px; height: 104px; display: block; object-fit: contain; object-position: left center; }
.login-card-brand h1 { letter-spacing: -.035em; }
.login-kicker { color: var(--en-accent); }

body.sidebar-collapsed .en-sidebar-brand-copy { display: none; }
body.sidebar-collapsed .en-sidebar-brand { padding-inline: 18px; }

@media (max-width: 991.98px) {
    .en-sidebar { box-shadow: var(--en-shadow-menu); }
    .en-page-header-actions { width: 100%; }
    .ws-summary { width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .en-content { padding: 18px 14px 44px; }
    .en-page-header { gap: 12px; padding-bottom: 15px; }
    .en-page-header h1 { font-size: 23px; }
    .en-page-route { margin-bottom: 5px; }
    .en-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px 12px 12px; }
    .en-toolbar > .ws-filter-search,
    .en-toolbar > .ws-filter-exempt,
    .en-toolbar > .ws-filter-actions { grid-column: 1 / -1; }
    .en-toolbar > .ws-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .en-toolbar > .ws-filter-actions .btn:first-child { grid-column: 1 / -1; }
    .en-toolbar > button.btn-primary { align-self: end; min-height: 42px; }
    .ws-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .ws-summary span { border-top: 1px solid var(--en-border); }
    .ws-summary span:nth-child(-n+2) { border-top: 0; }
    .ws-summary span:nth-child(odd) { border-left: 0; }
    .ws-legend { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
    .ws-legend > span { flex: 0 0 auto; }
}

@media (max-width: 575.98px) {
    .en-topbar { padding-inline: 10px; }
    .en-topbar-title,
    .en-topbar h1 { max-width: 118px; }
    .en-content { padding-inline: 12px; }
    .login-card { border-radius: 8px; }
    .login-card-brand { min-height: 250px; }
    .login-card-brand h1 { font-size: 30px; }
}
