:root {
    --navy: #10234b;
    --blue: #2459da;
    --blue-dark: #153c9f;
    --blue-soft: #eef4ff;
    --surface: #ffffff;
    --background: #f4f6f9;
    --border: #e6eaf0;
    --text: #19243a;
    --muted: #7b879b;
    --green: #168754;
    --red: #d94b50;
    --amber: #b87709;
    --shadow: 0 8px 28px rgba(24, 40, 72, .07);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 236px;
    display: flex;
    flex-direction: column;
    padding: 28px 18px 20px;
    color: #fff;
    background:
        radial-gradient(circle at 10% 80%, rgba(64, 111, 228, .22), transparent 32%),
        linear-gradient(180deg, #10234b 0%, #0a1733 100%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 32px; }
.brand-mark, .login-brand span, .mobile-brand span {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 12px; color: #173b96; font-weight: 800;
    background: linear-gradient(145deg, #fff, #dbe7ff);
    box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .5px; }
.brand small { margin-top: 3px; color: rgba(255,255,255,.48); font-size: 11px; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 10px;
    color: rgba(255,255,255,.65); transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active {
    color: #fff; font-weight: 600;
    background: linear-gradient(100deg, rgba(64,110,229,.95), rgba(40,83,192,.78));
    box-shadow: 0 8px 22px rgba(0,0,0,.16);
}
.nav-icon {
    width: 24px; height: 24px; display: grid; place-items: center;
    border-radius: 7px; color: inherit; font-weight: 700;
    background: rgba(255,255,255,.08);
}
.sidebar-foot { margin-top: auto; padding: 14px 7px 0; border-top: 1px solid rgba(255,255,255,.09); }
.admin-card { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.admin-avatar {
    width: 34px; height: 34px; display: grid; place-items: center;
    flex: 0 0 auto; border-radius: 50%; color: #fff; background: #315fc4;
}
.admin-card strong, .admin-card small { display: block; }
.admin-card strong { font-size: 13px; }
.admin-card small { margin-top: 2px; color: rgba(255,255,255,.44); font-size: 10px; }
.logout-button {
    width: 100%; padding: 8px; border: 0; border-radius: 8px;
    color: rgba(255,255,255,.5); background: transparent;
}
.logout-button:hover { color: #fff; background: rgba(255,255,255,.07); }

.main { width: calc(100% - 236px); min-width: 0; margin-left: 236px; }
.topbar {
    height: 96px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 34px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96);
}
.topbar h1 { margin: 3px 0 0; font-size: 24px; letter-spacing: -.4px; }
.eyebrow { margin: 0; color: #7890bd; font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.eyebrow.light { color: rgba(255,255,255,.55); }
.topbar-note { color: var(--muted); font-size: 12px; }
.online-dot { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; background: #2cb879; box-shadow: 0 0 0 4px #e4f7ef; }
.page-content { max-width: 1440px; margin: 0 auto; padding: 30px 34px 56px; }
.flash-stack { position: fixed; z-index: 40; top: 20px; right: 24px; width: min(390px, calc(100vw - 48px)); }
.flash { margin-bottom: 10px; padding: 13px 16px; border: 1px solid; border-radius: 10px; box-shadow: var(--shadow); }
.flash.success { color: #146d46; border-color: #bde8d3; background: #effaf5; }
.flash.error { color: #a93238; border-color: #f1c4c6; background: #fff1f1; }

.button {
    min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0 17px; border: 1px solid transparent; border-radius: 9px;
    font-weight: 600; white-space: nowrap; transition: .16s ease;
}
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(36,89,218,.22); }
.button.primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.button.secondary { color: #42506a; border-color: #d9dee7; background: #fff; }
.button.secondary:hover { color: var(--blue); border-color: #b7c9f4; background: #f8fbff; }
.button.danger { color: #fff; background: var(--red); }
.button.light { color: var(--blue-dark); background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.button.wide { width: 100%; }
.button.compact { min-height: 34px; padding: 0 12px; font-size: 11px; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none !important; }
.text-link, .table-link, .back-row a, .back-link { color: var(--blue); font-weight: 600; }
.table-link:hover, .text-link:hover { text-decoration: underline; }

.welcome-banner {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 178px; padding: 32px 36px; border-radius: 18px; color: #fff;
    background:
        radial-gradient(circle at 84% 20%, rgba(120,160,255,.38), transparent 24%),
        linear-gradient(120deg, #214fc5, #15368a);
    box-shadow: 0 16px 38px rgba(28,64,157,.18);
}
.welcome-banner h2 { margin: 8px 0; font-size: 28px; }
.welcome-banner p:last-child { margin: 0; color: rgba(255,255,255,.68); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 22px 0; }
.stat-card {
    min-width: 0; display: flex; align-items: center; gap: 15px;
    padding: 22px; border: 1px solid #eaedf2; border-radius: 14px; background: #fff; box-shadow: var(--shadow);
}
.stat-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; font-size: 17px; font-weight: 800; }
.stat-icon.blue { color: #2361d9; background: #eaf1ff; }
.stat-icon.green { color: #168754; background: #e8f8f0; }
.stat-icon.amber { color: #b87709; background: #fff4dc; }
.stat-icon.purple { color: #7951bd; background: #f2ebff; }
.stat-card small, .stat-card strong, .stat-card p { display: block; }
.stat-card small { color: var(--muted); }
.stat-card strong { margin-top: 3px; font-size: 25px; }
.stat-card p { margin: 2px 0 0; color: #a0a9b7; font-size: 10px; }
.stat-card .money-stat { font-size: 20px; }

.panel, .form-panel {
    border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow);
}
.panel-head { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 20px; text-align: left; white-space: nowrap; border-bottom: 1px solid #eef1f4; }
th { color: #8b95a6; background: #fafbfc; font-size: 11px; font-weight: 600; letter-spacing: .2px; }
td { color: #4c586d; font-size: 13px; }
td strong, td small { display: block; }
td strong { color: var(--text); }
td small { margin-top: 3px; color: #9ba4b2; font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcff; }
.amount-cell { color: #183b8c; font-weight: 700; }
.deduction-cell, .red { color: var(--red) !important; }
.blue-text { color: var(--blue); }
.status, .binding {
    display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px;
    font-size: 10px; font-weight: 700;
}
.status.draft { color: #8c620b; background: #fff4d8; }
.status.published, .binding.bound { color: #14764b; background: #e8f8f0; }
.status.withdrawn { color: #7d8797; background: #edf0f4; }
.feedback-status, .notification-status {
    display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px;
    font-size: 10px; font-weight: 700; white-space: nowrap;
}
.feedback-status.pending, .notification-status.queued { color: #8c620b; background: #fff4d8; }
.feedback-status.confirmed, .notification-status.read { color: #14764b; background: #e8f8f0; }
.feedback-status.disputed, .notification-status.failed { color: #b53239; background: #ffebec; }
.notification-status.sent { color: #285dcb; background: #e8f0ff; }
.notification-status.none { color: #7d8797; background: #edf0f4; }
.binding { color: #8c620b; background: #fff4d8; }
.binding.unbound { color: #b53239; background: #ffebec; }
.count-badge { padding: 5px 10px; border-radius: 999px; color: #64738b; background: #f0f2f6; font-size: 11px; }
.empty-state { padding: 72px 24px; color: var(--muted); text-align: center; }
.empty-state strong { color: #445169; font-size: 16px; }
.empty-state p { margin: 7px 0 0; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #2557ca; background: #eaf1ff; font-weight: 700; }
.actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.actions form { display: inline-flex; margin: 0; }
.delete-button {
    min-height: 40px; padding: 0 15px; border: 1px solid #efb9bc;
    border-radius: 9px; color: #b9343b; background: #fff7f7; font-weight: 700;
}
.delete-button:hover { color: #fff; border-color: var(--red); background: var(--red); }
.confirmed-lock-badge {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 13px;
    border: 1px solid #c8d5ef; border-radius: 9px; color: #375990;
    background: #f3f7ff; font-size: 11px; font-weight: 700;
}
.link-button { padding: 0; border: 0; color: var(--blue); background: none; font-weight: 600; }
.danger-text { color: var(--red); }
.action-row { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.directory-notice {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin-bottom: 18px; padding: 18px 20px; border: 1px solid #cddcf7;
    border-radius: 13px; color: #274474; background: #f1f6ff;
}
.directory-notice > div { display: flex; align-items: center; gap: 13px; }
.directory-notice strong, .directory-notice p { display: block; margin: 0; }
.directory-notice p { margin-top: 4px; color: #7183a1; font-size: 11px; }
.directory-icon {
    width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
    border-radius: 11px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800;
}
.sync-badge { padding: 6px 10px; border-radius: 999px; color: #2861cf; background: #dfeaff; font-size: 10px; white-space: nowrap; }
.filter-form { display: flex; align-items: center; gap: 9px; }
.filter-form input, .filter-form select { min-height: 40px; min-width: 240px; padding: 0 12px; border: 1px solid #dce1e9; border-radius: 9px; background: #fff; outline: 0; }
.filter-form.multi input { min-width: 170px; }
.filter-form.multi select { min-width: 120px; }
.filter-form input:focus, .filter-form select:focus { border-color: #7799eb; box-shadow: 0 0 0 3px #eef3ff; }
.month-overview-grid, .month-detail-stats {
    display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px;
}
.month-overview-grid > div, .month-detail-stats > div {
    min-width: 0; padding: 19px 21px; border: 1px solid var(--border);
    border-radius: 13px; background: #fff; box-shadow: var(--shadow);
}
.month-overview-grid small, .month-overview-grid strong, .month-overview-grid span,
.month-detail-stats small, .month-detail-stats strong, .month-detail-stats span { display: block; }
.month-overview-grid small, .month-detail-stats small { color: var(--muted); font-size: 10px; }
.month-overview-grid strong, .month-detail-stats strong {
    overflow: hidden; margin: 6px 0 4px; color: var(--text); font-size: 20px;
    text-overflow: ellipsis; white-space: nowrap;
}
.month-overview-grid span, .month-detail-stats span {
    overflow: hidden; color: #9ba4b2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap;
}
.month-overview-grid .net, .month-detail-stats .net { border-color: #cad9f7; background: #f4f8ff; }
.month-overview-grid .net strong, .month-detail-stats .net strong { color: #214fae; }
.month-detail-stats .alert { border-color: #f0d0d2; background: #fff8f8; }
.month-detail-stats .alert strong { color: var(--red); }
.month-detail-back { display: flex; align-items: center; justify-content: space-between; }
.month-detail-back span { color: var(--muted); font-size: 11px; }
.month-summary-table .month-title { color: #204fae; font-size: 15px; }
.month-summary-table td { vertical-align: middle; }
.month-status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.confirm-progress {
    width: 96px; height: 5px; overflow: hidden; margin-top: 7px;
    border-radius: 999px; background: #e8ecf2;
}
.confirm-progress span { display: block; height: 100%; border-radius: inherit; background: #2ca271; }
.payroll-batch-panel { margin-bottom: 18px; }
.batch-payroll-form {
    display: grid; grid-template-columns: 160px minmax(160px,1fr) minmax(210px,1fr) minmax(260px,1.4fr) auto;
    gap: 12px; align-items: end; padding: 18px 22px;
}
.batch-payroll-form label { min-width: 0; display: grid; gap: 7px; color: #536077; font-size: 11px; font-weight: 700; }
.batch-payroll-form input, .batch-payroll-form select, .single-withdraw-form input {
    width: 100%; height: 40px; padding: 0 11px; border: 1px solid #dce1e8;
    border-radius: 8px; color: var(--text); background: #fff; outline: 0;
}
.batch-payroll-form input:focus, .batch-payroll-form select:focus, .single-withdraw-form input:focus {
    border-color: #6e91e8; box-shadow: 0 0 0 3px #edf3ff;
}
.batch-payroll-form .button { height: 40px; white-space: nowrap; }
.single-withdraw-form { display: grid !important; grid-template-columns: minmax(240px,360px) auto; gap: 9px; }

.back-row { margin-bottom: 15px; }
.form-panel { padding-bottom: 22px; }
.form-panel + .form-panel { margin-top: 18px; }
.form-panel.narrow { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; padding: 24px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.form-grid label, .login-form label { display: grid; gap: 8px; color: #4b586c; font-size: 12px; font-weight: 600; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .login-form input, .section-card input, .section-card select {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dce1e8; border-radius: 8px; color: var(--text); background: #fff; outline: 0;
}
.form-grid input:focus, .form-grid select:focus, .login-form input:focus, .section-card input:focus, .section-card select:focus {
    border-color: #6e91e8; box-shadow: 0 0 0 3px #edf3ff;
}
.form-grid label > small { color: #9aa4b2; font-size: 10px; font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 5px; border-top: 1px solid #edf0f4; }

.section-editor-panel { padding-bottom: 0; }
#section-editor { display: grid; gap: 15px; padding: 20px; background: #f8f9fb; }
.section-card { overflow: hidden; border: 1px solid #dfe4ec; border-radius: 12px; background: #fff; }
.section-card-head { display: grid; grid-template-columns: minmax(220px,1fr) 160px auto; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid #ebedf2; background: #fbfcfe; }
.section-card-head .remove-section { width: 36px; height: 36px; border: 0; border-radius: 8px; color: #9b4b4f; background: #fff0f0; }
.items-editor { padding: 5px 14px 14px; }
.item-row { display: grid; grid-template-columns: minmax(240px,1fr) 180px 34px; gap: 10px; align-items: center; padding-top: 10px; }
.item-row .remove-item { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #9b5560; background: #f6f0f1; }
.add-item { margin-top: 12px; padding: 7px 10px; border: 1px dashed #adc0ea; border-radius: 8px; color: var(--blue); background: #f5f8ff; }
.payroll-summary {
    display: flex; align-items: center; justify-content: flex-end; gap: 25px;
    padding: 20px 24px; border-top: 1px solid var(--border); background: #fff;
}
.payroll-summary div { min-width: 120px; }
.payroll-summary small, .payroll-summary strong { display: block; }
.payroll-summary small { color: var(--muted); }
.payroll-summary strong { margin-top: 4px; font-size: 18px; }
.payroll-summary > span { color: #a9b0bc; font-size: 20px; }
.payroll-summary .net { padding: 10px 14px; border-radius: 9px; background: #eaf1ff; }
.payroll-summary .net strong { color: var(--blue); }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding: 15px 0; background: linear-gradient(transparent, var(--background) 22%); }

.import-guide {
    display: flex; align-items: center; gap: 18px; margin-bottom: 18px; padding: 22px 24px;
    border: 1px solid #cad9f7; border-radius: 15px; color: #274474; background: #f1f6ff;
}
.import-guide-icon {
    width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto;
    border-radius: 14px; color: #fff; background: linear-gradient(145deg,#2a64e6,#16419e);
    font-size: 17px; font-weight: 800; box-shadow: 0 8px 20px rgba(36,89,218,.2);
}
.import-guide h2 { margin: 0 0 6px; font-size: 18px; }
.import-guide p { margin: 0; color: #7183a1; font-size: 12px; line-height: 1.7; }
.import-guide > div:nth-child(2) { min-width: 0; flex: 1; }
.template-download-panel {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin-bottom: 18px; padding: 20px 22px;
    border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow);
}
.template-download-panel strong, .template-download-panel p { display: block; margin: 0; }
.template-download-panel p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.template-download-panel .button { flex: 0 0 auto; }
body.modal-open { overflow: hidden; }
.template-modal[hidden], .template-modal-body[hidden], .template-modal-actions [hidden] { display: none; }
.template-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; }
.template-modal-backdrop { position: absolute; inset: 0; background: rgba(8,20,46,.58); backdrop-filter: blur(3px); }
.template-modal-dialog {
    position: relative; z-index: 1; width: min(680px,100%); max-height: calc(100vh - 44px);
    overflow: hidden; display: flex; flex-direction: column; border-radius: 17px; background: #fff;
    box-shadow: 0 30px 80px rgba(8,20,46,.28);
}
.template-modal-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
    padding: 23px 25px 19px; border-bottom: 1px solid var(--border);
}
.template-modal-step { color: #5274bd; font-size: 10px; font-weight: 800; letter-spacing: .8px; }
.template-modal-head h2 { margin: 5px 0; font-size: 20px; }
.template-modal-head p { margin: 0; color: var(--muted); font-size: 11px; }
.template-modal-close {
    width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 8px;
    color: #738096; background: #f1f3f7; font-size: 21px; line-height: 1;
}
.template-modal-body { min-height: 270px; overflow-y: auto; padding: 20px 25px; }
.department-select-all {
    display: flex; align-items: center; gap: 9px; width: fit-content; margin-bottom: 13px;
    color: #4b5970; font-size: 12px; font-weight: 700; cursor: pointer;
}
.department-select-all input, .department-choice input { width: 17px; height: 17px; accent-color: var(--blue); }
.department-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.department-choice {
    min-width: 0; display: flex; align-items: center; gap: 11px; padding: 14px;
    border: 1px solid #dfe4ec; border-radius: 10px; background: #fff; cursor: pointer; transition: .15s ease;
}
.department-choice:hover { border-color: #b9c9ec; background: #f9fbff; }
.department-choice:has(input:checked) { border-color: #7e9fe8; background: #f1f6ff; box-shadow: inset 0 0 0 1px #7e9fe8; }
.department-choice strong, .department-choice small { display: block; }
.department-choice strong { overflow: hidden; color: #344159; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.department-choice small { margin-top: 3px; color: #929dac; font-size: 10px; }
.template-empty { padding: 55px 20px; color: var(--muted); text-align: center; }
.template-confirm-card { padding: 19px 20px; border: 1px solid #ccdaf6; border-radius: 12px; background: #f4f8ff; }
.template-confirm-card span, .template-confirm-card strong, .template-confirm-card p { display: block; }
.template-confirm-card span { color: #6d7f9f; font-size: 10px; }
.template-confirm-card strong { margin-top: 6px; color: #274b96; font-size: 15px; line-height: 1.6; }
.template-confirm-card p { margin: 8px 0 0; color: #7a89a2; font-size: 11px; }
.template-format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.template-format-grid button {
    display: flex; align-items: center; gap: 12px; padding: 17px; border: 1px solid #dfe4ec;
    border-radius: 11px; color: var(--text); background: #fff; text-align: left;
}
.template-format-grid button:hover { border-color: #8ca9e8; background: #f8fbff; }
.template-format-grid button > span:last-child { min-width: 0; }
.template-format-grid strong, .template-format-grid small { display: block; }
.template-format-grid small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.format-icon {
    width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
    border-radius: 9px; color: #fff; background: #168754; font-weight: 800;
}
.format-icon.csv { background: #5474b8; }
.template-modal-actions {
    display: flex; justify-content: flex-end; gap: 9px; padding: 15px 25px;
    border-top: 1px solid var(--border); background: #fbfcfe;
}
.import-upload-form { padding-bottom: 0; }
.step-badge { padding: 7px 11px; border-radius: 999px; color: #285dcb; background: #e8f0ff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.file-field input[type="file"] { height: auto; min-height: 42px; padding: 8px; }
.file-field input[type="file"]::file-selector-button {
    margin-right: 10px; padding: 5px 10px; border: 0; border-radius: 6px; color: #2557ca; background: #eaf1ff; cursor: pointer;
}
.import-notes {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin: 0 24px;
    padding: 16px 18px; border-radius: 10px; color: #748198; background: #f7f9fc; font-size: 11px;
}
.import-notes strong { color: #40506a; }
.import-notes span::before { content: "✓"; margin-right: 6px; color: var(--green); font-weight: 800; }
.import-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 24px; }
.import-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.import-summary-grid > div {
    min-width: 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 13px; background: #fff; box-shadow: var(--shadow);
}
.import-summary-grid small, .import-summary-grid strong, .import-summary-grid span { display: block; }
.import-summary-grid small { color: var(--muted); font-size: 10px; }
.import-summary-grid strong { overflow: hidden; margin: 5px 0 3px; color: var(--text); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.import-summary-grid span { color: #9ba4b2; font-size: 10px; }
.import-summary-grid .success { border-color: #cce9dc; background: #f5fcf8; }
.import-summary-grid .success strong { color: var(--green); }
.import-summary-grid .danger { border-color: #f0d0d2; background: #fff8f8; }
.import-summary-grid .danger strong { color: var(--red); }
.import-mapping-panel { margin-bottom: 18px; }
.mapping-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 20px 22px; }
.mapping-grid label { min-width: 0; display: grid; gap: 7px; }
.mapping-grid label > span { overflow: hidden; color: #536077; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mapping-grid select {
    width: 100%; height: 39px; padding: 0 10px; border: 1px solid #dce1e8; border-radius: 8px; color: var(--text); background: #fff;
}
.mapping-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 16px 22px; border-top: 1px solid var(--border); background: #fbfcfe;
}
.check-option { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-option > input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); }
.check-option strong, .check-option small { display: block; }
.check-option strong { color: #42506a; font-size: 12px; }
.check-option small { margin-top: 3px; color: #98a2b1; font-size: 10px; }
.import-sheet-panel { margin-bottom: 18px; }
.import-sheet-wrap { max-height: 560px; border-bottom: 1px solid var(--border); }
.import-sheet-table { width: max-content; min-width: 100%; }
.import-sheet-table th, .import-sheet-table td { min-width: 150px; padding: 0; }
.import-sheet-table th {
    position: sticky; top: 0; z-index: 3; height: 62px; padding: 10px 12px;
    border-right: 1px solid #edf0f4; background: #f8fafc; vertical-align: middle;
}
.import-sheet-table th strong, .import-sheet-table th small {
    max-width: 180px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.import-sheet-table th strong { color: #4c586d; font-size: 11px; }
.import-sheet-table th small { margin-top: 5px; color: #9ba4b2; font-size: 9px; font-weight: 500; }
.import-sheet-table th:not(.mapping-ignore) { background: #eef4ff; }
.import-sheet-table th:not(.mapping-ignore) small { color: #3567cf; }
.import-sheet-table td { border-right: 1px solid #f0f2f5; }
.import-sheet-table td input {
    width: 100%; min-width: 150px; height: 43px; padding: 0 11px;
    border: 0; border-radius: 0; color: #435068; background: transparent; outline: 0;
}
.import-sheet-table td input:hover { background: #f8faff; }
.import-sheet-table td input:focus {
    position: relative; z-index: 2; background: #fff; box-shadow: inset 0 0 0 2px #5e86e8;
}
.import-sheet-table td input.is-edited { color: #174bbd; background: #edf4ff; font-weight: 700; }
.import-sheet-table tr.has-edits .source-row-cell { color: #245ccb; background: #edf4ff; }
.import-sheet-table .source-row-cell {
    position: sticky; left: 0; z-index: 2; min-width: 88px; width: 88px;
    padding: 0 11px; color: #8d97a6; background: #fafbfc; font-size: 10px; font-weight: 700;
}
.import-sheet-table thead .source-row-cell { z-index: 4; }
.import-sheet-help {
    display: flex; align-items: center; flex-wrap: wrap; gap: 9px 22px;
    padding: 13px 20px; color: #7c8798; background: #fbfcfe; font-size: 10px;
}
.import-sheet-help span::before { content: "•"; margin-right: 6px; color: #4777dc; }
.import-sheet-help strong { margin-left: auto; color: #14764b; }
.import-preview-table th:last-child, .import-preview-table td:last-child { min-width: 340px; white-space: normal; }
.import-preview-table tr.row-error td { background: #fffafa; }
.import-preview-table tr.row-warning td { background: #fffdf7; }
.import-result-cell small { margin-top: 5px; line-height: 1.45; }
.import-state { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.import-state.ready { color: #14764b; background: #e8f8f0; }
.import-state.blocked { color: #ad363c; background: #fff0f0; }
.result-error { color: #b23d43; }
.result-warning { color: #a36e0f; }

.payroll-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 30px; border-radius: 16px; color: #fff;
    background: radial-gradient(circle at 90% 20%, rgba(115,156,255,.35), transparent 28%), linear-gradient(115deg,#1e4bbd,#153886);
    box-shadow: 0 16px 36px rgba(24,60,148,.18);
}
.payroll-hero h2 { margin: 15px 0 7px; font-size: 23px; }
.payroll-hero p { margin: 0; color: rgba(255,255,255,.6); }
.payroll-hero .status { background: rgba(255,255,255,.16); color: #fff; }
.hero-amount { text-align: right; }
.hero-amount small, .hero-amount strong { display: block; }
.hero-amount small { color: rgba(255,255,255,.6); }
.hero-amount strong { margin-top: 7px; font-size: 32px; }
.summary-strip { display: grid; grid-template-columns: repeat(4,1fr); margin: 18px 0; border: 1px solid var(--border); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.summary-strip div { padding: 20px 23px; border-right: 1px solid var(--border); }
.summary-strip div:last-child { border: 0; }
.summary-strip small, .summary-strip strong { display: block; }
.summary-strip small { color: var(--muted); }
.summary-strip strong { margin-top: 5px; font-size: 17px; }
.summary-strip .date-value { font-size: 13px; }
.withdrawal-notice {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    margin: -4px 0 18px; padding: 15px 18px; border: 1px solid #f0d0d2;
    border-radius: 11px; color: #78383d; background: #fff8f8;
}
.withdrawal-notice small { color: #a17f82; }
.confirmed-lock-notice {
    display: grid; gap: 5px; margin: -4px 0 18px; padding: 15px 18px;
    border: 1px solid #c8d7f4; border-radius: 11px; color: #294d91; background: #f4f8ff;
}
.confirmed-lock-notice span { color: #7283a2; font-size: 11px; line-height: 1.6; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.detail-panel .panel-head { min-height: 74px; }
.detail-lines { padding: 2px 20px 13px; }
.detail-lines > div { display: flex; align-items: center; justify-content: space-between; min-height: 49px; border-bottom: 1px solid #eef1f4; }
.detail-lines > div:last-child { border: 0; }
.detail-lines span { color: #6c778a; }
.workflow-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.workflow-card {
    min-width: 0; padding: 18px 20px; border: 1px solid var(--border);
    border-radius: 13px; background: #fff; box-shadow: var(--shadow);
}
.workflow-card small, .workflow-card strong, .workflow-card span { display: block; }
.workflow-card small { color: var(--muted); font-size: 10px; }
.workflow-card strong { margin: 6px 0 4px; font-size: 17px; }
.workflow-card span { overflow: hidden; color: #9ba4b2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-card.confirmed { border-color: #cce9dc; background: #f5fcf8; }
.workflow-card.confirmed strong { color: var(--green); }
.workflow-card.disputed { border-color: #f0d0d2; background: #fff8f8; }
.workflow-card.disputed strong { color: var(--red); }
.feedback-panel, .notification-panel { margin-top: 18px; }
.compact-empty { padding: 30px 22px; color: var(--muted); text-align: center; }
.feedback-list { display: grid; gap: 13px; padding: 18px; background: #f8f9fb; }
.feedback-item { padding: 18px; border: 1px solid #e1e5ec; border-radius: 11px; background: #fff; }
.feedback-item.open { border-color: #efc8cb; }
.feedback-item-head { display: flex; justify-content: space-between; gap: 20px; }
.feedback-item-head time { color: #9ba4b2; font-size: 10px; }
.feedback-item > p, .feedback-reply p { color: #536077; line-height: 1.7; }
.feedback-reply-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 13px; }
.feedback-reply-form textarea {
    min-height: 78px; padding: 10px 12px; resize: vertical; border: 1px solid #dce1e8;
    border-radius: 8px; color: var(--text); outline: 0;
}
.feedback-reply { margin-top: 13px; padding: 13px 15px; border-radius: 9px; background: #f5f8ff; }
.feedback-reply strong, .feedback-reply p, .feedback-reply small { display: block; margin: 0; }
.feedback-reply p { margin: 6px 0; }
.feedback-reply small { color: #8793a5; }

.settings-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 28px;
    margin-bottom: 18px; padding: 28px 30px; border-radius: 16px; color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(119,160,255,.35), transparent 27%),
        linear-gradient(118deg,#1e4bbd,#153886);
    box-shadow: 0 16px 36px rgba(24,60,148,.18);
}
.settings-hero h2 { margin: 8px 0; font-size: 23px; }
.settings-hero p:last-child { max-width: 680px; margin: 0; color: rgba(255,255,255,.66); line-height: 1.7; }
.settings-flow { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.settings-flow span {
    padding: 9px 11px; border: 1px solid rgba(255,255,255,.15);
    border-radius: 9px; background: rgba(255,255,255,.1); font-size: 10px; white-space: nowrap;
}
.settings-flow b { color: rgba(255,255,255,.45); }
.settings-toolbar {
    display: flex; align-items: flex-end; gap: 9px; padding: 17px 22px;
    border-bottom: 1px solid var(--border); background: #fbfcfe;
}
.settings-toolbar label { min-width: 260px; display: grid; gap: 7px; color: #536077; font-size: 11px; font-weight: 700; }
.settings-toolbar input {
    width: 100%; height: 38px; padding: 0 11px; border: 1px solid #dce1e8;
    border-radius: 8px; color: var(--text); background: #fff; outline: 0;
}
.settings-toolbar input:focus { border-color: #6e91e8; box-shadow: 0 0 0 3px #edf3ff; }
.finance-recipient-grid {
    display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px;
    max-height: 520px; overflow-y: auto; padding: 20px 22px;
}
.finance-recipient {
    min-width: 0; display: grid; grid-template-columns: auto auto minmax(0,1fr) auto;
    align-items: center; gap: 10px; padding: 13px; border: 1px solid #dfe4ec;
    border-radius: 11px; background: #fff; cursor: pointer; transition: .15s ease;
}
.finance-recipient:hover { border-color: #b9c9ec; background: #f9fbff; }
.finance-recipient:has(input:checked) {
    border-color: #7e9fe8; background: #f1f6ff; box-shadow: inset 0 0 0 1px #7e9fe8;
}
.finance-recipient[hidden] { display: none; }
.finance-recipient input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.finance-avatar {
    width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
    color: #2557ca; background: #eaf1ff; font-weight: 700;
}
.finance-recipient > span:nth-of-type(2) { min-width: 0; }
.finance-recipient strong, .finance-recipient small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-recipient strong { color: #344159; font-size: 12px; }
.finance-recipient small { margin-top: 3px; color: #929dac; font-size: 10px; }
.finance-recipient em {
    padding: 4px 7px; border-radius: 999px; color: #14764b;
    background: #e8f8f0; font-size: 9px; font-style: normal; white-space: nowrap;
}
.settings-savebar {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 18px 22px; border-top: 1px solid var(--border); background: #fbfcfe;
}
.settings-savebar strong, .settings-savebar span, .settings-savebar small { display: block; }
.settings-savebar strong { color: #3d4b62; font-size: 12px; }
.settings-savebar span { margin-top: 4px; color: #7d899b; font-size: 11px; }
.settings-savebar small { margin-top: 4px; color: #ad7b20; font-size: 10px; }

.auth-body { min-height: 100vh; background: #fff; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.login-visual {
    position: relative; display: grid; align-items: center; overflow: hidden; padding: 8vw;
    color: #fff; background:
        radial-gradient(circle at 18% 84%, rgba(69,119,242,.35), transparent 30%),
        radial-gradient(circle at 83% 18%, rgba(79,127,244,.25), transparent 24%),
        linear-gradient(145deg,#0c1c40,#173d96);
}
.login-visual::after {
    content: ""; position: absolute; width: 420px; height: 420px; right: -180px; bottom: -180px;
    border: 60px solid rgba(255,255,255,.035); border-radius: 50%;
}
.visual-content { position: relative; z-index: 1; max-width: 620px; }
.login-brand, .mobile-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.visual-kicker { margin: 90px 0 14px; color: #8db0ff; font-size: 13px; letter-spacing: 4px; }
.login-visual h1 { margin: 0; font-size: clamp(34px,4vw,56px); line-height: 1.22; letter-spacing: -1px; }
.visual-copy { max-width: 530px; margin: 25px 0 34px; color: rgba(255,255,255,.62); font-size: 15px; line-height: 1.8; }
.visual-points { display: flex; flex-wrap: wrap; gap: 11px; }
.visual-points span { padding: 8px 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: rgba(255,255,255,.74); background: rgba(255,255,255,.05); font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-box { width: min(390px,100%); }
.mobile-brand { display: none; color: var(--text); margin-bottom: 55px; }
.mobile-brand span { color: #fff; background: var(--blue); }
.login-box h2 { margin: 11px 0 7px; font-size: 28px; }
.login-subtitle { margin: 0 0 32px; color: var(--muted); }
.login-form { display: grid; gap: 19px; }
.login-form input { height: 47px; }
.login-form .button { height: 47px; margin-top: 5px; }
.sso-login-button { height: 50px; margin-top: 28px; }
.login-help { margin-top: 20px; color: #9aa4b3; text-align: center; font-size: 11px; }

.error-page { max-width: 520px; margin: 80px auto; padding: 50px; border: 1px solid var(--border); border-radius: 16px; text-align: center; background: #fff; box-shadow: var(--shadow); }
.error-page > span { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; color: var(--red); background: #fff0f0; font-size: 24px; font-weight: 800; }
.error-page h2 { margin: 18px 0 8px; }
.error-page p { margin: 0 0 25px; color: var(--muted); }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .form-grid.three { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .mapping-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .import-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .batch-payroll-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .batch-payroll-form .button { width: 100%; }
    .workflow-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .month-overview-grid, .month-detail-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .settings-hero { align-items: flex-start; flex-direction: column; }
    .finance-recipient-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 780px) {
    .sidebar { position: fixed; top: auto; right: 0; width: 100%; height: 64px; padding: 7px 10px; flex-direction: row; align-items: center; }
    .brand, .sidebar-foot { display: none; }
    .nav-list { width: 100%; display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; }
    .nav-item { justify-content: center; padding: 9px 6px; font-size: 12px; }
    .nav-icon { display: none; }
    .main { width: 100%; margin-left: 0; padding-bottom: 68px; }
    .topbar { height: 78px; padding: 0 18px; }
    .topbar-note { display: none; }
    .topbar h1 { font-size: 21px; }
    .page-content { padding: 18px 14px 35px; }
    .welcome-banner { align-items: flex-start; flex-direction: column; padding: 25px; }
    .stats-grid { grid-template-columns: 1fr; }
    .action-row { align-items: stretch; flex-direction: column; }
    .directory-notice { align-items: flex-start; flex-direction: column; }
    .filter-form, .filter-form.multi { display: grid; grid-template-columns: 1fr 90px; }
    .filter-form input, .filter-form.multi input, .filter-form.multi select { min-width: 0; width: 100%; }
    .form-grid, .form-grid.three { grid-template-columns: 1fr; padding: 18px; }
    .form-grid label.full { grid-column: auto; }
    .section-card-head { grid-template-columns: 1fr 115px auto; }
    .item-row { grid-template-columns: 1fr 120px 34px; }
    .payroll-summary { gap: 10px; justify-content: space-between; overflow-x: auto; }
    .payroll-summary div { min-width: 90px; }
    .payroll-summary strong { font-size: 15px; }
    .import-guide { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
    .template-download-panel { align-items: stretch; flex-direction: column; padding: 18px; }
    .template-download-panel .button { width: 100%; }
    .template-modal { padding: 10px; }
    .template-modal-dialog { max-height: calc(100vh - 20px); }
    .template-modal-head, .template-modal-body, .template-modal-actions { padding-left: 18px; padding-right: 18px; }
    .department-choice-grid, .template-format-grid { grid-template-columns: 1fr; }
    .import-notes { display: grid; margin: 0 18px; }
    .mapping-grid { grid-template-columns: 1fr 1fr; padding: 17px; }
    .mapping-actions { align-items: stretch; flex-direction: column; }
    .mapping-actions .button { width: 100%; }
    .import-summary-grid { grid-template-columns: 1fr 1fr; }
    .batch-payroll-form { grid-template-columns: 1fr; padding: 17px; }
    .single-withdraw-form { grid-template-columns: 1fr; width: 100%; }
    .workflow-grid { grid-template-columns: 1fr 1fr; }
    .month-overview-grid, .month-detail-stats { grid-template-columns: 1fr 1fr; }
    .month-overview-grid > div, .month-detail-stats > div { padding: 16px; }
    .month-overview-grid strong, .month-detail-stats strong { font-size: 17px; }
    .month-detail-back { align-items: flex-start; flex-direction: column; gap: 5px; }
    .withdrawal-notice { grid-template-columns: 1fr; gap: 7px; }
    .feedback-reply-form { grid-template-columns: 1fr; }
    .settings-hero { padding: 23px 20px; }
    .settings-flow { width: 100%; overflow-x: auto; padding-bottom: 4px; }
    .settings-toolbar { align-items: stretch; flex-direction: column; }
    .settings-toolbar label { min-width: 0; width: 100%; }
    .settings-toolbar .button { width: 100%; }
    .finance-recipient-grid { grid-template-columns: 1fr; padding: 14px; }
    .settings-savebar { align-items: stretch; flex-direction: column; }
    .settings-savebar .button { width: 100%; }
    .payroll-hero { align-items: flex-start; flex-direction: column; }
    .hero-amount { text-align: left; }
    .summary-strip { grid-template-columns: repeat(2,1fr); }
    .summary-strip div:nth-child(2) { border-right: 0; }
    .summary-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .login-page { display: block; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; padding: 28px; }
    .mobile-brand { display: flex; }
}
