:root {
    --bg: #f5f7fb;
    --surface: #fff;
    --surface-2: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --border: #e6eaf0;
    --primary: #2457d6;
    --primary-2: #163d9f;
    --sidebar: #101828;
    --sidebar-muted: #98a2b3;
    --success: #087a55;
    --warning: #b54708;
    --danger: #b42318;
    --shadow: 0 12px 34px rgba(16, 24, 40, 0.07);
    --radius: 18px;
}

/* Paso 8: feedback global de procesos y selectores escalables */
.app-is-busy { overflow: hidden; }
.app-loading { position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .58); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease; }
.app-loading.is-visible { opacity: 1; visibility: visible; }
.app-loading-card { width: min(390px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 24px 80px rgba(15, 23, 42, .28); text-align: center; color: var(--text); }
.app-loading-card strong { display: block; margin-top: 18px; font-size: 1.15rem; }
.app-loading-card p { margin: 7px 0 3px; color: var(--muted); }
.app-loading-card small { color: var(--muted); }
.app-loading-mark { position: relative; display: inline-grid; width: 64px; height: 64px; place-items: center; border-radius: 20px; color: #2f61e8; background: #eaf0ff; font-size: 1.55rem; }
.app-loading-mark span { position: absolute; inset: -7px; border: 3px solid transparent; border-top-color: #2f61e8; border-radius: 50%; animation: sigeb-spin .8s linear infinite; }
@keyframes sigeb-spin { to { transform: rotate(360deg); } }

.mfa-setup-card .auth-card-inner { max-width: 520px; }
.mfa-steps { color: var(--muted); padding-left: 1.25rem; margin-bottom: 1.25rem; }
.mfa-steps li + li { margin-top: .35rem; }
.mfa-qr { width: 244px; min-height: 244px; margin: 0 auto 1rem; padding: 12px; border: 1px solid var(--border); border-radius: 20px; background: #fff; display: grid; place-items: center; }
.mfa-qr img, .mfa-qr canvas { max-width: 100%; height: auto !important; }
.mfa-manual { margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 14px; background: var(--surface-2); }
.mfa-manual summary { cursor: pointer; font-weight: 600; }
.mfa-manual p { margin: .7rem 0 .35rem; }
.mfa-manual code { display: block; overflow-wrap: anywhere; letter-spacing: .08em; user-select: all; }
.recovery-panel { max-width: 820px; margin-inline: auto; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.recovery-codes code { padding: 1rem; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 1rem; text-align: center; letter-spacing: .12em; user-select: all; }
@media (max-width: 575.98px) { .recovery-codes { grid-template-columns: 1fr; } }

.select2-container .select2-selection--single { height: 45px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.select2-container .select2-selection--single .select2-selection__rendered { line-height: 43px; padding-left: 14px; color: var(--text); }
.select2-container .select2-selection--single .select2-selection__arrow { height: 43px; right: 8px; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: #5b82ed; box-shadow: 0 0 0 .2rem rgba(47, 97, 232, .14); }
.select2-dropdown { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); color: var(--text); box-shadow: 0 16px 45px rgba(15, 23, 42, .16); }
.select2-search--dropdown { padding: 10px; }
.select2-search--dropdown .select2-search__field { min-height: 40px; border: 1px solid var(--border) !important; border-radius: 9px; padding: 7px 10px; background: var(--surface); color: var(--text); }
.select2-results__option { padding: 10px 14px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: #2f61e8; }
.rut-value { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Corrección visual del Paso 6 y módulo monetario del Paso 7 */
.content-grid.import-grid { grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); align-items: start; }
.import-grid .upload-panel { width: 100%; }
.import-grid .step-chip { display: inline-flex; width: auto; min-width: 58px; padding: 5px 12px; justify-content: center; white-space: nowrap; }
.import-grid .table-shell { width: 100%; min-width: 0; }
.currency-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-bottom: 1rem; }
.currency-hero { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.5fr); gap: 1.5rem; align-items: center; }
.currency-hero h2 { margin: .85rem 0 .35rem; }
.rate-latest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; }
.rate-latest-card { display: grid; gap: .55rem; min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
.rate-latest-card div { display: flex; justify-content: space-between; gap: .5rem; }
.rate-latest-card span { color: var(--primary); font-weight: 800; }
.rate-latest-card small, .rate-latest-card time { color: var(--muted); font-size: .75rem; }
.rate-latest-card strong { font-size: 1.15rem; }
.currency-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.currency-list { display: grid; gap: .65rem; }
.currency-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: .8rem; width: 100%; padding: .8rem; border: 1px solid var(--border); border-radius: 15px; color: var(--text); background: var(--surface-2); text-align: left; transition: .18s ease; }
.currency-row:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-1px); }
.currency-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-weight: 800; }
.currency-info, .currency-meta { display: grid; gap: .2rem; }
.currency-info small, .currency-meta small { color: var(--muted); font-size: .75rem; }
.currency-meta { grid-template-columns: auto auto; align-items: center; justify-items: end; }
.currency-meta em { padding: .2rem .45rem; border-radius: 8px; color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); font-size: .7rem; font-style: normal; font-weight: 700; }
.rate-filter { display: grid; grid-template-columns: minmax(130px, 1fr) 150px 150px auto; gap: .65rem; margin-bottom: 1rem; }
.security-switch.compact { min-height: 82px; padding: .75rem; }
.refresh-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.refresh-mode-grid label { position: relative; cursor: pointer; }
.refresh-mode-grid input { position: absolute; opacity: 0; }
.refresh-mode-grid span { display: grid; gap: .35rem; height: 100%; padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
.refresh-mode-grid i { color: var(--primary); font-size: 1.25rem; }
.refresh-mode-grid small { color: var(--muted); }
.refresh-mode-grid input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.currency-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .65rem; }
.currency-check-grid label { display: flex; align-items: center; gap: .7rem; padding: .75rem; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.currency-check-grid span { display: grid; }
.currency-check-grid small { color: var(--muted); }
@media (max-width: 1100px) { .content-grid.import-grid, .currency-hero, .currency-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .currency-actions, .rate-filter { grid-template-columns: 1fr; display: grid; } .currency-actions .btn { width: 100%; } .refresh-mode-grid { grid-template-columns: 1fr; } }

/* Paso 6: cargas masivas */
.import-grid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; }
.import-help { padding: 1rem; border-radius: 16px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--muted); font-size: .9rem; }
.import-help ul { margin: .75rem 0 0; padding-left: 1.15rem; }
.import-help li + li { margin-top: .45rem; }
.sticky-action-bar { position: sticky; top: 12px; z-index: 20; padding: .85rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow); display: flex; justify-content: space-between; gap: 1rem; }
.import-summary .metric-card { min-height: 132px; }
.metric-date { font-size: 1.2rem !important; }
.status-success { color: #087f5b; background: rgba(18, 184, 134, .13); }
.status-warning { color: #a35c00; background: rgba(250, 176, 5, .16); }
.status-danger { color: #c92a2a; background: rgba(250, 82, 82, .13); }
.danger-zone { border-color: rgba(250, 82, 82, .28); }
@media (max-width: 1100px) { .import-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .sticky-action-bar { position: static; flex-direction: column; } .sticky-action-bar > div, .sticky-action-bar form, .sticky-action-bar .btn { width: 100%; } }

/* Paso 1: usuarios, roles y permisos */
.user-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, .75fr);
    gap: 1.5rem;
}

.security-switches {
    display: grid;
    gap: .85rem;
}

.security-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-2);
    cursor: pointer;
}

