:root {
    --bg: #f4f6f5;
    --surface: #ffffff;
    --surface-2: #f8faf9;
    --ink: #17211c;
    --muted: #758079;
    --muted-2: #9aa39e;
    --line: #e3e8e5;
    --line-strong: #d7ded9;
    --accent: #147a55;
    --accent-dark: #0d5d40;
    --accent-soft: #e9f5ef;
    --warning: #a66b15;
    --warning-soft: #fff5dc;
    --danger: #b33d45;
    --danger-soft: #fff0f1;
    --info: #3c6f9f;
    --info-soft: #edf5fc;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 14px 38px rgba(28, 42, 35, .06);
    --sidebar-width: 220px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(17, 28, 22, .36);
    backdrop-filter: blur(2px);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; display: block; }
::selection { background: #d8eee3; }
:focus-visible { outline: 3px solid rgba(20, 122, 85, .18); outline-offset: 2px; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    background: #fff;
    border-right: 1px solid var(--line);
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 54px;
    margin-bottom: 26px;
    padding: 5px 8px;
}
.brand-symbol {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--accent);
    font: 800 11px/1 "Inter", sans-serif;
    letter-spacing: .04em;
}
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font: 700 14px/1.15 "Inter", sans-serif; letter-spacing: -.02em; }
.brand-copy span { margin-top: 3px; color: var(--muted-2); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.nav-menu { display: grid; gap: 5px; }
.nav-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 45px;
    padding: 8px 10px;
    border-radius: 12px;
    color: #66716b;
    font-size: 13px;
    font-weight: 800;
    transition: .17s ease;
}
.nav-menu a:hover { color: var(--ink); background: var(--surface-2); }
.nav-menu a.is-active { color: var(--accent-dark); background: var(--accent-soft); }
.nav-icon {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
}
.nav-menu a.is-active .nav-icon { background: #fff; box-shadow: 0 2px 10px rgba(20,122,85,.08); }
.nav-icon svg { width: 16px; height: 16px; }
.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px 4px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.environment-dot { width: 7px; height: 7px; border-radius: 50%; background: #39b77b; box-shadow: 0 0 0 4px #eaf8f1; }

/* Main shell */
.main-area { min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(244, 246, 245, .88);
    border-bottom: 1px solid rgba(227,232,229,.8);
    backdrop-filter: blur(16px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-context { color: var(--muted); font-size: 12px; }
.topbar-context strong { color: var(--ink); font-weight: 800; }
.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
}
.user-badge { display: grid; place-items: center; }
.user-badge > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #d6e6dd;
    border-radius: 12px;
    background: #eef7f2;
    color: var(--accent-dark);
    font: 800 10px/1 "Inter", sans-serif;
}
.page-content { width: min(1500px, 100%); margin: 0 auto; padding: 30px; }

/* Headings */
.page-heading { margin-bottom: 18px; }
.page-heading h1 { margin: 0; font: 750 28px/1.15 "Inter", sans-serif; letter-spacing: -.045em; }
.page-heading .eyebrow { margin-bottom: 7px; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; }

/* Buttons */
.button {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    transition: .16s ease;
}
.button svg { width: 15px; height: 15px; }
.button.primary { color: #fff; background: var(--accent); box-shadow: 0 8px 22px rgba(20,122,85,.16); }
.button.primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button.secondary, .button.ghost { background: #fff; border-color: var(--line); }
.button.secondary:hover, .button.ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.button.light { background: #fff; color: var(--accent-dark); }
.compact-button { min-height: 32px; padding: 6px 9px; border-radius: 9px; font-size: 11px; }
.text-link, .icon-link { color: var(--accent); font-size: 12px; font-weight: 900; }
.icon-link { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Dashboard */
.overview-card {
    min-height: 220px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    align-items: stretch;
    gap: 22px;
    padding: 28px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 83% 20%, rgba(255,255,255,.11), transparent 20rem),
        linear-gradient(135deg, #0d5b40, #0d4735);
    color: #fff;
    box-shadow: 0 20px 55px rgba(10, 62, 44, .16);
}
.overview-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.overview-copy .eyebrow { color: #a9ddc5; }
.overview-copy h2 { max-width: 680px; margin: 10px 0 22px; font: 750 30px/1.12 "Inter", sans-serif; letter-spacing: -.045em; }
.overview-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.overview-actions .button.primary { background: #fff; color: var(--accent-dark); box-shadow: none; }
.overview-actions .button.primary:hover { background: #f5fbf8; }
.overview-actions .button.ghost { color: #d8eee4; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.13); }
.overview-zero {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 18px;
    background: rgba(255,255,255,.07);
}
.overview-zero span, .overview-zero small { color: #bad8ca; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.overview-zero strong { margin: 8px 0 3px; font: 800 42px/1 "Inter", sans-serif; letter-spacing: -.05em; }

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.metric-card {
    min-height: 94px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    transition: .16s ease;
}
.metric-card:hover { transform: translateY(-2px); border-color: #d4dfd8; box-shadow: var(--shadow); }
.metric-card.attention { border-color: #f0dfba; background: #fffdf7; }
.metric-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.metric-card.attention .metric-icon { background: var(--warning-soft); color: var(--warning); }
.metric-icon svg { width: 17px; height: 17px; }
.metric-card strong, .metric-card span { display: block; }
.metric-card strong { font: 800 23px/1 "Inter", sans-serif; letter-spacing: -.04em; }
.metric-card div > span { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr); gap: 14px; }
.activity-list { display: grid; }
.activity-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 10px 88px 20px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--line);
    transition: .14s ease;
}
.activity-row:last-child { border-bottom: 0; }
.activity-row:hover { padding-left: 7px; padding-right: 7px; background: var(--surface-2); border-radius: 10px; }
.activity-id { color: var(--muted-2); font-size: 10px; font-weight: 900; }
.activity-main strong, .activity-main span { display: block; }
.activity-main strong { font-size: 12px; }
.activity-main span { margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-date { color: var(--muted); font-size: 10px; text-align: right; }
.activity-arrow { color: var(--muted-2); }
.activity-arrow svg { width: 14px; height: 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #aeb6b1; }
.status-dot.success { background: #27a86f; }
.status-dot.warning { background: #d79a35; }
.status-dot.info { background: #5991c6; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.quick-link { min-height: 91px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); transition: .15s ease; }
.quick-link:hover { background: var(--accent-soft); border-color: #d7e8df; color: var(--accent-dark); }
.quick-link > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #fff; color: var(--accent); }
.quick-link svg { width: 15px; height: 15px; }
.quick-link strong { font-size: 11px; }

/* Generic layout */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); }
.result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 5px 18px rgba(26, 40, 32, .025);
    overflow: hidden;
}
.panel:not(.table-panel) { padding: 20px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-header.compact-header { align-items: center; margin-bottom: 11px; }
.panel-header h2 { margin: 0; font: 700 15px/1.25 "Inter", sans-serif; letter-spacing: -.025em; }
.panel-header p { max-width: 650px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.reconciliation-summary { margin-bottom: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.stat-card { min-height: 100px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card span { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { display: block; margin: 7px 0 4px; font: 800 22px/1 "Inter", sans-serif; letter-spacing: -.04em; }
.stat-card small { font-size: 10px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.toolbar-copy { max-width: 650px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.toolbar-actions form { margin: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.implementation-note, .preview-message, .process-ready {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}
.implementation-note { padding: 13px 14px; }
.implementation-note strong { font-size: 11px; }
.implementation-note p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.process-ready { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; margin-bottom: 14px; background: #f3faf6; border-color: #d9e9e0; }
.process-ready strong { display: block; font-size: 12px; }
.process-ready p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.preview-message { margin-bottom: 13px; padding: 11px 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }

/* Status */
.status-chip { display: inline-flex; align-items: center; min-height: 25px; padding: 5px 8px; border: 0; border-radius: 999px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.status-chip.success { color: var(--accent-dark); background: var(--accent-soft); }
.status-chip.neutral { color: #6f7873; background: #eff2f0; }
.status-chip.warning { color: var(--warning); background: var(--warning-soft); }
.status-chip.info { color: var(--info); background: var(--info-soft); }
.file-indicator { display: inline-flex; margin: 2px 3px 2px 0; padding: 5px 7px; border-radius: 7px; background: #f0f2f1; color: #909994; font-size: 9px; }
.file-indicator.ok { color: var(--accent-dark); background: var(--accent-soft); font-weight: 800; }
.muted { color: var(--muted); font-size: 10px; }
code { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); font-size: 10px; }

/* Tables */
.table-panel { overflow-x: auto; }
.table-panel .panel-header { padding: 18px 18px 0; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 11px; }
th { position: sticky; top: 0; z-index: 1; background: #fafbfa; color: #7d8882; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfb; }
.empty-state, .mini-empty { color: var(--muted); text-align: center; padding: 25px !important; font-size: 11px; }

/* Forms */
.panel-form { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid label, .form-stack, .mapping-fields label, .mapping-panel label { display: flex; flex-direction: column; gap: 6px; }
.form-grid label > span, .mapping-fields label > span, .mapping-panel label > span { font-size: 10px; font-weight: 900; color: var(--ink); }
input, select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    transition: .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: #8fbca7; box-shadow: 0 0 0 3px rgba(20,122,85,.07); }
textarea { resize: vertical; }
small { color: var(--muted); }
.file-field { padding: 13px; border: 1px dashed #cad5ce; border-radius: 12px; background: #fafcfb; }
.file-field.has-value { border-color: #a9cfba; background: #f4faf6; }
.file-field small { font-size: 10px; line-height: 1.4; }
.file-selected { color: var(--accent-dark) !important; font-weight: 800; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.inline-fields { display: flex; gap: 7px; }
.inline-fields.two > * { flex: 1; }
.form-stack { gap: 9px; }
.compact-form { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.compact-form h3 { margin: 0 0 10px; font: 700 13px/1.2 "Inter", sans-serif; }

/* Bank/rules */
.bank-list { display: grid; gap: 8px; margin-bottom: 18px; }
.bank-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.bank-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 900; font-size: 10px; }
.bank-card strong, .bank-card span { display: block; }
.bank-card strong { font-size: 11px; }
.bank-card span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.rules-table { margin-top: 14px; }

/* Preview / mapping */
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.preview-file, .mapping-panel { min-width: 0; }
.sheet-stack { display: grid; gap: 10px; }
.sheet-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.sheet-card-header { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.sheet-card-header strong, .sheet-card-header span { display: block; }
.sheet-card-header strong { font-size: 11px; }
.sheet-card-header span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.sheet-meta { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.sheet-meta span { margin: 0; padding: 4px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 8px; font-weight: 800; }
.preview-table-wrap { overflow-x: auto; }
.preview-table { min-width: 620px; }
.preview-table th { width: 70px; color: var(--accent-dark); background: #f3f8f5; }
.preview-table td { min-width: 105px; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapping-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mapping-summary { display: grid; gap: 7px; }
.mapping-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.mapping-summary-row strong { font-size: 10px; }
.mapping-summary-row span { color: var(--muted); font-size: 10px; text-align: right; }

/* Empty / flash */
.empty-module { min-height: 310px; display: grid; place-items: center; align-content: center; text-align: center; }
.module-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font: 900 18px/1 "Inter", sans-serif; }
.empty-module h2 { margin: 13px 0 4px; font: 700 17px/1.2 "Inter", sans-serif; }
.empty-module p { max-width: 520px; margin: 0 0 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.feature-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.feature-tags span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 9px; }
.flash { position: relative; margin-bottom: 14px; padding: 11px 40px 11px 13px; border-radius: 11px; font-size: 11px; font-weight: 800; }
.flash.success { color: var(--accent-dark); background: var(--accent-soft); border: 1px solid #d4e9df; }
.flash.error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f1d3d6; }
.flash-close { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: currentColor; font-size: 17px; }

/* Legacy process classes kept for compatibility */
.process-track { display: flex; align-items: center; overflow-x: auto; padding: 4px 0 8px; }
.process-step { min-width: 82px; text-align: center; }
.process-step b { width: 30px; height: 30px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.process-step.done b { color: #fff; background: var(--accent); border-color: var(--accent); }
.process-step span, .process-step strong, .process-step small { display: block; }
.process-step strong { font-size: 10px; }
.process-step small { color: var(--muted); font-size: 8px; margin-top: 2px; }
.process-line { min-width: 24px; height: 1px; flex: 1; margin: 0 4px 27px; background: var(--line); }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
    .sidebar { padding-inline: 10px; }
    .brand { justify-content: center; padding-inline: 0; }
    .brand-copy, .nav-menu a > span:not(.nav-icon), .sidebar-footer > span:last-child { display: none; }
    .nav-menu a { justify-content: center; padding-inline: 0; }
    .nav-icon { width: 38px; height: 38px; }
    .sidebar-footer { justify-content: center; }
    .overview-card { grid-template-columns: 1fr 150px; }
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2, .preview-grid, .result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -240px;
        width: 220px;
        transition: left .2s ease;
        box-shadow: 20px 0 50px rgba(12, 30, 20, .12);
    }
    body.menu-open .sidebar { left: 0; }
    .brand { justify-content: flex-start; }
    .brand-copy, .nav-menu a > span:not(.nav-icon), .sidebar-footer > span:last-child { display: block; }
    .nav-menu a { justify-content: flex-start; padding-inline: 10px; }
    .nav-icon { width: 29px; height: 29px; }
    .sidebar-footer { justify-content: flex-start; }
    .menu-toggle { display: grid; }
    .topbar { height: 62px; padding: 0 14px; }
    .page-content { padding: 18px 14px 28px; }
    .page-heading h1 { font-size: 23px; }
    .quick-create .button-label { display: none; }
    .quick-create { width: 38px; padding: 0; }
    .overview-card { min-height: auto; grid-template-columns: 1fr; padding: 21px; }
    .overview-copy h2 { font-size: 25px; margin-bottom: 17px; }
    .overview-zero { min-height: 110px; }
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .metric-card { min-height: 82px; padding: 12px; gap: 10px; }
    .metric-icon { width: 34px; height: 34px; flex-basis: 34px; }
    .metric-card strong { font-size: 20px; }
    .dashboard-columns, .grid-main, .grid-2, .form-grid, .preview-grid, .result-grid, .stat-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .toolbar, .process-ready { align-items: flex-start; flex-direction: column; }
    .toolbar-actions { width: 100%; }
    .toolbar-actions .button { flex: 1; }
    .inline-fields { flex-direction: column; }
    .mapping-fields { grid-template-columns: 1fr; }
    .activity-row { grid-template-columns: 38px minmax(0, 1fr) 8px 18px; }
    .activity-date { display: none; }
    .topbar-context { display: none; }
}

@media (max-width: 430px) {
    .metric-strip { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .overview-actions { width: 100%; }
    .overview-actions .button { flex: 1; }
}

/* Global loader */
.global-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(244, 247, 245, .76);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}
.global-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.global-loader-card {
    min-width: 230px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 17px;
    border: 1px solid rgba(215, 222, 217, .92);
    border-radius: 16px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 22px 60px rgba(25, 48, 37, .14);
}
.global-loader-mark {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: var(--accent-soft);
    overflow: hidden;
}
.global-loader-mark::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(20, 122, 85, .16);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: global-loader-spin .72s linear infinite;
}
.global-loader-mark span {
    position: absolute;
    top: 18px;
    width: 6px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
.global-loader-mark span:first-child { left: 6px; }
.global-loader-mark span:last-child { right: 6px; }
.global-loader-copy strong, .global-loader-copy span { display: block; }
.global-loader-copy strong { font: 800 12px/1.2 "Inter", sans-serif; }
.global-loader-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
@keyframes global-loader-spin { to { transform: rotate(360deg); } }

/* Statistics */
.statistics-toolbar { align-items: flex-end; }
.statistics-selector label { display: flex; align-items: center; gap: 9px; }
.statistics-selector label > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.statistics-selector select { min-width: 330px; width: auto; padding-right: 34px; background-color: #fff; }
.compact-empty { min-height: 260px; }
.compact-empty .module-icon svg { width: 22px; height: 22px; }

.statistics-head { margin-bottom: 14px; }
.statistics-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.statistics-process-id { margin-bottom: 5px; color: var(--accent); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.statistics-title-row h2 { margin: 0; font: 750 19px/1.2 "Inter", sans-serif; letter-spacing: -.025em; }
.statistics-title-row p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.statistics-head-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.statistics-kpis { display: grid; grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.statistics-kpi { min-width: 0; min-height: 92px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.statistics-kpi > span, .statistics-kpi > small { display: block; }
.statistics-kpi > span { color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.statistics-kpi > strong { display: block; margin: 7px 0 4px; font: 800 21px/1 "Inter", sans-serif; letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statistics-kpi > small { color: var(--muted); font-size: 9px; }
.statistics-kpi.primary-kpi { color: #fff; border-color: var(--accent); background: var(--accent); }
.statistics-kpi.primary-kpi > span, .statistics-kpi.primary-kpi > small { color: rgba(255,255,255,.72); }
.statistics-kpi.attention { border-color: #f0dfbc; background: var(--warning-soft); }
.statistics-kpi.attention > strong { color: #8d5d16; }
.statistics-kpi.ok { border-color: #d7eadf; background: var(--accent-soft); }
.statistics-kpi.ok > strong { color: var(--accent-dark); }
.statistics-progress { height: 5px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.statistics-progress i { display: block; height: 100%; border-radius: inherit; background: #fff; }

.statistics-workspace { padding: 0 !important; }
.statistics-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.statistics-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 900; white-space: nowrap; }
.statistics-tab b { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: #edf1ef; color: #758079; font-size: 8px; }
.statistics-tab:hover { color: var(--ink); background: var(--surface-2); }
.statistics-tab.is-active { color: var(--accent-dark); background: var(--accent-soft); }
.statistics-tab.is-active b { color: #fff; background: var(--accent); }
.statistics-panel { display: none; }
.statistics-panel.is-active { display: block; }
.statistics-filterbar { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.statistics-search { min-width: 260px; flex: 1; position: relative; }
.statistics-search > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.statistics-search svg { width: 14px; height: 14px; }
.statistics-search input { padding-left: 31px; background: #fff; }
.statistics-filterbar select { width: auto; min-width: 180px; background: #fff; }
.statistics-visible { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.statistics-table-wrap { width: 100%; overflow: auto; max-height: 660px; }
.statistics-table-wrap table { min-width: 850px; }
.statistics-table-wrap thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.statistics-cross-table { min-width: 1040px !important; }
.statistics-cross-table th:first-child, .statistics-cross-table td:first-child,
.statistics-cross-table th:nth-child(3), .statistics-cross-table td:nth-child(3) { width: 36%; }
.statistics-cross-table .relation-column { width: 150px; text-align: center; }
.statistics-cross-table td { padding-top: 12px; padding-bottom: 12px; vertical-align: top; }
.statistics-cross-table tr[hidden] { display: none; }
.source-cell { min-width: 0; }
.source-cell-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.source-cell-top strong { color: var(--ink); font-size: 10px; }
.source-cell-top span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.source-cell p { max-width: 480px; margin: 6px 0; color: #4f5c55; font-size: 10px; line-height: 1.4; }
.source-cell-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.source-cell-meta span { color: var(--muted-2); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-cell-meta b { color: var(--ink); font-size: 10px; white-space: nowrap; }
.counterpart-stack { display: grid; gap: 7px; }
.counterpart-item + .counterpart-item { padding-top: 7px; border-top: 1px dashed var(--line); }
.match-connector { position: relative; min-height: 65px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--accent-dark); }
.match-line { position: absolute; left: 0; right: 0; top: 23px; height: 1px; background: #cde4d8; }
.match-badge { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; background: var(--accent); box-shadow: 0 0 0 1px #d5e9df; }
.match-badge svg { width: 12px; height: 12px; }
.match-connector strong { position: relative; z-index: 1; margin-top: 4px; padding: 0 5px; background: #fff; font-size: 8px; }
.match-connector small { margin-top: 2px; color: var(--muted); font-size: 7px; white-space: nowrap; }
.difference-cell { text-align: right; vertical-align: middle !important; white-space: nowrap; }
.difference-cell strong, .difference-cell small { display: block; }
.difference-cell strong { font-size: 10px; }
.difference-cell small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.difference-cell.is-zero strong { color: var(--accent); }
.difference-cell.has-difference strong { color: var(--warning); }

.platform-stat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.platform-stat-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.platform-stat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.platform-stat-head strong { font: 800 11px/1.2 "Inter", sans-serif; }
.platform-stat-head span { color: var(--muted); font-size: 9px; }
.platform-stat-row { display: grid; grid-template-columns: 55px minmax(80px, 1fr) 110px; align-items: center; gap: 9px; margin-top: 7px; }
.platform-stat-row > span { color: var(--muted); font-size: 8px; font-weight: 800; }
.platform-stat-row > div { height: 6px; overflow: hidden; border-radius: 999px; background: #e7ece9; }
.platform-stat-row > div i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.platform-stat-row.auxiliary > div i { background: #78a991; }
.platform-stat-row b { text-align: right; font-size: 9px; white-space: nowrap; }

@media (max-width: 1180px) {
    .statistics-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .statistics-kpi.primary-kpi { grid-column: span 1; }
}

@media (max-width: 760px) {
    .statistics-toolbar { align-items: stretch; }
    .statistics-selector, .statistics-selector label { width: 100%; }
    .statistics-selector label { align-items: flex-start; flex-direction: column; }
    .statistics-selector select { width: 100%; min-width: 0; }
    .statistics-title-row { flex-direction: column; }
    .statistics-head-actions { width: 100%; }
    .statistics-head-actions .button { flex: 1; }
    .statistics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .statistics-kpi.primary-kpi { grid-column: span 2; }
    .statistics-filterbar { align-items: stretch; flex-direction: column; }
    .statistics-search, .statistics-filterbar select { width: 100%; min-width: 0; }
    .statistics-visible { margin-left: 0; }
    .platform-stat-list { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .statistics-kpis { grid-template-columns: 1fr; }
    .statistics-kpi.primary-kpi { grid-column: auto; }
    .platform-stat-row { grid-template-columns: 50px minmax(60px, 1fr) 90px; }
    .global-loader-card { width: min(100%, 290px); min-width: 0; }
}

/* ===== V4 · control contable y microinteracciones ===== */
.button:disabled,
button:disabled {
    opacity: .46;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.panel,
.stat-card,
.metric-card,
.quick-link,
.activity-row {
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

.panel:hover {
    border-color: #d6e1dc;
}

.stat-card:hover,
.metric-card:hover,
.quick-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(20, 48, 37, .07);
}

.control-strip {
    margin-bottom: 18px;
    padding: 20px 22px !important;
    background: linear-gradient(135deg, #fff 0%, #f7faf8 100%);
}
.control-strip.is-ready { border-color: #bcded0; }
.compact-link { font-size: 12px; white-space: nowrap; }
.control-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.control-mini { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.control-mini span,.control-mini small { display:block; color:var(--muted); }
.control-mini span { font-size:10px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.control-mini strong { display:block; margin:5px 0 2px; font:800 18px/1.1 "Inter",sans-serif; }
.control-mini small { font-size:11px; }
.control-mini.ok { border-color:#c7e2d6; background:#f6fbf8; }
.control-mini.ok strong { color:var(--accent); }
.control-mini.attention { border-color:#efdcbb; background:#fffaf1; }
.control-mini.attention strong { color:#9a6518; }

.closure-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:18px; padding:24px 26px !important; overflow:hidden; position:relative; }
.closure-hero::after { content:""; position:absolute; width:210px; height:210px; right:-90px; top:-110px; border:38px solid rgba(18,107,79,.06); border-radius:50%; }
.closure-hero h2 { margin:4px 0; font:800 22px/1.2 "Inter",sans-serif; }
.closure-hero p { margin:0; color:var(--muted); font-size:12px; }
.closure-hero.is-ready { border-color:#b8ddcd; background:linear-gradient(135deg,#f8fcfa,#eef8f3); }
.closure-hero.has-blockers { border-color:#eadfc9; background:linear-gradient(135deg,#fff,#fffaf1); }
.closure-state { position:relative; z-index:1; min-width:230px; padding:14px 16px; border-radius:14px; background:rgba(255,255,255,.72); border:1px solid rgba(0,0,0,.06); }
.closure-state strong,.closure-state small { display:block; }
.closure-state strong { font:800 16px/1.2 "Inter",sans-serif; }
.closure-state small { margin-top:5px; color:var(--muted); line-height:1.4; }

.control-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(300px,.6fr); gap:18px; margin-bottom:18px; }
.check-list { display:grid; gap:8px; }
.check-row { display:grid; grid-template-columns:10px minmax(0,1fr) 32px; align-items:center; gap:11px; padding:11px 12px; border-radius:11px; border:1px solid var(--line); background:#fbfcfb; }
.check-row strong,.check-row small { display:block; }
.check-row strong { font-size:12px; }
.check-row small { margin-top:2px; color:var(--muted); font-size:10px; }
.check-row > b { text-align:center; font-size:11px; }
.check-dot { width:8px; height:8px; border-radius:50%; background:#b7c2bd; }
.check-row.ok { border-color:#d6e8df; background:#f8fcfa; }
.check-row.ok .check-dot { background:#32b47a; box-shadow:0 0 0 4px rgba(50,180,122,.10); }
.check-row.attention { border-color:#f0dfbe; background:#fffaf2; }
.check-row.attention .check-dot { background:#d99b2b; box-shadow:0 0 0 4px rgba(217,155,43,.11); }
.closed-summary { padding:15px; border:1px solid #cfe4da; border-radius:12px; background:#f5fbf8; margin-bottom:12px; }
.closed-summary strong,.closed-summary span { display:block; }
.closed-summary span { color:var(--muted); font-size:11px; margin-top:3px; }
.closed-summary p { margin:10px 0 0; font-size:12px; }
.compact-close-form { margin-top:10px; }
.control-table-section { margin-top:18px; }
.inline-resolution-form { display:flex; min-width:300px; gap:7px; }
.inline-resolution-form input { min-width:180px; }

.exception-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.exception-kpi { border:1px solid var(--line); border-radius:14px; background:#fff; padding:14px 16px; }
.exception-kpi span { display:block; color:var(--muted); font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.exception-kpi strong { display:block; margin-top:4px; font:800 22px/1 "Inter",sans-serif; }
.exception-kpi.attention { border-color:#eedbbb; background:#fffaf1; }
.exception-kpi.attention strong { color:#a06a1c; }
.exception-kpi.ok { border-color:#cce5da; background:#f7fbf9; }
.exception-kpi.ok strong { color:var(--accent); }

.exception-workbench { margin-bottom:18px; padding:22px !important; border-color:#bfded1; box-shadow:0 14px 36px rgba(20,67,50,.08); }
.workbench-grid { display:grid; grid-template-columns:minmax(250px,.42fr) minmax(0,1fr); gap:18px; }
.source-card { border:1px solid var(--line); border-radius:14px; padding:15px; background:#fff; }
.source-card.focus-source { background:linear-gradient(145deg,#f6fbf8,#fff); border-color:#cbe4d9; }
.source-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.source-card-top span { font-size:10px; color:var(--muted); text-transform:uppercase; font-weight:900; letter-spacing:.06em; }
.source-card-top b { font-size:11px; color:var(--accent); }
.source-card > strong { display:block; margin:14px 0 8px; font:800 26px/1 "Inter",sans-serif; }
.source-card p { margin:0 0 8px; font-size:12px; line-height:1.45; }
.source-card small { color:var(--muted); }
.workbench-reason { margin-top:10px; padding:12px 14px; border-radius:12px; background:var(--soft); }
.workbench-reason span { font-size:9px; font-weight:900; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; }
.workbench-reason p { margin:4px 0 0; font-size:11px; }
.candidate-form { border:1px solid var(--line); border-radius:14px; padding:14px; }
.candidate-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px; }
.candidate-head strong,.candidate-head span { display:block; }
.candidate-head strong { font-size:13px; }
.candidate-head div > span { color:var(--muted); font-size:10px; margin-top:2px; }
.candidate-list { max-height:390px; overflow:auto; display:grid; gap:7px; padding-right:3px; }
.candidate-row { display:grid; grid-template-columns:18px minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px; border:1px solid var(--line); border-radius:11px; background:#fbfcfb; cursor:pointer; transition:.16s ease; }
.candidate-row:hover { border-color:#bcd8cc; background:#f6fbf8; }
.candidate-row:has(input:checked) { border-color:#9fcfbb; background:#eef8f3; box-shadow:inset 3px 0 0 var(--accent); }
.candidate-row input { width:auto; accent-color:var(--accent); }
.candidate-main strong,.candidate-main span,.candidate-main small,.candidate-value strong,.candidate-value small { display:block; }
.candidate-main strong { font-size:11px; }
.candidate-main span { font-size:11px; margin-top:2px; }
.candidate-main small { margin-top:2px; color:var(--muted); }
.candidate-value { text-align:right; }
.candidate-value strong { font-size:12px; }
.candidate-value small { margin-top:3px; color:var(--muted); white-space:nowrap; }
.manual-ids-row { display:grid; grid-template-columns:.65fr 1fr; gap:8px; margin:10px 0; }
.manual-ids-row label { display:flex; flex-direction:column; gap:4px; }
.manual-ids-row label span { font-size:9px; font-weight:900; text-transform:uppercase; color:var(--muted); }
.justify-form { margin-top:10px; display:grid; grid-template-columns:minmax(180px,1fr) 160px minmax(220px,1.2fr) auto; gap:8px; align-items:center; padding:12px; border-radius:12px; background:#faf8f4; border:1px solid #eadfca; }
.justify-form > div strong,.justify-form > div span { display:block; }
.justify-form > div strong { font-size:12px; }
.justify-form > div span { font-size:10px; color:var(--muted); margin-top:2px; }
.exception-table-section,.resolved-table-section { margin-top:16px; }
.table-link { color:var(--accent); font-weight:900; }

.matching-settings-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.matching-settings-form label { display:flex; flex-direction:column; gap:5px; }
.matching-settings-form label > span { font-size:10px; color:var(--muted); font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
.input-suffix { display:flex; align-items:center; border:1px solid #cfd7d2; border-radius:9px; background:#fff; overflow:hidden; }
.input-suffix input { border:0; border-radius:0; }
.input-suffix b { padding:0 10px; color:var(--muted); font-size:10px; }
.span-settings { grid-column:span 2; }
.config-grid { margin-top:18px; }
.profile-list { display:grid; gap:7px; max-height:330px; overflow:auto; }
.profile-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 11px; border-radius:10px; border:1px solid var(--line); background:#fbfcfb; }
.profile-row strong,.profile-row span { display:block; }
.profile-row strong { font-size:11px; }
.profile-row span { color:var(--muted); font-size:10px; margin-top:2px; }
.profile-row b { font-size:10px; color:var(--accent); white-space:nowrap; }

.special-review-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:14px 16px 0; }
.special-review-header strong,.special-review-header span { display:block; }
.special-review-header strong { font-size:13px; }
.special-review-header span { color:var(--muted); font-size:10px; margin-top:3px; }
.special-review-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:14px 16px 16px; }
.special-review-card { border:1px solid var(--line); border-radius:14px; padding:14px; background:#fff; }
.special-review-card.is-reviewed { border-color:#c8e1d6; background:#f8fcfa; }
.special-review-top { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.special-review-top > span:first-child { color:var(--muted); font-size:9px; text-transform:uppercase; font-weight:900; letter-spacing:.08em; }
.special-review-card h3 { margin:8px 0 12px; font:800 15px/1.2 "Inter",sans-serif; }
.special-values { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.special-values > div { padding:9px; border-radius:10px; background:var(--soft); }
.special-values span,.special-values strong,.special-values small { display:block; }
.special-values span { color:var(--muted); font-size:9px; text-transform:uppercase; font-weight:900; }
.special-values strong { margin-top:3px; font-size:13px; }
.special-values small { color:var(--muted); font-size:9px; margin-top:2px; }
.special-difference { display:flex; align-items:baseline; gap:8px; margin:10px 0; }
.special-difference span { color:var(--muted); font-size:10px; }
.special-difference strong { font-size:13px; }
.special-difference small { margin-left:auto; color:var(--muted); }
.special-review-form { display:grid; grid-template-columns:150px minmax(0,1fr) auto; gap:7px; }
.special-review-note { margin:8px 0 0; color:var(--muted); font-size:11px; }
.undo-match-form { margin-top:7px; }
.undo-match-form button { border:0; background:transparent; color:#a65a3d; font-size:9px; font-weight:900; cursor:pointer; }

@media (max-width: 1050px) {
    .control-grid,.workbench-grid { grid-template-columns:1fr; }
    .special-review-grid { grid-template-columns:1fr; }
    .justify-form { grid-template-columns:1fr 1fr; }
    .justify-form > div { grid-column:span 2; }
}

@media (max-width: 720px) {
    .control-mini-grid,.exception-kpis,.matching-settings-form { grid-template-columns:1fr 1fr; }
    .closure-hero { align-items:flex-start; flex-direction:column; }
    .closure-state { width:100%; min-width:0; }
    .candidate-row { grid-template-columns:18px 1fr; }
    .candidate-value { grid-column:2; text-align:left; }
    .manual-ids-row,.justify-form,.special-review-form { grid-template-columns:1fr; }
    .justify-form > div,.span-settings { grid-column:auto; }
    .inline-resolution-form { min-width:0; flex-direction:column; }
}

@media (max-width: 480px) {
    .control-mini-grid,.exception-kpis,.matching-settings-form,.special-values { grid-template-columns:1fr; }
}

/* Avance compacto del proceso */
.process-progress {
    margin: 2px 0 14px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(180deg, #fff, #fbfdfc);
}
.process-progress-copy,
.process-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.process-progress-copy span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .055em;
}
.process-progress-copy strong { font: 800 14px/1 "Inter", sans-serif; color: var(--accent); }
.process-progress-track {
    height: 7px;
    margin: 9px 0 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eeeb;
}
.process-progress-track span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #28a276);
    transition: width .45s ease;
}
.process-progress-meta { color: var(--muted); font-size: 10px; }
.inline-resolution-form select { min-width: 145px; }

/* Diagnóstico técnico, oculto por defecto para mantener la configuración limpia */
.system-health { margin-top: 18px; padding: 0 !important; overflow: hidden; }
.system-health summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 900;
}
.system-health summary::-webkit-details-marker { display: none; }
.system-health summary small { color: var(--muted); font-weight: 700; }
.system-health[open] summary { border-bottom: 1px solid var(--line); }
.system-health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 15px 18px; }
.system-health-item { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.system-health-item span, .system-health-item small { display: block; }
.system-health-item span { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.system-health-item strong { display: block; margin: 5px 0 2px; font-size: 12px; }
.system-health-item.ok strong { color: var(--accent); }
.system-health-item.attention strong { color: var(--warning); }
.system-health-item small { color: var(--muted); font-size: 9px; }
.system-health-note { margin: 0; padding: 0 18px 16px; color: var(--muted); font-size: 11px; }
@media (max-width: 900px) { .system-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .system-health-grid { grid-template-columns: 1fr; } }

/* V5 · conciliación multi-fuente */
.field-tag { display:inline-flex; align-items:center; margin-left:7px; padding:3px 7px; border-radius:999px; font-style:normal; font-size:9px; font-weight:900; letter-spacing:.06em; text-transform:uppercase; color:var(--accent); background:var(--accent-soft); }
.field-tag.neutral-tag { color:var(--muted); background:var(--soft); }
.source-upload-card { position:relative; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.source-upload-card:hover { transform:translateY(-2px); border-color:#aebdb5; box-shadow:0 10px 26px rgba(19,35,28,.055); }
.source-upload-card.primary-source-card { border-color:#b9d5c8; background:linear-gradient(180deg,#fbfefc,#f5faf7); }
.source-role-field small { margin-top:2px; line-height:1.45; }
.file-indicator.is-primary-source { box-shadow:inset 0 0 0 1px rgba(23,92,69,.18); }

.source-comparison-panel { margin-bottom:18px; }
.source-comparison-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:14px; }
.source-comparison-card { border:1px solid var(--line); border-radius:16px; padding:18px; background:#fff; min-width:0; transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.source-comparison-card:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(19,35,28,.06); }
.source-comparison-card.is-primary { border-color:#bcd7ca; background:linear-gradient(145deg,#fff,#f6fbf8); }
.source-comparison-card.is-control { background:linear-gradient(145deg,#fff,#fafbfa); }
.source-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.source-card-top h3 { margin:7px 0 0; font:750 17px/1.15 "Inter",sans-serif; letter-spacing:-.02em; }
.source-card-top > strong { font:800 26px/1 "Inter",sans-serif; letter-spacing:-.04em; }
.source-role-badge { display:inline-flex; padding:4px 7px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.07em; }
.is-control .source-role-badge { background:var(--soft); color:var(--muted); }
.source-card-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:17px 0 14px; }
.source-card-metrics span { display:flex; flex-direction:column; gap:3px; min-width:0; color:var(--muted); font-size:10px; line-height:1.25; }
.source-card-metrics b { color:var(--ink); font:800 15px/1 "Inter",sans-serif; }
.source-card-footer { display:flex; justify-content:space-between; gap:12px; align-items:end; padding-top:13px; border-top:1px solid var(--line); }
.source-card-footer span { color:var(--muted); font-size:11px; }
.source-card-footer strong { font:800 17px/1 "Inter",sans-serif; }
.source-inline-label { display:inline-flex; margin-bottom:4px; padding:3px 6px; border-radius:6px; background:var(--accent-soft); color:var(--accent); font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }

.statistics-source-overview { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; margin:0 0 18px; }
.statistics-source-card { padding:18px; border:1px solid var(--line); border-radius:16px; background:#fff; display:grid; gap:9px; }
.statistics-source-card.is-primary { border-color:#b9d5c8; background:linear-gradient(150deg,#fff,#f5faf7); }
.statistics-source-card > div:first-child { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.statistics-source-card span { color:var(--muted); font-size:9px; font-weight:900; letter-spacing:.08em; }
.statistics-source-card h3 { margin:3px 0 0; font:750 16px/1.15 "Inter",sans-serif; }
.statistics-source-card > strong { font:850 30px/1 "Inter",sans-serif; letter-spacing:-.04em; }
.statistics-source-card > small { font-size:11px; color:var(--muted); }
.statistics-source-bar { height:6px; border-radius:999px; background:var(--soft); overflow:hidden; }
.statistics-source-bar i { display:block; height:100%; border-radius:inherit; background:var(--accent); }
.statistics-source-card footer { display:flex; justify-content:space-between; gap:12px; padding-top:9px; border-top:1px solid var(--line); font-size:11px; }
.statistics-source-card footer b { color:var(--ink); }

.period-boundary-badge { display:inline-flex; margin-top:6px; padding:4px 7px; border-radius:999px; background:#fff4d8; color:#7a5716; font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.05em; }
.period-boundary-note { margin-top:10px; padding:10px 12px; border-radius:10px; background:#fff8e8; border:1px solid #f0dfae; }
.period-boundary-note strong,.period-boundary-note small { display:block; }
.period-boundary-note strong { font-size:11px; color:#745218; }
.period-boundary-note small { margin-top:4px; color:#816b41; line-height:1.4; }

@media (max-width:720px) {
    .source-card-metrics { grid-template-columns:1fr; }
    .source-card-top > strong { font-size:22px; }
    .statistics-source-overview { grid-template-columns:1fr; }
}

/* ===== V5 · conciliación multifuente ===== */
.source-control-checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 12px !important;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfcfb;
}
.source-control-checkbox input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.source-control-checkbox > span { display: grid; gap: 4px; }
.source-control-checkbox strong { font-size: 12px; }
.source-control-checkbox small { font-size: 11px; line-height: 1.45; }

.auxiliary-control-section { margin: 18px 0; }
.auxiliary-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.auxiliary-control-card { border: 1px solid var(--line); border-radius: 14px; padding: 17px; background: #fbfcfb; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.auxiliary-control-card:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(19,35,28,.05); }
.auxiliary-control-card.is-reviewed { border-color: #c9ddd3; background: #f7fbf9; }
.auxiliary-control-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.auxiliary-control-head span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .09em; }
.auxiliary-control-head h3 { margin: 4px 0 0; font: 750 15px/1.2 "Inter", sans-serif; }
.auxiliary-control-head > strong { font: 800 24px/1 "Inter", sans-serif; color: var(--accent); }
.auxiliary-control-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.auxiliary-control-metrics span { padding: 9px 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.auxiliary-control-metrics b { display: block; margin-top: 3px; color: var(--ink); font-size: 12px; }
.auxiliary-control-form { display: flex; gap: 8px; }
.auxiliary-control-form input { min-width: 0; }
.auxiliary-control-review { border-radius: 9px; padding: 10px 12px; background: var(--accent-soft); }
.auxiliary-control-review strong { color: var(--accent); font-size: 11px; }
.auxiliary-control-review p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

@media (max-width: 720px) {
    .auxiliary-control-grid { grid-template-columns: 1fr; }
    .auxiliary-control-metrics { grid-template-columns: 1fr; }
    .auxiliary-control-form { flex-direction: column; }
}

/* ===== V5.1 · creación y procesamiento estable ===== */
.reconciliation-create-panel { max-width: 1160px; padding: 0 !important; overflow: hidden; }
.create-panel-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:24px 26px 20px; border-bottom:1px solid var(--line); background:linear-gradient(135deg,#fff 0%,#fbfdfc 55%,#f3faf6 100%); }
.create-panel-header h2 { margin:5px 0 5px; font:800 22px/1.15 "Inter",sans-serif; letter-spacing:-.035em; }
.create-panel-header p { margin:0; color:var(--muted); font-size:11px; }
.create-kicker { color:var(--accent); font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.12em; }
.reconciliation-create-form { padding:22px 26px 24px; gap:16px; }
.create-section { padding:17px; border:1px solid var(--line); border-radius:15px; background:#fff; }
.create-section-title { display:flex; align-items:center; gap:10px; margin-bottom:15px; }
.create-section-title.compact { margin-bottom:12px; }
.create-section-number { width:28px; height:28px; border-radius:9px; display:grid; place-items:center; flex:0 0 auto; background:var(--accent-soft); color:var(--accent); font:900 9px/1 "Inter",sans-serif; }
.create-section-title strong,.create-section-title small { display:block; }
.create-section-title strong { font:800 12px/1.15 "Inter",sans-serif; }
.create-section-title small { margin-top:3px; color:var(--muted); font-size:9px; }
.create-base-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.create-base-grid label { display:flex; flex-direction:column; gap:6px; }
.create-sources-section { background:linear-gradient(180deg,#fff,#fbfcfb); }
.source-flow-grid { position:relative; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.source-flow-grid::before { content:""; position:absolute; top:36px; left:17%; right:17%; height:1px; background:linear-gradient(90deg,transparent,#cfdad4 12%,#cfdad4 88%,transparent); z-index:0; }
.source-flow-grid .source-upload-card { z-index:1; min-height:166px; padding:15px; display:flex; flex-direction:column; gap:10px; border-style:solid; background:#fff; }
.source-flow-grid .source-upload-card:hover { transform:translateY(-3px); box-shadow:0 14px 30px rgba(19,35,28,.065); }
.bank-upload-card { border-color:#d7ded9 !important; }
.control-source-card { background:linear-gradient(180deg,#fff,#fafbfa) !important; }
.upload-card-heading { display:flex; align-items:center; gap:9px; min-height:34px; }
.upload-card-heading > div { min-width:0; flex:1; }
.upload-card-heading strong,.upload-card-heading small { display:block; }
.upload-card-heading strong { color:var(--ink); font:800 11px/1.1 "Inter",sans-serif; }
.upload-card-heading small { margin-top:3px; color:var(--muted); font-size:8px; }
.upload-card-index { width:31px; height:31px; display:grid; place-items:center; border-radius:10px; background:#f0f4f2; color:var(--ink); font:900 10px/1 "Inter",sans-serif; }
.primary-source-card .upload-card-index { background:var(--accent); color:#fff; }
.source-flow-grid input[type="file"] { min-height:44px; padding:5px; border-radius:10px; background:#fbfcfb; font-size:10px; }
.source-flow-grid input[type="file"]::file-selector-button { height:32px; margin-right:8px; padding:0 11px; border:0; border-radius:8px; background:#eef3f0; color:var(--ink); font-weight:900; font-size:9px; cursor:pointer; }
.primary-source-card input[type="file"]::file-selector-button { background:var(--accent-soft); color:var(--accent-dark); }
.source-flow-note { display:flex; align-items:center; gap:7px; margin-top:12px; padding:8px 10px; border-radius:9px; background:#f6f8f7; color:var(--muted); font-size:9px; }
.source-flow-note span,.create-submit-note span { width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px rgba(20,122,85,.08); }
.source-flow-note b { color:var(--accent); }
.create-options-section { background:#fbfcfb; }
.create-options-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,.9fr); gap:12px; align-items:stretch; }
.create-options-grid .source-role-field { display:flex; flex-direction:column; gap:6px; }
.create-options-grid .source-control-checkbox { margin:0; min-height:100%; align-items:center; background:#fff; }
.create-notes-field { padding:0 2px; }
.create-notes-field > span small { margin-left:5px; color:var(--muted); font-weight:700; }
.create-actions { align-items:center; justify-content:space-between; padding-top:3px; }
.create-actions > div:last-child { display:flex; gap:8px; }
.create-submit-note { display:flex; align-items:center; gap:9px; max-width:540px; }
.create-submit-note small { color:var(--muted); font-size:9px; line-height:1.4; }

.processing-workspace { max-width:980px; margin:0 auto; padding:0 !important; overflow:hidden; }
.processing-hero { display:grid; grid-template-columns:82px minmax(0,1fr) auto; gap:18px; align-items:center; padding:26px; background:linear-gradient(135deg,#fff,#f5faf7); border-bottom:1px solid var(--line); }
.processing-copy h2 { margin:4px 0 6px; font:800 23px/1.1 "Inter",sans-serif; letter-spacing:-.035em; }
.processing-copy p { margin:0; max-width:650px; color:var(--muted); font-size:11px; line-height:1.5; }
.processing-status { align-self:start; padding:6px 9px; border-radius:999px; background:#eef2f0; color:var(--muted); font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.07em; }
.processing-workspace.is-running .processing-status { background:var(--accent-soft); color:var(--accent); }
.processing-workspace.is-error .processing-status { background:#fff0f0; color:var(--danger); }
.processing-orbit { position:relative; width:70px; height:70px; border-radius:22px; background:#fff; border:1px solid #d7e5de; box-shadow:0 10px 26px rgba(19,35,28,.06); }
.processing-orbit i { position:absolute; width:8px; height:8px; border-radius:50%; background:#b7c9bf; }
.processing-orbit i:nth-child(1){left:14px;top:15px}.processing-orbit i:nth-child(2){right:13px;top:27px}.processing-orbit i:nth-child(3){left:22px;bottom:12px}
.processing-orbit b { position:absolute; left:50%; top:50%; width:20px; height:20px; margin:-10px; border-radius:7px; background:var(--accent); }
.processing-workspace.is-running .processing-orbit { animation:processingPulse 1.8s ease-in-out infinite; }
.processing-workspace.is-running .processing-orbit i { animation:processingDot 1.25s ease-in-out infinite alternate; }
.processing-workspace.is-running .processing-orbit i:nth-child(2){animation-delay:.2s}.processing-workspace.is-running .processing-orbit i:nth-child(3){animation-delay:.4s}
@keyframes processingPulse { 50% { box-shadow:0 14px 34px rgba(20,122,85,.15); transform:translateY(-2px); } }
@keyframes processingDot { to { background:var(--accent); transform:scale(1.25); } }
.processing-source-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:18px 26px 12px; }
.processing-source-row article { min-width:0; padding:12px; border:1px solid var(--line); border-radius:11px; background:#fbfcfb; }
.processing-source-row article.is-primary { border-color:#bed8cb; background:#f6fbf8; }
.processing-source-row span,.processing-source-row strong,.processing-source-row small { display:block; }
.processing-source-row span { color:var(--muted); font-size:8px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.processing-source-row strong { margin:5px 0 4px; font-size:11px; }
.processing-source-row small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:8px; }
.processing-progress { height:7px; margin:10px 26px 0; border-radius:999px; overflow:hidden; background:#eef2f0; }
.processing-progress i { display:block; width:4%; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--accent),#4ca27f); transition:width .8s ease; }
.processing-live { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:16px 26px; }
.processing-live strong,.processing-live small { display:block; }
.processing-live strong { font-size:12px; }
.processing-live small { margin-top:4px; color:var(--muted); font-size:10px; }
.processing-live > span { font:800 13px/1 "Inter",sans-serif; color:var(--muted); }
.processing-actions { display:flex; justify-content:flex-end; gap:8px; padding:0 26px 24px; }
.processing-error { margin:0 26px 24px; padding:12px 14px; border:1px solid #efcaca; border-radius:10px; background:#fff5f5; color:var(--danger); font-size:10px; line-height:1.5; }

@media (max-width:900px) {
    .source-flow-grid,.processing-source-row { grid-template-columns:1fr; }
    .source-flow-grid::before { display:none; }
    .create-options-grid,.create-base-grid { grid-template-columns:1fr; }
    .processing-hero { grid-template-columns:64px 1fr; }
    .processing-status { grid-column:2; justify-self:start; }
}
@media (max-width:620px) {
    .create-panel-header,.reconciliation-create-form,.processing-hero { padding-left:16px; padding-right:16px; }
    .create-panel-header { flex-direction:column; }
    .processing-source-row { padding-left:16px; padding-right:16px; }
    .processing-progress { margin-left:16px; margin-right:16px; }
    .processing-live { padding-left:16px; padding-right:16px; align-items:flex-start; }
    .processing-actions { padding-left:16px; padding-right:16px; flex-direction:column-reverse; }
    .processing-actions .button { width:100%; }
    .create-actions { flex-direction:column; align-items:stretch; }
    .create-actions > div:last-child { width:100%; }
    .create-actions .button { flex:1; }
}

/* V5.2 · Reporte de movimientos bancarios */
.report-tabs {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 5px 20px rgba(24,45,36,.035);
}
.report-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    transition: .18s ease;
}
.report-tabs a:hover { color: var(--ink); background: var(--soft); }
.report-tabs a.is-active { color: #fff; background: var(--accent); box-shadow: 0 7px 16px rgba(18,107,79,.14); }
.report-tabs a span { min-width: 24px; padding: 3px 6px; border-radius: 999px; background: rgba(0,0,0,.055); text-align: center; font-size: 10px; }
.report-tabs a.is-active span { background: rgba(255,255,255,.16); }
.bank-flow-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 16px;
    padding: 24px 26px !important;
    background: linear-gradient(120deg, #fff 0%, #fbfdfc 66%, #edf7f2 100%);
}
.bank-flow-hero h2 { margin: 6px 0 5px; font: 760 22px/1.2 "Inter", sans-serif; letter-spacing: -.025em; }
.bank-flow-hero p { margin: 0; max-width: 680px; color: var(--muted); font-size: 12px; }
.bank-flow-total { min-width: 245px; padding-left: 24px; border-left: 1px solid var(--line); text-align: right; }
.bank-flow-total span, .bank-flow-total small { display: block; color: var(--muted); }
.bank-flow-total span { margin-bottom: 6px; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.bank-flow-total strong { display: block; font: 800 27px/1.1 "Inter", sans-serif; letter-spacing: -.04em; }
.bank-flow-total small { margin-top: 5px; font-size: 10px; }
.bank-flow-panel { margin-bottom: 18px; }
.bank-flow-table-head { align-items: end; }
.table-search { width: min(330px, 100%); display: grid; gap: 5px; }
.table-search span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.table-search input { min-height: 38px; padding: 8px 11px; }
.account-warning { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 11px 14px; border: 1px solid #f0dcae; border-radius: 10px; background: #fff9eb; color: #6d5119; font-size: 11px; }
.account-warning strong { white-space: nowrap; }
.account-warning span { color: #846629; }
@media (max-width: 760px) {
    .report-tabs { width: 100%; overflow-x: auto; }
    .report-tabs a { flex: 0 0 auto; }
    .bank-flow-hero { align-items: flex-start; flex-direction: column; }
    .bank-flow-total { width: 100%; min-width: 0; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); text-align: left; }
    .bank-flow-table-head { align-items: stretch; flex-direction: column; }
    .table-search { width: 100%; }
    .account-warning { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* V5.3 · Accesos y roles */
.auth-page {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 15% 15%, rgba(20,122,85,.10), transparent 32%),
        linear-gradient(145deg, #f4f6f5 0%, #eef3f0 100%);
}
.auth-shell { width: min(430px, 100%); }
.auth-card {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 24px 70px rgba(28,42,35,.10);
}
.auth-brand { display:flex; align-items:center; gap:12px; margin-bottom:30px; }
.auth-brand > span {
    width:44px; height:44px; display:grid; place-items:center; border-radius:13px;
    color:#fff; background:var(--accent); font:800 12px/1 "Inter",sans-serif;
}
.auth-brand strong,.auth-brand small { display:block; }
.auth-brand strong { font:750 15px/1.15 "Inter",sans-serif; }
.auth-brand small { margin-top:3px; color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.11em; }
.auth-copy h1 { margin:7px 0 7px; font:800 28px/1.15 "Inter",sans-serif; letter-spacing:-.04em; }
.auth-copy p { margin:0 0 22px; color:var(--muted); font-size:13px; }
.auth-form { display:grid; gap:15px; }
.auth-form label,.user-form label { display:grid; gap:6px; }
.auth-form label > span,.user-form label > span { font-size:11px; font-weight:850; color:#536159; }
.auth-form input { min-height:46px; }
.auth-form .button { min-height:46px; margin-top:3px; }
.auth-error { margin:0 0 18px; }

.users-layout { display:grid; grid-template-columns:minmax(270px, 350px) minmax(0,1fr); gap:18px; align-items:start; }
.user-create-panel { position:sticky; top:84px; }
.user-form small { color:var(--muted); font-size:10px; line-height:1.35; }
.users-table-panel code { font-size:11px; }
.topbar-user-copy { text-align:right; line-height:1.15; }
.topbar-user-copy strong { display:block; max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.topbar-user-copy span { display:block; margin-top:3px; color:var(--muted); font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; }
.logout-form { margin:0; }

@media (max-width: 980px) {
    .users-layout { grid-template-columns:1fr; }
    .user-create-panel { position:static; }
    .topbar-user-copy { display:none; }
}
@media (max-width: 620px) {
    .auth-page { padding:16px; }
    .auth-card { padding:24px 20px; }
    .logout-form .button { padding-left:9px; padding-right:9px; }
}
