:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #182230;
    --muted: #667085;
    --line: #e5eaf2;
    --primary: #1769e0;
    --primary-dark: #0e4fae;
    --success: #129a67;
    --warning: #f79009;
    --danger: #d92d20;
    --purple: #7a5af8;
    --sidebar: #121a2b;
    --sidebar-2: #0c1322;
    --sidebar-width: 250px;
    --shadow: 0 10px 28px rgba(17, 24, 39, .06);
    --radius: 14px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

button, input, select { font: inherit; }

.app-layout { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: var(--sidebar-width);
    padding: 24px 18px;
    color: #d9e1ef;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, #1a73e8, #6558e8);
    color: #fff;
    font-weight: 900;
}

.sidebar-brand strong,
.sidebar-footer strong { display: block; color: #fff; }

.sidebar-brand span,
.sidebar-footer span {
    display: block;
    margin-top: 3px;
    color: #98a2b3;
    font-size: 12px;
}

.menu-title {
    padding: 24px 10px 10px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 10px;
    color: #d0d5dd;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
}

.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(24,105,224,.95), rgba(103,86,232,.90));
}

.nav-icon { opacity: .85; }

.sidebar-footer {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.shell {
    width: min(1480px, calc(100% - 42px));
    margin: 0 auto;
    padding: 20px 0 42px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.topbar-spacer { flex: 1; }

.updated {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.actions { display: flex; gap: 8px; }

.btn {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 13px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}

.btn:hover { border-color: #cdd5df; }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.hero { padding: 12px 0 18px; }

.hero h1 {
    margin: 0;
    font-size: clamp(26px, 3.5vw, 38px);
    line-height: 1.15;
}

.hero p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

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

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 118px;
    padding: 17px;
}

.kpi-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    line-height: 1;
    background: #eef4ff;
    color: var(--primary);
}

.kpi-icon svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kpi-icon.good { background: #ecfdf3; color: var(--success); }
.kpi-icon.bad { background: #fef3f2; color: var(--danger); }
.kpi-icon.neutral { background: #f2f4f7; color: #667085; }
.kpi-icon.purple { background: #f4f3ff; color: var(--purple); }
.kpi-icon.orange { background: #fff6ed; color: var(--warning); }

.kpi-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.kpi-value {
    margin-top: 6px;
    font-size: clamp(21px, 2.3vw, 28px);
    font-weight: 900;
    line-height: 1.1;
}

.kpi-value.good, .good { color: var(--success); }
.kpi-value.bad, .bad { color: var(--danger); }
.warn { color: var(--warning); }
.neutral { color: #667085; }

.kpi-note {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

/* La cuadrícula se adapta al número de tarjetas: 4 ocupan una fila en escritorio;
   si existen 3, se expanden automáticamente para utilizar todo el ancho. */

.credit-card-summary { padding: 17px; }

.credit-card-head,
.credit-card-metrics,
.credit-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bank-name { font-size: 13px; font-weight: 850; }

.card-number {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.cutoff-pill {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 10px;
    font-weight: 750;
}

.credit-card-metrics {
    margin-top: 17px;
    align-items: end;
}

.credit-card-metrics span {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.credit-card-metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
}

.align-right { text-align: right; }

.utilization-track {
    height: 6px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f7;
}

.utilization-fill {
    height: 100%;
    border-radius: inherit;
}

.utilization-fill.good { background: var(--success); }
.utilization-fill.warn { background: var(--warning); }
.utilization-fill.bad { background: var(--danger); }
.utilization-fill.neutral { background: #98a2b3; }

.credit-card-foot {
    margin-top: 10px;
    color: var(--muted);
    font-size: 10px;
}

.status-ok { color: var(--success); font-weight: 750; }

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.6fr auto;
    gap: 10px;
    align-items: end;
    padding: 13px;
    margin-bottom: 12px;
}

.filter-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.filter-field select,
.filter-field input {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
}

.filter-action .btn { min-height: 36px; white-space: nowrap; }

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
    gap: 12px;
    margin-bottom: 12px;
}

.panel { padding: 17px; }

.panel-head h2,
.insight-title h2,
.table-toolbar h2 {
    margin: 0;
    font-size: 15px;
}

.panel-head p,
.insight-title p,
.table-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.chart-wrap {
    position: relative;
    height: 300px;
    margin-top: 12px;
}

.chart-wrap.medium { height: 250px; }

.rank-list {
    display: grid;
    gap: 13px;
    margin-top: 18px;
}

.rank-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.rank-number {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #eef4ff;
    color: var(--primary);
    font-size: 10px;
    font-weight: 850;
}

.rank-name { font-size: 11px; font-weight: 700; }

.rank-bar {
    height: 5px;
    margin-top: 5px;
    border-radius: 999px;
    background: #edf1f7;
    overflow: hidden;
}

.rank-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.rank-amount { font-size: 11px; font-weight: 800; }

.insight-card {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    align-items: center;
    padding: 18px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 68%);
}

.insight-title {
    display: flex;
    gap: 10px;
    align-items: center;
}

.insight-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eef4ff;
    color: var(--primary);
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.insight-item {
    display: flex;
    gap: 8px;
    min-height: 48px;
    padding: 6px 14px;
    border-left: 1px solid var(--line);
    color: #344054;
    font-size: 10px;
    line-height: 1.45;
}

.insight-number {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f2f4f7;
    color: #475467;
    font-weight: 850;
}

.table-card { overflow: hidden; }

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
}

#visibleCount {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
}

.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 9px 11px;
    border-bottom: 1px solid #eef2f6;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

td { font-size: 10px; }

tbody tr:hover { background: #f8fbff; }

.num { text-align: right; font-weight: 800; }

.product-pill,
.status-pill,
.category-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
}

.product-pill { background: #eef4ff; color: #175cd3; }
.category-pill { background: #f4f3ff; color: #6938ef; }
.status-pill { background: #f2f4f7; color: #475467; }
.status-pill.aprobada { background: #ecfdf3; color: #027a48; }
.status-pill.rechazada { background: #fef3f2; color: #b42318; }
.status-pill.pendiente { background: #fffaeb; color: #b54708; }

.empty {
    display: none;
    padding: 28px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
}

.pagination-info { color: var(--muted); font-size: 10px; }

.pagination-buttons { display: flex; gap: 4px; }

.page-btn {
    min-width: 30px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
}

.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .45; cursor: default; }

.footer {
    padding: 18px 0 4px;
    color: var(--muted);
    text-align: center;
    font-size: 10px;
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}

.card-empty { padding: 18px; color: var(--muted); }

@media (max-width: 1180px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards-grid { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }
    .insight-card { grid-template-columns: 1fr; }
    .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    body.menu-open .sidebar { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .analytics-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-action { grid-column: span 2; }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 24px, 1480px); }
    .topbar { flex-wrap: wrap; }
    .updated { order: 3; width: 100%; }
    .kpis, .cards-grid, .filters, .insight-grid { grid-template-columns: 1fr; }
    .filter-action { grid-column: auto; }
    .insight-item { border-left: 0; border-top: 1px solid var(--line); padding: 10px 0; }
}

@media print {
    .sidebar, .filters, .actions, .menu-toggle, #paginationControls { display: none !important; }
    .main-content { margin-left: 0; }
    .shell { width: 100%; padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}
/* ===== V2: Login + Mantenimientos ===== */
.logout-link{margin-top:9px;padding:0;border:0;background:none;color:#d0d5dd;font-size:11px;cursor:pointer;text-decoration:underline}.sidebar-footer strong{color:#fff}.sidebar-footer span{color:#98a2b3}
.maintenance-header{padding:12px 0 18px}.maintenance-header h1{margin:0;font-size:clamp(26px,3.5vw,38px);line-height:1.15}.maintenance-header>p:last-child{margin:7px 0 0;color:var(--muted);font-size:14px}.eyebrow{margin:0 0 5px!important;color:var(--primary)!important;font-size:10px!important;font-weight:850;letter-spacing:.1em;text-transform:uppercase}
.alert{margin-bottom:14px;padding:12px 14px;border-radius:10px;font-size:12px}.alert ul{margin:0;padding-left:18px}.alert-success{border:1px solid #abefc6;background:#ecfdf3;color:#027a48}.alert-error{border:1px solid #fecdca;background:#fef3f2;color:#b42318}
.maintenance-grid{display:grid;grid-template-columns:minmax(320px,.72fr) minmax(0,1.28fr);gap:14px}.cards-maintenance{grid-template-columns:minmax(390px,.8fr) minmax(0,1.2fr)}.form-card{padding:18px}.form-card h2{margin:0 0 16px;font-size:15px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.span-2{grid-column:span 2}.form-card label,.auth-card label{display:block;margin-bottom:5px;color:var(--muted);font-size:10px;font-weight:800}.form-card input,.form-card select,.auth-card input{width:100%;min-height:38px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text);font-size:12px}.checkbox-field{display:flex;align-items:end;padding-bottom:8px}.checkbox-field label{display:flex;align-items:center;gap:8px;margin:0;color:var(--text)}.checkbox-field input{width:auto;min-height:auto}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.maintenance-table{min-width:720px}.maintenance-table.wide{min-width:980px}.actions-cell{display:flex;gap:6px;align-items:center}.inline-form{display:inline}.btn-small{padding:6px 9px;font-size:10px}.btn-danger{color:#b42318;border-color:#fecdca;background:#fff}.status-pill.activo,.status-pill.activa{background:#ecfdf3;color:#027a48}.status-pill.inactivo,.status-pill.bloqueada{background:#fffaeb;color:#b54708}.status-pill.suspendido,.status-pill.eliminada{background:#fef3f2;color:#b42318}
.auth-body{display:grid;place-items:center;min-height:100vh;background:radial-gradient(circle at top right,rgba(23,92,211,.14),transparent 35rem),var(--bg)}.auth-shell{width:min(430px,calc(100% - 32px))}.auth-card{padding:28px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 22px 60px rgba(17,24,39,.10)}.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:24px}.auth-brand strong{display:block}.auth-brand span{display:block;margin-top:3px;color:var(--muted);font-size:11px}.auth-card h1{margin:0;font-size:26px}.auth-card>p{margin:7px 0 20px;color:var(--muted);font-size:12px}.auth-card form label{margin-top:12px}.btn-full{width:100%;margin-top:18px}
@media(max-width:1180px){.maintenance-grid,.cards-maintenance{grid-template-columns:1fr}}@media(max-width:620px){.form-grid{grid-template-columns:1fr}.span-2{grid-column:auto}}

/* ===== V4.5 ===== */
.kpis-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card-foot-stack { flex-wrap: wrap; row-gap: 6px; }
.processing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 8px;
}
.processing-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}
.processing-item span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.processing-item strong { display: block; margin-top: 5px; font-size: 22px; }
.process-procesada { color: var(--success); }
.process-pendiente { color: var(--warning); }
.process-revisar, .process-error { color: var(--danger); }
.chart-wrap.compact { height: 220px; }
.metric-feature {
    display: grid;
    place-items: center;
    min-height: 185px;
    text-align: center;
}
.metric-feature strong { font-size: clamp(30px, 4vw, 46px); color: var(--primary); }
.metric-feature span { color: var(--muted); font-size: 13px; }
.panel-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-review { padding: 28px; color: var(--success); font-weight: 700; }
.review-table { min-width: 1180px; }
.recurrent-pill {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f4f3ff;
    color: var(--purple);
    font-size: 10px;
    font-weight: 800;
}
.status-pill.revisar, .status-pill.error { background: #fef3f2; color: var(--danger); }
@media(max-width:1200px){ .kpis-five{grid-template-columns:repeat(3,minmax(0,1fr));} }
@media(max-width:760px){ .kpis-five{grid-template-columns:1fr;} .processing-grid{grid-template-columns:repeat(2,1fr);} }

/* V4.6 - Control de transacciones */
.kpis-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.control-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.control-kpi { padding:18px 20px; }
.control-kpi span { display:block; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.control-kpi strong { display:block; margin-top:7px; font-size:30px; line-height:1; }
.control-section { margin-bottom:18px; overflow:hidden; }
.control-explanation { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:0 20px 20px; }
.control-explanation span { padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface-soft); color:var(--muted); font-size:12px; line-height:1.45; }
.control-explanation strong { color:var(--text); }
.control-table { min-width:1120px; }
.control-table td { vertical-align:top; }
.muted-small { color:var(--muted); font-size:11px; }
.process-procesada { color:var(--success); }
.process-pendiente { color:var(--warning); }
.process-revisar,.process-error { color:var(--danger); }
.status-pill.revisar,.status-pill.error { background:#fef3f2; color:#b42318; }
@media(max-width:980px){ .kpis-four,.control-kpis,.control-explanation{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:640px){ .kpis-four,.control-kpis,.control-explanation{grid-template-columns:1fr;} }


/* V4.8 - revisión asistida de transacciones */
.process-review-link {
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.process-review-link:hover {
    filter: brightness(.97);
    box-shadow: 0 0 0 2px rgba(23,92,211,.08);
}
.review-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
    gap: 14px;
    align-items: start;
}
.review-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.review-context { padding: 18px; }
.review-context h2 { margin: 0 0 14px; font-size: 15px; }
.review-context dl { margin: 0; display: grid; gap: 12px; }
.review-context dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.review-context dd { margin: 3px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.review-message { margin-top: 14px; padding: 12px; border-radius: 10px; background: #fffaeb; color: #7a2e0e; font-size: 11px; line-height: 1.5; }
.readonly-field { background: #f8fafc !important; color: var(--muted) !important; }
@media(max-width:980px){ .review-editor-grid{grid-template-columns:1fr;} }
@media(max-width:640px){ .review-form .form-grid{grid-template-columns:1fr;} }

/* V4.9 — Administración de usuarios */
.user-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.user-summary-card { padding: 15px 17px; }
.user-summary-card span { display:block; color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.user-summary-card strong { display:block; margin-top:5px; font-size:24px; line-height:1.1; }
.users-maintenance { grid-template-columns:minmax(340px,.68fr) minmax(0,1.32fr); }
.users-table { min-width:940px; }
.users-table td:first-child strong { display:block; }
.users-table td:first-child small { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.role-pill { display:inline-flex; align-items:center; padding:5px 9px; border-radius:999px; font-size:10px; font-weight:850; letter-spacing:.02em; }
.role-pill.admin { background:#eef4ff; color:#175cd3; }
.role-pill.consulta { background:#f2f4f7; color:#475467; }
.self-badge { display:inline-flex; margin-left:6px; padding:3px 6px; border-radius:999px; background:#f4f3ff; color:#6941c6; font-size:9px; font-weight:800; vertical-align:middle; }
.form-help { margin:10px 0 0; color:var(--muted); font-size:10px; line-height:1.45; }
.btn-success { color:#027a48; border-color:#abefc6; background:#fff; }
.user-actions { flex-wrap:wrap; }
.status-pill.bloqueado { background:#fef3f2; color:#b42318; }
@media(max-width:1180px){.users-maintenance{grid-template-columns:1fr}}
@media(max-width:760px){.user-summary-grid{grid-template-columns:1fr}}

/* ==========================================================
   KPI PROXIMO CORTE - ALERTA CUANDO EL CORTE ES HOY
   ========================================================== */
.kpi-cutoff {
    position: relative;
    overflow: hidden;
}

.kpi-cutoff .cutoff-content {
    min-width: 0;
    flex: 1 1 auto;
}

.kpi-cutoff.is-today {
    min-height: 118px;
    border-color: #ff8c8c;
    box-shadow: 0 8px 24px rgba(217, 45, 32, .10);
}

.kpi-cutoff.is-today .cutoff-icon {
    position: relative;
    z-index: 1;
    width: 62px;
    height: 62px;
    color: #d92d20;
    background: #fff1f1;
}

.kpi-cutoff.is-today .cutoff-icon::before,
.kpi-cutoff.is-today .cutoff-icon::after {
    content: "";
    position: absolute;
    inset: -9px;
    border: 4px solid rgba(217, 45, 32, .08);
    border-radius: 50%;
    pointer-events: none;
    animation: cutoffRing 1.8s ease-out infinite;
}

.kpi-cutoff.is-today .cutoff-icon::after {
    inset: -18px;
    opacity: .65;
    animation-delay: .55s;
}

.kpi-cutoff.is-today .kpi-label {
    font-size: 9px;
    letter-spacing: .055em;
}

.cutoff-today-message {
    display: inline-block;
    max-width: 100%;
    margin-top: 6px;
    padding: 7px 11px;
    border-radius: 13px;
    background: #fdeaea;
    color: #c91c13;
    font-size: clamp(13px, 1.15vw, 17px);
    font-weight: 900;
    line-height: 1.05;
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(217, 45, 32, .03) inset;
    animation: cutoffBlink 1.1s ease-in-out infinite;
}

.cutoff-card-name {
    margin-top: 8px;
    font-size: 10px;
}

.cutoff-today-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff0f0;
    color: #d92d20;
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
}

.cutoff-alert-rays {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 26px;
    height: 24px;
    pointer-events: none;
}

.cutoff-alert-rays::before,
.cutoff-alert-rays::after {
    content: "";
    position: absolute;
    background: #d92d20;
    border-radius: 999px;
    transform-origin: center;
}

.cutoff-alert-rays::before {
    width: 3px;
    height: 13px;
    left: 3px;
    top: 0;
    transform: rotate(-4deg);
    box-shadow: 12px 8px 0 #d92d20;
}

.cutoff-alert-rays::after {
    width: 3px;
    height: 12px;
    left: 13px;
    top: 1px;
    transform: rotate(42deg);
}

@keyframes cutoffBlink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 rgba(217,45,32,0);
    }
    50% {
        opacity: .72;
        transform: scale(.985);
        box-shadow: 0 0 14px rgba(217,45,32,.16);
    }
}

@keyframes cutoffRing {
    0% { transform: scale(.86); opacity: .75; }
    70%, 100% { transform: scale(1.14); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cutoff-today-message,
    .kpi-cutoff.is-today .cutoff-icon::before,
    .kpi-cutoff.is-today .cutoff-icon::after {
        animation: none;
    }
}

@media (max-width: 1180px) {
    .cutoff-today-message {
        white-space: normal;
        font-size: 13px;
    }
}


/* V5 PATCH V3 - AJUSTE VISUAL EXACTO ALERTA CORTE HOY */
.kpi-cutoff.is-today {
    min-height: 118px;
    padding: 16px 18px;
    gap: 20px;
    border: 1.5px solid #ff7b7b;
    background: #fff;
    box-shadow:
        0 8px 24px rgba(217,45,32,.10),
        0 0 0 1px rgba(217,45,32,.02) inset;
}

.kpi-cutoff.is-today .cutoff-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    color: #d92d20 !important;
    background: #fff5f5 !important;
}

.kpi-cutoff.is-today .cutoff-icon svg {
    width: 33px;
    height: 33px;
    stroke-width: 2.35;
}

.kpi-cutoff.is-today .cutoff-content {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.kpi-cutoff.is-today .kpi-label {
    margin: 0;
    color: #667085;
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: .07em;
}

.kpi-cutoff.is-today .cutoff-today-message {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    margin-top: 7px;
    padding: 7px 12px;
    border-radius: 12px;
    background: #fdecec;
    color: #c91c13;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .01em;
    white-space: nowrap;
    box-shadow: none;
    animation: cutoffMessagePulse 1.15s ease-in-out infinite;
}

.kpi-cutoff.is-today .cutoff-card-name {
    margin-top: 8px;
    color: #667085;
    font-size: 10px;
    line-height: 1.15;
}

.kpi-cutoff.is-today .cutoff-today-badge {
    margin-top: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(217,45,32,.08);
    background: #fff0f0;
    color: #d92d20;
    font-size: 8.5px;
    font-weight: 850;
}

.kpi-cutoff.is-today .cutoff-icon::before,
.kpi-cutoff.is-today .cutoff-icon::after {
    border-width: 4px;
    border-color: rgba(217,45,32,.09);
}

.kpi-cutoff.is-today .cutoff-icon::before {
    inset: -10px;
}

.kpi-cutoff.is-today .cutoff-icon::after {
    inset: -19px;
}

.kpi-cutoff.is-today .cutoff-alert-rays {
    top: 15px;
    right: 17px;
}

@keyframes cutoffMessagePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        background: #fdecec;
    }
    50% {
        opacity: .72;
        transform: scale(.985);
        background: #ffdede;
    }
}

@media (max-width: 1180px) {
    .kpi-cutoff.is-today .cutoff-today-message {
        white-space: normal;
        font-size: 12px;
        line-height: 1.12;
    }
}


/* V4 - ajuste fino rayas esquina corte hoy */
.cutoff-alert-rays {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 24px;
    height: 22px;
    pointer-events: none;
}

.cutoff-alert-rays::before,
.cutoff-alert-rays::after {
    content: none !important;
}

.cutoff-alert-rays i {
    position: absolute;
    display: block;
    width: 3px;
    border-radius: 999px;
    background: #e4281b;
    transform-origin: center bottom;
}

.cutoff-alert-rays i:nth-child(1) {
    height: 15px;
    top: -1px;
    left: 3px;
    transform: rotate(-4deg);
}

.cutoff-alert-rays i:nth-child(2) {
    height: 12px;
    top: 2px;
    left: 11px;
    transform: rotate(22deg);
}

.cutoff-alert-rays i:nth-child(3) {
    height: 10px;
    top: 8px;
    left: 18px;
    transform: rotate(56deg);
}

.kpi-cutoff.is-today .cutoff-alert-rays {
    top: 14px;
    right: 16px;
}

/* Resaltar banco y últimos 4 en alerta de corte */
.kpi-cutoff.is-today .cutoff-card-name {
    font-weight: 800;
    color: #344054;
}