.security-switch span {
    display: grid;
    gap: .2rem;
}

.security-switch small {
    color: var(--muted);
    line-height: 1.4;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.role-option {
    position: relative;
    cursor: pointer;
}

.role-option > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-option-body {
    display: flex;
    gap: .85rem;
    min-height: 138px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-2);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.role-option:hover .role-option-body {
    transform: translateY(-1px);
    border-color: rgba(94, 92, 230, .45);
}

.role-option > input:checked + .role-option-body {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 92, 230, .12);
}

.role-option-check {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: transparent;
    background: var(--surface);
}

.role-option > input:checked + .role-option-body .role-option-check {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.role-option-body > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .35rem;
}

.role-option-body small {
    color: var(--muted);
    line-height: 1.4;
}

.role-option-body code {
    align-self: flex-start;
    margin-top: auto;
    font-size: .72rem;
}

.permission-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.permission-chip {
    display: inline-flex;
    align-items: center;
    padding: .35rem .65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: .78rem;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .user-form-grid {
        grid-template-columns: 1fr;
    }

    .role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .role-grid {
        grid-template-columns: 1fr;
    }
}
[data-theme="dark"] {
    --bg: #0b101b;
    --surface: #121a28;
    --surface-2: #182233;
    --text: #f4f7fb;
    --muted: #a8b3c5;
    --border: #273449;
    --primary: #6f92ff;
    --primary-2: #91aaff;
    --sidebar: #080d16;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    color-scheme: dark;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 14px;
}
.app-shell {
    min-height: 100vh;
}
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    background: var(--sidebar);
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(145deg, #6f8cff, #315bdc);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 8px 24px rgba(49, 91, 220, 0.35);
}
.brand strong,
.brand small {
    display: block;
}
.brand strong {
    font-size: 18px;
    letter-spacing: 0.04em;
}
.brand small {
    font-size: 11px;
    color: var(--sidebar-muted);
    margin-top: 2px;
}
.menu-search {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 28px 0 22px;
    padding: 10px 12px;
    border: 1px solid #344054;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #98a2b3;
}
.menu-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 13px;
}
.menu-search input::placeholder {
    color: #98a2b3;
}
.nav-label {
    padding: 0 12px;
    margin: 0 0 8px;
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 11px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: 0.18s ease;
}
.nav-item i {
    font-size: 17px;
}
.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}
.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, #315bdc, #2348b5);
    box-shadow: 0 8px 22px rgba(35, 72, 181, 0.25);
}
.sidebar-foot {
    margin-top: auto;
    padding-top: 20px;
}
.privacy-note {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-top: 1px solid #253047;
    color: #d0d5dd;
}
.privacy-note i {
    font-size: 18px;
}
.privacy-note small {
    color: #667085;
}
.app-main {
    margin-left: 270px;
    min-height: 100vh;
}
.topbar {
    height: 76px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar-spacer {
    flex: 1;
}
.theme-toggle,
.user-menu,
.icon-button {
    border: 0;
    background: transparent;
    color: var(--text);
}
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 10px;
    font-weight: 600;
}
.theme-toggle:hover {
    background: var(--surface-2);
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    text-align: left;
}
.user-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #e9efff;
    color: #244fbf;
    font-weight: 700;
}
.user-copy strong,
.user-copy small {
    display: block;
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-copy small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}
.app-content {
    padding: 34px;
    max-width: 1700px;
    margin: 0 auto;
}
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}
.page-heading h1 {
    font-size: 28px;
    letter-spacing: -0.03em;
    margin: 2px 0 6px;
    font-weight: 700;
}
.page-heading p:not(.page-eyebrow) {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}
.page-eyebrow,
.panel-kicker {
    margin: 0 !important;
    color: var(--primary) !important;
    font-size: 10px !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}
.page-actions {
    display: flex;
    gap: 10px;
}
.btn {
    border-radius: 11px;
    font-weight: 600;
    padding: 0.68rem 1rem;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-2);
    border-color: var(--primary-2);
}
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.panel-head h2 {
    font-size: 16px;
    margin: 2px 0 0;
    font-weight: 700;
}
.panel-head a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.metric-card {
    display: flex;
    justify-content: space-between;
    min-height: 150px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    color: #fff;
    border: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18); }
.metric-card::after { content: ''; position: absolute; width: 110px; height: 110px; right: -34px; bottom: -48px; border-radius: 50%; background: rgba(255,255,255,.12); }
.metric-card.metric-process { background: linear-gradient(145deg, #315bd8, #183b98); }
.metric-card.metric-approved { background: linear-gradient(145deg, #16a36a, #08754a); }
.metric-card.metric-scheduled { background: linear-gradient(145deg, #f59e0b, #c66a06); }
.metric-card.metric-paid { background: linear-gradient(145deg, #8b5cf6, #6438c5); }
.metric-card span,
.metric-card strong,
.metric-card small {
    display: block;
}
.metric-card span {
    font-weight: 600;
    font-size: 13px;
}
.metric-card strong {
    font-size: 35px;
    line-height: 1;
    margin: 20px 0 8px;
}
.metric-card small {
    color: rgba(255,255,255,.78);
}
.metric-card > i {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: rgba(255,255,255,.16);
    font-size: 23px;
    opacity: 1;
    position: relative;
    z-index: 1;
}
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
    gap: 20px;
}
.request-list,
.balance-list {
    display: flex;
    flex-direction: column;
}
.balance-employee-filter { display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.balance-employee-filter > div:first-child { flex: 1; max-width: 620px; }
.balance-filter-copy,
.balance-person { display: flex; align-items: center; gap: 14px; }
.balance-filter-copy > i,
.balance-person > i { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: color-mix(in srgb, var(--primary) 11%, var(--surface)); color: var(--primary); font-size: 23px; }
.balance-filter-copy strong,
.balance-filter-copy small { display: block; }
.balance-filter-copy small,
.balance-person p { color: var(--muted); margin: 3px 0 0; }
.balance-person h2 { margin: 2px 0; font-size: 20px; }
.balance-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.balance-card { display: grid; gap: 18px; }
.balance-card-head { display: flex; justify-content: space-between; gap: 14px; }
.balance-card-head h2 { margin: 10px 0 4px; font-size: 18px; }
.balance-card-head p { margin: 0; color: var(--muted); }
.balance-year { display: grid; place-items: center; width: 54px; height: 38px; border-radius: 12px; background: var(--surface-2); font-weight: 800; color: var(--primary); }
.balance-main small,
.balance-main strong,
.balance-main p { display: block; }
.balance-main small { color: var(--muted); }
.balance-main strong { margin: 5px 0; font-size: 30px; }
.balance-main strong span { font-size: 14px; color: var(--muted); }
.balance-main p { margin: 0; color: var(--muted); font-size: 12px; }
.balance-progress { display: flex; height: 10px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--border) 70%, transparent); }
.balance-progress span { height: 100%; }
.balance-progress-used { background: #ef4444; }
.balance-progress-process { background: #f59e0b; }
.balance-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.balance-breakdown > div { position: relative; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.balance-breakdown small,
.balance-breakdown strong { display: block; }
.balance-breakdown small { margin: 0 0 6px 12px; color: var(--muted); }
.balance-breakdown strong { font-size: 15px; }
.balance-breakdown .dot { position: absolute; top: 17px; width: 7px; height: 7px; border-radius: 50%; }
.dot.used { background: #ef4444; }
.dot.process { background: #f59e0b; }
.dot.available { background: #16a36a; }
.balance-row { text-decoration: none; color: var(--text); }
.balance-row > span small { display: block; color: var(--muted); font-weight: 500; text-align: right; }
.request-row {
    display: grid;
    /*grid-template-columns: 42px minmax(160px, 1fr) auto 110px;*/
	grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}
.request-row:last-child {
    border-bottom: 0;
}
.request-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--primary);
}
.request-main strong,
.request-main small {
    display: block;
}
.request-main small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
}
.request-amount {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
}
.request-amount strong {
    color: var(--text);
}
.request-amount small,
.amount-stack small {
    display: block;
    margin-top: 3px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}
.amount-stack {
    display: block;
    white-space: nowrap;
}
.amount-stack strong {
    display: block;
    color: var(--text);
}
.status-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 5px 9px;
    border-radius: 100px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-approved,
.status-paid {
    background: #e8f8f1;
    color: var(--success);
}
.status-rejected,
.status-cancelled {
    background: #fff0ee;
    color: var(--danger);
}
.status-submitted,
.status-review {
    background: #fff4e8;
    color: var(--warning);
}
.status-scheduled,
.status-correction {
    background: #edf2ff;
    color: var(--primary);
}
.status-open,
.status-draft {
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    color: var(--primary);
}
.status-validated,
.status-closed,
.status-exported {
    background: #e9f4ff;
    color: #0967a8;
}
.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}
.balance-row:last-child {
    border: 0;
}
.balance-row strong,
.balance-row small {
    display: block;
}
.balance-row small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}
.balance-row > span {
    font-weight: 700;
    color: var(--primary);
}
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.filter-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    margin-right: auto;
}
.filter-bar .form-select {
    max-width: 230px;
}

.audit-correlation { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.audit-context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.audit-context-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.audit-context-item > i { color: var(--primary); font-size: 1.1rem; }
.audit-context-item span { min-width: 0; display: flex; flex-direction: column; }
.audit-context-item small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.audit-context-item strong { overflow-wrap: anywhere; font-size: .86rem; }
.audit-compare th, .audit-compare td { min-width: 190px; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-compare th:first-child { min-width: 170px; }
@media (max-width: 991.98px) { .audit-context-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 575.98px) { .audit-context-grid { grid-template-columns: 1fr; } }
.privacy-principles { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.privacy-principles>div,.retention-card { padding:18px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:var(--shadow); }
.privacy-principles i { color:var(--primary); font-size:1.4rem; display:block; margin-bottom:10px; }
.privacy-principles strong,.privacy-principles span { display:block; }.privacy-principles span,.retention-card p { color:var(--muted); font-size:.86rem; margin:.35rem 0 0; }
.privacy-case-detail { padding:18px; background:var(--surface-2); border-radius:16px; }.privacy-case-detail small { color:var(--muted); text-transform:uppercase; font-weight:700; }.privacy-case-detail p { white-space:pre-wrap; }
.retention-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }.retention-card>span { color:var(--primary); font-size:.72rem; font-weight:800; }.retention-card>strong { display:block; margin-top:4px; }.retention-card div { display:flex; justify-content:space-between; gap:12px; margin-top:14px; }.retention-card small { color:var(--muted); text-align:right; }
.privacy-incident { padding:14px 0; border-bottom:1px solid var(--border); }.privacy-incident span { float:right; color:var(--warning); }.privacy-incident p { margin:.35rem 0 0; color:var(--muted); }
@media(max-width:900px){.privacy-principles,.retention-grid{grid-template-columns:1fr;}}
.table-shell {
    width: 100%;
    overflow-x: auto;
}
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    margin: 0;
}
.table thead th {
    padding: 12px 14px;
    border-color: var(--border);
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.table tbody td {
    padding: 13px 14px;
    border-color: var(--border);
    vertical-align: middle;
}
.table-action {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}
.table-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.dt-container .dt-search input,
.dt-container .dt-length select {
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    padding: 8px 10px !important;
}
.dt-container .dt-buttons .btn {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    font-size: 12px;
}
.dt-container .dt-layout-row {
    margin: 0 0 14px !important;
}
.dt-container .dt-layout-row:last-child {
    margin: 14px 0 0 !important;
}
.form-layout
{
    width: 100%;
    max-width: none;
}
.form-layout .form-panel
{
    width: 100%;
}
.form-panel {
    padding: 28px;
}
.form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}
.form-control,
.form-select,
.input-group-text {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 11px;
    min-height: 46px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
    background: var(--surface);
    color: var(--text);
}
.form-submit {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}
.step-chip {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 24px;
    margin-right: 10px;
    border-radius: 8px;
    background: #eaf0ff;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
}
.check-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.check-card input {
    position: absolute;
    opacity: 0;
}
.check-card span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
}
.check-card input:checked + span {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
}
.workflow-actions { display: grid; gap: 10px; }
.workflow-actions .check-card > span { align-items: flex-start; }
.workflow-actions .check-card strong,
.workflow-actions .check-card small { display: block; }
.workflow-actions .check-card small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.workflow-command { border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); }
.workflow-command-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.workflow-command-head h2 { margin: 2px 0 4px; font-size: 18px; }
.workflow-command-head p { margin: 0; color: var(--muted); }
.workflow-command-head > i { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: color-mix(in srgb, var(--primary) 11%, var(--surface)); color: var(--primary); font-size: 23px; }
.workflow-actions-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workflow-command-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; }
.workflow-command-footer .btn { min-height: 48px; white-space: nowrap; }
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.7fr);
    gap: 20px;
}
.hero-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px;
}
.hero-detail h2 {
    margin: 14px 0 5px;
    font-size: 22px;
}
.hero-detail p {
    color: var(--muted);
    margin: 0;
}
.hero-amount {
    text-align: right;
}
.hero-amount small,
.hero-amount strong,
.hero-amount span {
    display: block;
}
.hero-amount strong {
    font-size: 28px;
    margin: 5px 0;
}
.hero-amount span {
    color: var(--muted);
}
.document-row,
.person-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.document-row > i {
    font-size: 23px;
    color: var(--danger);
}
.document-row div,
.person-row div {
    flex: 1;
}
.document-row strong,
.document-row small,
.person-row strong,
.person-row small {
    display: block;
}
.document-row small,
.person-row small {
    color: var(--muted);
    margin-top: 3px;
}
.timeline {
    border-left: 1px solid var(--border);
    margin-left: 7px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 35%, var(--border)) transparent;
}
.history-panel { position: sticky; top: 96px; align-self: start; }
.timeline-item {
    display: grid;
    grid-template-columns: 15px 1fr;
    gap: 12px;
    margin-left: -8px;
    padding-bottom: 20px;
}
.timeline-item > span {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary);
    border: 4px solid var(--surface);
}
.timeline-item p {
    color: var(--muted);
    margin: 4px 0;
}
.timeline-item small {
    color: var(--muted);
    font-size: 10px;
}
.profile-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: -6px 0 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.profile-avatar {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #e9efff;
    color: #244fbf;
    font-weight: 800;
    font-size: 18px;
}
.profile-strip h2,
.profile-strip p {
    margin: 0;
}
.profile-strip p {
    color: var(--muted);
    margin-top: 3px;
}
.document-config-list,
.document-add-list { display: grid; gap: 12px; }
.document-config-row,
.document-add-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto 130px;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}
.document-config-main,
.document-upload-head { display: flex; align-items: flex-start; gap: 12px; }
.document-config-main strong,
.document-config-main small,
.document-upload-head strong,
.document-upload-head small,
.document-add-row strong,
.document-add-row small { display: block; }
.document-config-main small,
.document-upload-head small,
.document-add-row small { color: var(--muted); margin-top: 4px; }
.document-qty { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.document-qty .form-control { width: 74px; }
.document-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.document-upload-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-2);
}
.document-upload-head > i { color: var(--primary); font-size: 25px; }
.document-upload-head .status-badge { display: inline-flex; margin-left: 8px; }
.document-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}
.btn-file-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary);
    font-weight: 700;
}
.btn-file-select:hover,
.btn-file-select:focus { background: color-mix(in srgb, var(--primary) 19%, var(--surface)); color: var(--primary); }
.document-picker-empty { min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-selected-list { display: grid; gap: 7px; }
.document-selected-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}
.document-selected-row > span { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; font-size: 12px; }
.document-selected-row > span span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-selected-row i { color: var(--primary); }
.document-remove-selection {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--danger);
}
.document-remove-selection:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.form-control[type="file"] { padding: 5px; border-radius: 12px; }
.form-control[type="file"]::file-selector-button {
    margin: 0 10px 0 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary);
    font-weight: 700;
}
.document-add-row { grid-template-columns: minmax(190px, 1fr) minmax(280px, 1.4fr); }
.document-add-row form { width: 100%; }
.document-observation {
    padding: 9px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    color: var(--text);
    font-size: 12px;
}
.document-validation {
    display: grid;
    grid-template-columns: 160px minmax(220px, 1fr) auto;
    gap: 10px;
    padding: 10px 0 16px;
    border-bottom: 1px solid var(--border);
}
.document-row form { margin: 0; }
.table-action.danger { border: 0; color: var(--danger); }
.correction-panel { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.correction-reason {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--warning) 14%, var(--surface));
}
.correction-reason > i { color: var(--warning); font-size: 20px; }
.correction-reason p { margin: 3px 0 0; color: var(--muted); }
.correction-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
}
.correction-submit p { margin: 4px 0 0; color: var(--muted); }
.workflow-lock { display: flex; gap: 12px; padding: 15px; border-radius: 13px; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.workflow-lock > i { color: var(--primary); font-size: 20px; }
.workflow-lock p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
.app-dialog .modal-content {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 28px 70px rgba(15, 23, 42, .25);
}
.app-dialog .modal-body { padding: 34px; text-align: center; }
.app-dialog-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 24px;
    font-size: 34px;
}
.app-dialog-icon > span { position: absolute; right: -8px; top: -9px; font-size: 23px; filter: drop-shadow(0 3px 5px rgba(0,0,0,.12)); }
.app-dialog-success { color: #08754a; background: rgba(22, 163, 106, .13); }
.app-dialog-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.app-dialog-confirm { color: #c66a06; background: rgba(245, 158, 11, .14); }
.app-dialog-info { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.app-dialog h2 { margin: 0 0 9px; font-size: 22px; }
.app-dialog p { margin: 0 auto; max-width: 390px; color: var(--muted); line-height: 1.6; white-space: pre-line; }
.app-dialog-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.app-dialog-actions .btn { min-width: 125px; border-radius: 12px; }
.upload-panel {
    text-align: center;
    padding: 38px;
}
.upload-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 20px;
    background: #edf2ff;
    color: var(--primary);
    font-size: 28px;
}
.upload-panel p {
    color: var(--muted);
}
.empty-state {
    text-align: center;
    padding: 35px;
    color: var(--muted);
}
.empty-state i {
    font-size: 28px;
}
.empty-state.compact {
    padding: 16px;
}
.auth-page {
    min-height: 100vh;
    background: #0d1729;
}
.auth-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 100vh;
}
.auth-brand {
    padding: 64px 7vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: radial-gradient(circle at 75% 15%, rgba(73, 112, 255, 0.33), transparent 35%),
        linear-gradient(145deg, #0b1425, #17284a);
}
.auth-brand .brand {
    color: #fff;
}
.auth-kicker {
    display: inline-block;
    margin-bottom: 18px;
    color: #9db3ff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.14em;
}
.auth-brand h1 {
    font-size: clamp(38px, 4vw, 64px);
    max-width: 760px;
    line-height: 1.08;
    letter-spacing: -0.05em;
}
.auth-brand p {
    max-width: 650px;
    color: #b8c3d8;
    font-size: 17px;
    line-height: 1.7;
}
.auth-trust {
    display: flex;
    gap: 24px;
    color: #c7d1e4;
}
.auth-card {
    display: grid;
    place-items: center;
    padding: 30px;
    background: var(--bg);
}
.auth-card-inner {
    width: min(430px, 100%);
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.auth-card h2 {
    font-size: 30px;
    margin: 5px 0;
}
.brand.light {
    color: #fff;
}
.dropdown-menu {
    background: var(--surface);
    border-color: var(--border);
}
.dropdown-item {
    color: var(--text);
}
.dropdown-item:hover {
    background: var(--surface-2);
    color: var(--text);
}
code {
    color: var(--primary);
}
.payment-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    border-radius: 20px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface));
    box-shadow: var(--shadow);
}
.payment-hero h2 { margin: 12px 0 5px; font-size: 25px; }
.payment-hero p { margin: 0; color: var(--muted); }
.payment-hero-stats { display: flex; gap: 10px; }
.payment-hero-stats span { min-width: 110px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.payment-hero-stats small,
.payment-hero-stats strong { display: block; }
.payment-hero-stats small { color: var(--muted); font-size: 11px; }
.payment-hero-stats strong { margin-top: 3px; font-size: 18px; }
.batch-create-bar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; margin-bottom: 18px; }
.payment-batch-row,
.payment-file-row,
.bank-account-card { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--surface); }
.payment-batch-row + .payment-batch-row,
.payment-file-row + .payment-file-row { margin-top: 10px; }
.payment-batch-row:hover,
.payment-file-row:hover,
.bank-account-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.payment-batch-row > div,
.payment-file-row > div,
.bank-account-card > div { flex: 1; min-width: 0; }
.payment-batch-row small,
.payment-file-row small,
.bank-account-card small { display: block; margin-top: 3px; color: var(--muted); }
.payment-batch-icon,
.payment-file-row > span,
.bank-account-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); font-size: 19px; }
.bank-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.danger-panel { border-color: color-mix(in srgb, var(--danger) 28%, var(--border)); }
@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .history-panel { position: static; }
    .history-panel .timeline { max-height: 440px; }
    .check-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .balance-card-grid { grid-template-columns: 1fr; }
    .payment-hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: 0.2s ease;
    }
    .sidebar-open .sidebar {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .topbar {
        padding: 0 18px;
    }
    .app-content {
        padding: 24px 18px;
    }
    .user-copy,
    .theme-toggle span {
        display: none;
    }
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-brand {
        display: none;
    }
}
@media (max-width: 640px) {
    .document-config-row,
    .document-add-row,
    .document-upload-grid,
    .document-validation { grid-template-columns: 1fr; }
    .workflow-actions-main,
    .workflow-command-footer { grid-template-columns: 1fr; }
    .workflow-command-footer .btn { width: 100%; }
    .correction-panel .panel-head { align-items: stretch; flex-direction: column; }
    .correction-panel .panel-head .btn { width: 100%; }
    .balance-employee-filter { align-items: stretch; flex-direction: column; }
    .balance-employee-filter > div:first-child { max-width: none; width: 100%; }
    .balance-breakdown { grid-template-columns: 1fr; }
    .document-picker,
    .correction-submit { align-items: stretch; flex-direction: column; }
    .btn-file-select,
    .correction-submit .btn { justify-content: center; width: 100%; }
    .metric-grid {
        grid-template-columns: 1fr;
    }
    .payment-hero-stats { display: grid; grid-template-columns: 1fr; width: 100%; }
    .payment-hero-stats span { min-width: 0; }
    .batch-create-bar,
    .bank-account-grid { grid-template-columns: 1fr; }
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .page-actions,
    .page-actions .btn {
        width: 100%;
    }
    .request-row {
        grid-template-columns: 40px 1fr auto;
    }
    .request-row .status-badge {
        display: none;
    }
    .request-amount {
        grid-column: 2/4;
        text-align: left;
        align-items: flex-start;
    }
    .check-grid {
        grid-template-columns: 1fr;
    }
    .hero-detail {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }
    .hero-amount {
        text-align: left;
    }
    .auth-card-inner {
        padding: 28px;
    }
}

/* Paso 9: conciliación, reprocesos y comprobantes de pago */
.payment-reconcile .panel-head { align-items: center; }
.reconcile-list { display: grid; gap: 14px; }
.reconcile-row { background: var(--surface-soft, #f7f9fc); border: 1px solid var(--border-color, #e2e8f0); border-radius: 16px; padding: 18px; }
.reconcile-person { align-items: center; display: grid; gap: 12px; grid-template-columns: auto 1fr auto; }
.reconcile-person small { color: var(--text-secondary, #64748b); display: block; margin-top: 3px; }
.reconcile-person b { color: var(--text-primary, #172033); font-size: 1.05rem; }
.reconcile-icon { align-items: center; background: rgba(45, 91, 220, .1); border-radius: 12px; color: #2d5bdc; display: inline-flex; font-size: 1.1rem; height: 42px; justify-content: center; width: 42px; }
.reconcile-fields { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.reconcile-fields > div:only-child { grid-column: 1 / -1; }
.reconcile-submit { align-items: center; background: rgba(22, 163, 74, .08); border-radius: 14px; color: var(--text-secondary, #64748b); display: flex; gap: 10px; margin-top: 18px; padding: 14px 16px; }
.reconcile-submit .btn { margin-left: auto; }
.payment-reprocess { align-items: center; }
.payment-receipt-card { align-items: center; background: linear-gradient(135deg, rgba(22, 163, 74, .13), rgba(45, 91, 220, .08)); border: 1px solid rgba(22, 163, 74, .2); border-radius: 18px; display: grid; gap: 16px; grid-template-columns: auto 1fr auto; padding: 18px 20px; }
.payment-receipt-card > span { align-items: center; background: #16a34a; border-radius: 14px; color: #fff; display: inline-flex; font-size: 1.25rem; height: 48px; justify-content: center; width: 48px; }
.payment-receipt-card small, .payment-receipt-card strong { display: block; }
.payment-receipt-card p { color: var(--text-secondary, #64748b); margin: 3px 0 0; }

@media (max-width: 768px) {
    .payment-reconcile .panel-head, .payment-reprocess { align-items: stretch; flex-direction: column; }
    .payment-reconcile .panel-head .btn, .payment-reprocess .btn { width: 100%; }
    .reconcile-fields { grid-template-columns: 1fr; }
    .reconcile-person { grid-template-columns: auto 1fr; }
    .reconcile-person b { grid-column: 2; }
    .reconcile-submit { align-items: stretch; flex-direction: column; }
    .reconcile-submit .btn { margin-left: 0; width: 100%; }
    .payment-receipt-card { grid-template-columns: auto 1fr; }
    .payment-receipt-card .btn { grid-column: 1 / -1; width: 100%; }
}

/* Paso 15: notificaciones, documentos legales y operación */
.notify-button { position: relative; }
.notify-button > span { align-items:center;background:#ef4444;border:2px solid var(--surface,#fff);border-radius:999px;color:#fff;display:flex;font-size:.65rem;font-weight:800;height:19px;justify-content:center;min-width:19px;padding:0 4px;position:absolute;right:-3px;top:-4px; }
.notify-dropdown { border:0;border-radius:16px;max-height:520px;overflow:auto;padding:0;width:min(390px,calc(100vw - 24px)); }
.notify-head,.notify-foot { align-items:center;display:flex;justify-content:space-between;padding:14px 16px; }
.notify-head { border-bottom:1px solid var(--border-color,#e5e7eb); }
.notify-item { align-items:flex-start;color:var(--text-primary,#172033);display:flex;gap:12px;padding:13px 16px;text-decoration:none; }
.notify-item:hover,.notify-item.unread { background:rgba(45,91,220,.07); }
.notify-item > i { color:#2d5bdc;font-size:1.15rem;margin-top:2px; }
.notify-item span,.notify-item strong,.notify-item small { display:block;min-width:0; }
.notify-item small { color:var(--text-secondary,#64748b);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.notify-empty { color:var(--text-secondary,#64748b);margin:0;padding:28px;text-align:center; }
.notify-foot { border-top:1px solid var(--border-color,#e5e7eb);justify-content:center; }
.notification-list { display:grid;gap:12px; }
.notification-card { border:1px solid var(--border-color,#e5e7eb);border-radius:16px;display:grid;gap:14px;grid-template-columns:auto 1fr;padding:18px; }
.notification-card.unread { background:rgba(45,91,220,.05);border-color:rgba(45,91,220,.25); }
.notification-card > i { color:#2d5bdc;font-size:1.35rem; }
.notification-card h2 { font-size:1rem;margin:5px 0; }.notification-card p{color:var(--text-secondary,#64748b);}
.notification-meta { color:var(--text-secondary,#64748b);display:flex;font-size:.78rem;gap:12px;justify-content:space-between;text-transform:uppercase; }
.legal-accept details { border:1px solid var(--border-color,#e5e7eb);border-radius:14px;margin-top:14px;overflow:hidden; }
.legal-accept summary { cursor:pointer;display:flex;justify-content:space-between;padding:16px; }.legal-content{background:var(--surface-soft,#f7f9fc);line-height:1.7;padding:20px;white-space:normal;}
.legal-check { align-items:flex-start;display:flex;font-weight:600;gap:12px;margin-top:20px; }
.auth-legal { color:var(--text-secondary,#64748b);font-size:.78rem;margin-top:18px;text-align:center; }.auth-legal a{white-space:nowrap;}
.operation-note { align-items:center;background:rgba(45,91,220,.07);border-radius:12px;color:var(--text-secondary,#64748b);display:flex;gap:10px;margin-top:16px;padding:14px; }
.report-metrics .metric-card > i { color:#2d5bdc;font-size:1.35rem; }

/* Documentos legales públicos */
.legal-page{background:var(--app-bg,#f3f6fb);color:var(--text-primary,#172033);min-height:100vh}.legal-topbar{align-items:center;background:var(--surface,#fff);border-bottom:1px solid var(--border-color,#e5e7eb);display:flex;height:74px;justify-content:space-between;padding:0 clamp(20px,4vw,64px);position:sticky;top:0;z-index:20}.legal-topbar>div{align-items:center;display:flex;gap:10px}.legal-brand{align-items:center;color:inherit;display:flex;gap:12px;text-decoration:none}.legal-brand span:last-child,.legal-brand strong,.legal-brand small{display:block}.legal-brand small{color:var(--text-secondary,#64748b);font-size:.68rem}.legal-shell{display:grid;gap:30px;grid-template-columns:270px minmax(0,860px);justify-content:center;margin:0 auto;max-width:1280px;padding:44px 28px 70px}.legal-sidebar{align-self:start;position:sticky;top:110px}.legal-back{color:var(--text-secondary,#64748b);display:inline-flex;gap:8px;margin-bottom:30px;text-decoration:none}.legal-sidebar>p{color:var(--text-secondary,#64748b);font-size:.72rem;font-weight:800;letter-spacing:.12em;margin:0 12px 10px;text-transform:uppercase}.legal-sidebar nav{display:grid;gap:6px}.legal-sidebar nav a{align-items:center;border-radius:12px;color:var(--text-secondary,#64748b);display:grid;font-weight:600;gap:12px;grid-template-columns:22px 1fr auto;padding:12px;text-decoration:none}.legal-sidebar nav a.active,.legal-sidebar nav a:hover{background:var(--surface,#fff);box-shadow:0 8px 24px rgba(15,23,42,.06);color:#2d5bdc}.legal-help{background:rgba(45,91,220,.08);border:1px solid rgba(45,91,220,.13);border-radius:14px;display:flex;gap:10px;margin-top:28px;padding:14px}.legal-help>i{color:#2d5bdc}.legal-help p{color:var(--text-secondary,#64748b);font-size:.76rem;margin:0}.legal-help strong{color:var(--text-primary,#172033);display:block;margin-bottom:3px}.legal-document{background:var(--surface,#fff);border:1px solid var(--border-color,#e5e7eb);border-radius:24px;box-shadow:0 18px 50px rgba(15,23,42,.07);overflow:hidden}.legal-hero{align-items:flex-start;background:linear-gradient(135deg,rgba(45,91,220,.11),rgba(99,102,241,.04));display:flex;gap:20px;padding:42px 48px 34px}.legal-icon{align-items:center;background:#2d5bdc;border-radius:18px;box-shadow:0 12px 28px rgba(45,91,220,.25);color:#fff;display:flex;font-size:1.4rem;height:58px;justify-content:center;min-width:58px}.legal-hero h1{font-size:clamp(1.8rem,3vw,2.6rem);letter-spacing:-.04em;margin:3px 0 14px}.legal-version{color:var(--text-secondary,#64748b);display:flex;flex-wrap:wrap;font-size:.82rem;gap:18px}.legal-version span{align-items:center;display:flex;gap:6px}.legal-summary{align-items:flex-start;background:rgba(22,163,74,.08);border:1px solid rgba(22,163,74,.15);border-radius:14px;display:flex;gap:13px;margin:30px 48px 0;padding:16px}.legal-summary>i{color:#16a34a;font-size:1.25rem}.legal-summary p{color:var(--text-secondary,#64748b);margin:3px 0 0}.legal-body{padding:20px 48px 45px}.legal-body h2{border-top:1px solid var(--border-color,#e5e7eb);font-size:1.18rem;margin:30px 0 13px;padding-top:28px;scroll-margin-top:95px}.legal-body p{color:var(--text-secondary,#64748b);line-height:1.78;margin:0 0 13px}.legal-bullet{align-items:flex-start;display:flex!important;gap:10px;padding-left:8px}.legal-bullet i{color:#2d5bdc;margin-top:4px}.legal-warning{align-items:flex-start;background:rgba(245,158,11,.1);border:1px solid rgba(245,158,11,.22);border-radius:12px;display:flex;gap:12px;margin:20px 0;padding:15px}.legal-warning i{color:#d97706}.legal-warning p{color:var(--text-primary,#172033);margin:0}.legal-document-foot{align-items:center;background:var(--surface-soft,#f7f9fc);border-top:1px solid var(--border-color,#e5e7eb);display:flex;gap:20px;justify-content:space-between;padding:24px 48px}.legal-document-foot p{color:var(--text-secondary,#64748b);margin:4px 0 0}.legal-document-foot span{color:#2d5bdc}.legal-site-foot{color:var(--text-secondary,#64748b);display:flex;font-size:.76rem;justify-content:space-between;margin:auto;max-width:1180px;padding:20px 28px 35px}
@media(max-width:900px){.legal-shell{display:block;padding:24px 16px 50px}.legal-sidebar{position:static}.legal-sidebar nav{display:flex;overflow:auto;padding-bottom:8px}.legal-sidebar nav a{grid-template-columns:auto auto;white-space:nowrap}.legal-sidebar nav a i:last-child{display:none}.legal-help,.legal-sidebar>p{display:none}.legal-back{margin-bottom:16px}.legal-hero{padding:28px 24px}.legal-summary{margin:22px 24px 0}.legal-body{padding:10px 24px 32px}.legal-document-foot{align-items:flex-start;flex-direction:column;padding:22px 24px}.legal-topbar{padding:0 16px}.legal-topbar .theme-toggle span{display:none}.legal-topbar .btn{font-size:0;padding:10px}.legal-topbar .btn i{font-size:1rem;margin:0}.legal-site-foot{align-items:flex-start;flex-direction:column;gap:6px}}
