:root {
    --bg: #020414;
    --bg-soft: #07091f;
    --panel: rgba(5, 8, 28, .86);
    --panel-strong: rgba(7, 10, 31, .96);
    --ink: #f7f7fb;
    --muted: #aaa8b8;
    --line: rgba(255, 255, 255, .10);
    --brand: #38bdf8;
    --brand-2: #7dd3fc;
    --brand-dark: #0369a1;
    --purple: #6c2bd9;
    --green: #22c55e;
    --danger: #ff3b4f;
    --blue: #3b82f6;
    --teal: #14b8a6;
    --yellow: #facc15;
    --radius: 12px;
    --shadow: 0 24px 70px rgba(0, 0, 0, .46);
    --glow: 0 0 22px rgba(56, 189, 248, .14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #020414 0%, #05071f 46%, #02030d 100%);
    color: var(--ink);
    font-family: Inter, Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.42) 1px, transparent 1.6px),
        radial-gradient(circle, rgba(255,255,255,.30) 1px, transparent 1.8px);
    background-position: 0 0, 24px 42px;
    background-size: 92px 92px, 138px 138px;
    opacity: .14;
}

a { color: inherit; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    background: rgba(3, 5, 20, .82);
    border-right: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    padding: 22px 16px;
    box-shadow: 18px 0 60px rgba(0, 0, 0, .34);
    backdrop-filter: blur(18px);
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    text-decoration: none;
    margin-bottom: 28px;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #03111f;
    background: linear-gradient(135deg, #7dd3fc, #22c55e);
    box-shadow: var(--glow);
}

nav { display: grid; gap: 8px; }

.nav-group { display: grid; gap: 8px; }

/* En escritorio se listan todas las secciones; el boton Mas solo existe en movil */
.nav-more { display: none; }

nav a .bi-sliders { color: #d3d9e6; background: rgba(148, 163, 184, .16); }

nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    color: #b8b6c7;
    background: rgba(255, 255, 255, .025);
}

nav a:hover,
nav a.is-active {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
}

nav a i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 11px;
    font-size: 18px;
}

nav a.is-active i {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .28);
}

/* Color distintivo por seccion (mismo icono en sidebar y barra inferior) */
nav a .bi-house-door { color: #8ab8ff; background: rgba(59, 130, 246, .20); }
nav a .bi-currency-dollar { color: #6ee7a0; background: rgba(34, 197, 94, .18); }
nav a .bi-people { color: #c8b6ff; background: rgba(139, 92, 246, .22); }
nav a .bi-calendar-check { color: #fde047; background: rgba(250, 204, 21, .15); }
nav a .bi-receipt { color: #67e8f9; background: rgba(20, 184, 166, .18); }
nav a .bi-wallet2 { color: #6ee7e0; background: rgba(20, 184, 166, .18); }
nav a .bi-file-earmark-text { color: #b4bcff; background: rgba(99, 102, 241, .22); }
nav a .bi-three-dots { color: #d3d9e6; background: rgba(148, 163, 184, .16); }

.main {
    position: relative;
    z-index: 1;
    margin-left: 244px;
    padding: 28px;
}

.topbar {
    position: sticky;
    top: 10px;
    z-index: 10;
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0 auto 18px;
    max-width: 1180px;
    background: rgba(3, 5, 20, .78);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    padding: 7px 14px 7px 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
}

.topbar-home {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 50%;
    font-size: 18px;
    text-decoration: none;
    color: #8ab8ff;
    background: rgba(59, 130, 246, .20);
}

.topbar-home:hover { color: #fff; }

.topbar-home.is-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .30);
    color: #fff;
}

.topbar-titles {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.topbar h1 {
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-date {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 34px; font-weight: 850; }
h2 { font-size: 18px; margin-bottom: 14px; font-weight: 800; }

.eyebrow {
    margin: 0 0 4px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: 12px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 999px;
    padding: 6px 12px;
}

.userbox strong { white-space: nowrap; font-size: 12.5px; }

.userbox span, small, .muted { color: var(--muted); }

.userbox span { white-space: nowrap; }

.userbox a {
    color: var(--brand-2);
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    font-weight: 700;
}

.notice, .alert {
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.notice {
    background: rgba(33, 201, 121, .12);
    border: 1px solid rgba(33, 201, 121, .32);
    color: #dfffee;
    padding: 12px 14px;
}

.notice-error {
    background: rgba(255, 77, 95, .12);
    border-color: rgba(255, 77, 95, .34);
    color: #ffdce0;
}

.transfer-fields {
    display: grid;
    gap: 12px;
    margin: 2px 0 4px;
    padding: 14px;
    border: 1px solid rgba(20, 184, 166, .30);
    border-radius: 14px;
    background: rgba(20, 184, 166, .06);
}

.transfer-account {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, .30);
    background: rgba(59, 130, 246, .10);
}

.transfer-account span {
    color: var(--muted);
    font-size: 12px;
}

.transfer-account strong {
    font-size: 15px;
    letter-spacing: .02em;
    overflow-wrap: anywhere;
}

.agent-transfer-account {
    border-color: rgba(34, 197, 94, .30);
    background: rgba(34, 197, 94, .09);
}

.transfer-fields input[name="referencia_sugerida"] {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .12em;
    text-align: center;
    color: #6ee7e0;
    background: rgba(20, 184, 166, .10);
    border-color: rgba(20, 184, 166, .35);
}

.payment-quota-card {
    --payment-accent: #f59e0b;
    --payment-soft: rgba(245, 158, 11, .12);
    --payment-line: rgba(251, 191, 36, .30);
    display: grid;
    gap: 12px;
    margin: 10px 0 14px;
    padding: 12px;
    border: 1px solid var(--payment-line);
    border-left: 5px solid var(--payment-accent);
    border-radius: 16px;
    background:
        linear-gradient(135deg, var(--payment-soft), rgba(8, 13, 31, .76) 52%),
        rgba(255, 255, 255, .035);
}

.payment-quota-card.is-paid {
    --payment-accent: #34d399;
    --payment-soft: rgba(16, 185, 129, .12);
    --payment-line: rgba(52, 211, 153, .32);
}

.payment-quota-card.is-late {
    --payment-accent: #fb7185;
    --payment-soft: rgba(244, 63, 94, .13);
    --payment-line: rgba(251, 113, 133, .36);
}

.payment-quota-card.is-partial {
    --payment-accent: #a855f7;
    --payment-soft: rgba(168, 85, 247, .14);
    --payment-line: rgba(192, 132, 252, .34);
}

.payment-quota-card.is-future {
    --payment-accent: #f59e0b;
    --payment-soft: rgba(245, 158, 11, .11);
    --payment-line: rgba(251, 191, 36, .30);
}

.payment-quota-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.payment-quota-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #080d1f;
    background: var(--payment-accent);
    font-size: 20px;
}

.payment-quota-head small,
.payment-quota-grid small {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-quota-head strong {
    display: block;
    color: var(--text);
    font-size: 18px;
}

.payment-quota-head em {
    justify-self: end;
    padding: 8px 10px;
    border-radius: 999px;
    color: #080d1f;
    background: var(--payment-accent);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.payment-quota-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.payment-quota-grid span {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
}

.payment-quota-grid strong {
    display: block;
    color: var(--text);
    overflow-wrap: anywhere;
}

.payment-quota-grid .highlight {
    background: rgba(255, 255, 255, .065);
    border-color: var(--payment-line);
}

.payment-quota-grid .highlight strong {
    color: #fcd34d;
    font-size: 17px;
}

.payment-quota-note {
    margin: -2px 0 0;
    padding: 9px 10px;
    border-radius: 12px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .055);
    font-size: 12px;
    line-height: 1.45;
}

.steps-help {
    margin: 0 0 12px;
    padding-left: 20px;
    display: grid;
    gap: 8px;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    min-height: 132px;
    max-width: 1180px;
    margin: 0 auto 18px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(7, 9, 31, .98), rgba(3, 5, 20, .90));
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    right: -96px;
    top: -112px;
    width: 260px;
    height: 260px;
    border: 2px solid rgba(124, 58, 237, .45);
    border-radius: 50%;
    box-shadow: 0 0 34px rgba(124, 58, 237, .22);
}

.dashboard-hero h2 {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 10px;
    color: #fff;
}

.dashboard-hero p {
    max-width: 560px;
    color: #d9d7e7;
    margin: 0;
    font-size: 17px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 12px;
    max-width: 1180px;
    margin: 0 auto 18px;
}

.metrics.compact { grid-template-columns: repeat(6, minmax(130px, 1fr)); }

.metric {
    min-height: 142px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 9px;
    padding: 16px 12px;
    text-align: center;
    background: rgba(4, 7, 26, .76);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 16px;
    box-shadow: none;
}

.metric i {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #fff;
    font-size: 25px;
    background: linear-gradient(145deg, var(--purple), #4c1db3);
}

.metric span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.15;
}

.metric strong {
    font-size: 25px;
    line-height: 1;
    color: #fff;
}

.metric.tone-gold i { background: linear-gradient(145deg, #38bdf8, #0f766e); }
.metric.tone-green i { background: linear-gradient(145deg, #22c55e, #087c3a); }
.metric.tone-purple i { background: linear-gradient(145deg, #7c3aed, #4c1d95); }
.metric.tone-danger i { background: linear-gradient(145deg, #ff5d6c, #b41127); }

.metric.tone-gold strong { color: #7dd3fc; }
.metric.tone-green strong { color: #34d36f; }
.metric.tone-purple strong { color: #b68cff; }
.metric.tone-danger strong { color: #ff6877; }

.loan-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}

.loan-preview article {
    display: grid;
    gap: 3px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
}

.loan-preview span,
.loan-preview small {
    color: var(--muted);
    font-size: 12px;
}

.loan-preview strong {
    color: #fff;
    font-size: 24px;
}

.loan-preview p {
    grid-column: 1 / -1;
    margin: 0;
    color: #d9d7e7;
}

.loan-ledger,
.loan-quote {
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 18px;
    padding: 16px;
    background: rgba(4, 7, 26, .72);
}

.loan-ledger {
    overflow-x: auto;
}

.quote-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.quote-page {
    padding: 24px;
    border-radius: 16px;
    color: #171421;
    background: linear-gradient(180deg, #ffffff, #f6fbff);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
}

.quote-page h2 {
    color: #171421;
    margin-bottom: 12px;
}

.quote-page p {
    color: #322c3d;
}

.quote-page .eyebrow {
    color: #0369a1;
}

.quote-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.quote-summary span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: 12px;
    color: #6b6178;
    background: rgba(56, 189, 248, .07);
}

.quote-summary strong {
    color: #171421;
    font-size: 18px;
}

.quote-page table {
    color: #171421;
    font-size: 13px;
}

.quote-page th,
.quote-page td {
    border-color: rgba(23, 20, 33, .14);
}

.grid {
    display: grid;
    gap: 16px;
    max-width: 1180px;
    margin-inline: auto;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel, .profile, .collection-hero, .legal-doc, .ticket {
    max-width: 1180px;
    margin-inline: auto;
    background: rgba(4, 7, 26, .78);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 22px 58px rgba(0, 0, 0, .30);
    backdrop-filter: blur(14px);
}

.panel-head, .actions, .action-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.actions,
.action-strip,
.form-progress,
.client-form {
    max-width: 1180px;
    margin-inline: auto;
}

.action-strip { justify-content: flex-start; flex-wrap: wrap; }

.search-actions {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
}

.search-actions .button {
    align-self: flex-start;
}

.button {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #7dd3fc, #22c55e);
    color: #03111f;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    box-shadow: var(--glow);
}

.button:hover {
    color: #03111f;
    filter: brightness(1.05);
}

.button.ghost {
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .18);
    color: var(--ink);
    box-shadow: none;
}

.button.subtle {
    color: #dbeafe;
    border: 1px solid rgba(125, 211, 252, .24);
    background: rgba(125, 211, 252, .08);
    box-shadow: none;
}

.button.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

/* Acciones de validacion: aprobar verde, rechazar rojo */
.row-actions button[value="aprobado"] {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    color: #04230f;
    box-shadow: none;
}

.row-actions button[value="rechazado"] {
    background: rgba(255, 77, 95, .10);
    border: 1px solid rgba(255, 77, 95, .38);
    color: #ff9ca7;
}

/* WhatsApp en verde */
.action-strip a[href*="wa.me"] {
    background: rgba(34, 197, 94, .10);
    border: 1px solid rgba(34, 197, 94, .38);
    color: #6ee7a0;
}

.collection-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 1180px;
    margin: 0 auto 16px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .08);
}

.action-pill {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 10px;
    min-height: 58px;
    padding: 10px 14px;
    border-radius: 14px;
    box-shadow: none;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
}

.action-pill i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 17px;
    background: rgba(255, 255, 255, .12);
}

.action-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-pay {
    color: #052014;
    background: linear-gradient(135deg, #86efac, #22c55e);
}

.action-doc {
    color: #dbeafe;
    border: 1px solid rgba(96, 165, 250, .28);
    background: rgba(59, 130, 246, .10);
}

.action-whatsapp {
    color: #b7f7c9;
    border: 1px solid rgba(34, 197, 94, .30);
    background: rgba(34, 197, 94, .10);
}

.action-map {
    color: #fde68a;
    border: 1px solid rgba(250, 204, 21, .30);
    background: rgba(250, 204, 21, .10);
}

.assignment-panel {
    border-color: rgba(125, 211, 252, .18);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, .10), rgba(20, 184, 166, .055)),
        rgba(4, 7, 26, .78);
}

.assignment-form {
    align-items: center;
}

.collection-client-info {
    min-width: 0;
}

.collection-client-info h2 {
    margin-bottom: 12px;
}

.client-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.client-info-grid span {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas:
        "icon label"
        "icon value";
    gap: 2px 10px;
    min-width: 0;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .035);
}

.client-info-grid span.wide {
    grid-column: 1 / -1;
}

.client-info-grid i {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: #7dd3fc;
    background: rgba(125, 211, 252, .10);
}

.client-info-grid strong {
    grid-area: label;
    color: #fff;
    font-size: 12px;
}

.client-info-grid em {
    grid-area: value;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    overflow-wrap: anywhere;
}

.client-profile-actions {
    display: grid;
    gap: 10px;
    min-width: 190px;
}

.client-profile-actions .action-pill {
    min-width: 190px;
}

.info-card-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.info-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    color: var(--ink);
    text-decoration: none;
}

.info-card > i {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    color: #7dd3fc;
    background: rgba(125, 211, 252, .10);
}

.info-card span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.info-card strong {
    color: #fff;
    font-size: 13px;
}

.info-card em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    overflow-wrap: anywhere;
}

.info-link:hover {
    color: #fff;
    border-color: rgba(125, 211, 252, .28);
    background: rgba(125, 211, 252, .07);
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 86px;
    margin-top: 8px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(5, 8, 28, .72);
    text-decoration: none;
}

.list-row:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .05);
}

.list-row span {
    display: grid;
    flex: 1;
}

.mini-avatar {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #7c3aed, #4c1d95);
    font-size: 17px;
    line-height: 1;
}

.mini-avatar.orange {
    background: linear-gradient(145deg, #38bdf8, #0f766e);
}

.mini-avatar.photo {
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .06);
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.client-cell span {
    display: grid;
}

.table-link,
.row-open-link {
    color: var(--ink);
    text-decoration: none;
}

.table-link.strong {
    font-weight: 800;
}

.table-link:hover,
.row-open-link:hover {
    color: #f6b955;
}

.loan-search {
    width: min(560px, 100%);
}

.loan-search input {
    min-height: 44px;
}

[data-loan-results],
[data-client-results] {
    transition: opacity .18s ease;
}

[data-loan-results].is-loading,
[data-client-results].is-loading {
    opacity: .55;
}

.loan-list {
    display: grid;
    gap: 12px;
}

.loan-card {
    --loan-accent: #38bdf8;
    --loan-soft: rgba(56, 189, 248, .10);
    --loan-line: rgba(56, 189, 248, .28);
    display: grid;
    grid-template-columns: minmax(240px, 1.55fr) repeat(3, minmax(112px, .72fr)) minmax(145px, .9fr) minmax(112px, .55fr);
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--loan-line);
    border-left: 5px solid var(--loan-accent);
    border-radius: 16px;
    background:
        linear-gradient(135deg, var(--loan-soft), rgba(9, 14, 32, .78) 48%),
        rgba(8, 12, 28, .86);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.loan-card.is-activo {
    --loan-accent: #38bdf8;
    --loan-soft: rgba(14, 165, 233, .12);
    --loan-line: rgba(56, 189, 248, .30);
}

.loan-card.is-atrasado {
    --loan-accent: #fb7185;
    --loan-soft: rgba(244, 63, 94, .13);
    --loan-line: rgba(251, 113, 133, .36);
}

.loan-card.is-liquidado {
    --loan-accent: #34d399;
    --loan-soft: rgba(16, 185, 129, .13);
    --loan-line: rgba(52, 211, 153, .34);
}

.loan-card.is-solicitado,
.loan-card.is-aprobado {
    --loan-accent: #f59e0b;
    --loan-soft: rgba(245, 158, 11, .12);
    --loan-line: rgba(251, 191, 36, .30);
}

.loan-card.is-reestructurado {
    --loan-accent: #a855f7;
    --loan-soft: rgba(168, 85, 247, .14);
    --loan-line: rgba(192, 132, 252, .34);
}

.loan-person,
.loan-card-metric,
.loan-card-status,
.loan-card-action {
    min-width: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .055);
    padding: 10px;
}

.loan-person {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.loan-photo .avatar {
    width: 52px;
    height: 52px;
}

.loan-person strong {
    display: block;
    color: var(--text);
    font-size: 15px;
}

.loan-person small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.loan-card-metric span,
.loan-card-status small {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.loan-card-metric strong {
    display: block;
    color: var(--text);
    font-size: 16px;
}

.loan-card-metric.paid strong {
    color: #86efac;
}

.loan-card-metric.balance strong {
    color: #fcd34d;
}

.loan-card.is-liquidado .loan-card-metric.balance strong {
    color: #94a3b8;
}

.loan-card-status {
    display: grid;
    gap: 7px;
    align-content: center;
}

.loan-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #080d1f;
    background: var(--loan-accent);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.loan-card-action {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 900;
}

.loan-card-action i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #080d1f;
    background: var(--loan-accent);
    font-size: 18px;
}

.loan-card-action:hover,
.loan-person:hover {
    border-color: var(--loan-line);
    background: rgba(255, 255, 255, .06);
}

.empty-cell {
    padding: 22px;
    color: var(--muted);
    text-align: center;
}

.list-money {
    flex: 0 0 auto;
    text-align: right;
}

.loan-progress {
    display: block;
    width: 100%;
    max-width: 340px;
    height: 6px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    overflow: hidden;
}

.loan-progress i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4ade80, #16a34a);
    transition: width .3s ease;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline li {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 18px;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 38px;
    bottom: 2px;
    width: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .08);
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li:last-child::before { display: none; }

.timeline li > i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    font-size: 15px;
    position: relative;
    z-index: 1;
    color: #d3d9e6;
    background: rgba(148, 163, 184, .16);
}

.timeline li > i.tl-green { color: #6ee7a0; background: rgba(34, 197, 94, .16); }
.timeline li > i.tl-blue { color: #8ab8ff; background: rgba(59, 130, 246, .18); }
.timeline li > i.tl-yellow { color: #fde047; background: rgba(250, 204, 21, .14); }
.timeline li > i.tl-purple { color: #c8b6ff; background: rgba(139, 92, 246, .20); }

.timeline li > span {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-top: 2px;
}

.timeline strong { font-size: 14px; }

.timeline small {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.timeline .timeline-meta {
    color: var(--muted);
    font-size: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(155, 92, 255, .16);
    border: 1px solid rgba(155, 92, 255, .30);
    color: #d7c4ff;
    font-style: normal;
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
}

/* Rojo: vencido, atrasado, rechazado, riesgo alto, urgente */
.badge.alta, .badge.urgente, .badge.vencida, .badge.atrasado,
.badge.rechazado, .badge.alto, .badge.No {
    background: rgba(255, 77, 95, .14);
    border-color: rgba(255, 77, 95, .34);
    color: #ff9ca7;
}

/* Amarillo / naranja: pendiente, prioridad media, riesgo medio */
.badge.media, .badge.pendiente, .badge.medio {
    background: rgba(250, 204, 21, .12);
    border-color: rgba(250, 204, 21, .30);
    color: #fde047;
}

/* Verde: pagado, activo, aprobado, excelente */
.badge.pagada, .badge.pago, .badge.activo, .badge.aprobado,
.badge.Excelente, .badge.Aprobado {
    background: rgba(34, 197, 94, .13);
    border-color: rgba(34, 197, 94, .32);
    color: #6ee7a0;
}

/* Azul: parcial, liquidado, prioridad baja, visitado */
.badge.parcial, .badge.liquidado, .badge.baja, .badge.visitado,
.badge.reprogramado {
    background: rgba(59, 130, 246, .14);
    border-color: rgba(59, 130, 246, .32);
    color: #8ab8ff;
}

.badge.is-paid {
    background: rgba(34, 197, 94, .13);
    border-color: rgba(34, 197, 94, .32);
    color: #6ee7a0;
}

.badge.is-pending {
    background: rgba(250, 204, 21, .12);
    border-color: rgba(250, 204, 21, .32);
    color: #fde047;
}

.badge.is-late {
    background: rgba(255, 77, 95, .14);
    border-color: rgba(255, 77, 95, .36);
    color: #ff9ca7;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ink);
}

th, td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

td small { display: block; margin-top: 2px; color: var(--muted); }

.table-main-link {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.table-main-link:hover {
    color: var(--brand-2);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid h2, .wide { grid-column: 1 / -1; }

.client-form {
    display: grid;
    gap: 16px;
}

.form-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-progress span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.form-progress span.is-active {
    color: #03111f;
    background: linear-gradient(135deg, #7dd3fc, #22c55e);
    box-shadow: var(--glow);
}

.form-progress span.is-complete {
    color: #dfffee;
    background: rgba(33, 201, 121, .14);
    border-color: rgba(33, 201, 121, .34);
}

.form-section {
    background: rgba(4, 7, 26, .78);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 22px 58px rgba(0, 0, 0, .30);
    backdrop-filter: blur(14px);
}

.form-section:not(.is-open) .section-body {
    display: none;
}

.form-section.is-complete:not(.is-open) {
    border-color: rgba(33, 201, 121, .26);
}

.form-section.is-locked {
    opacity: .56;
}

.form-section.is-locked .section-title {
    cursor: not-allowed;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    cursor: pointer;
}

.section-title i {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #7c3aed, #4c1d95);
    font-size: 20px;
}

.section-title h2 {
    margin-bottom: 2px;
}

.section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.section-status {
    margin-left: auto;
    min-width: max-content;
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .10);
    font-size: 12px;
    font-weight: 800;
}

.form-section.is-complete .section-status {
    color: #dfffee;
    background: rgba(33, 201, 121, .14);
    border-color: rgba(33, 201, 121, .32);
}

.form-actions-sticky {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: sticky;
    bottom: 14px;
    z-index: 3;
    padding: 14px;
    background: rgba(12, 13, 31, .92);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.edit-actions {
    justify-content: flex-end;
    gap: 10px;
}

.edit-actions .button {
    min-width: 190px;
    min-height: 46px;
}

.edit-save {
    color: #04170d;
    background: linear-gradient(135deg, #86efac, #22c55e);
    box-shadow: 0 12px 28px rgba(34, 197, 94, .18);
}

.edit-cancel {
    color: #fecdd3;
    border: 1px solid rgba(251, 113, 133, .30);
    background: rgba(251, 113, 133, .08);
    box-shadow: none;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: #d8d6e8;
}

input, select, textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    color: #fff;
    background: rgba(4, 5, 18, .62);
}

input[type="file"] {
    padding: 8px;
}

input::file-selector-button {
    border: 0;
    border-radius: 999px;
    margin-right: 10px;
    padding: 7px 11px;
    color: #160b02;
    background: var(--brand);
    font-weight: 800;
}

select option {
    background: #0b0a1c;
    color: #fff;
}

textarea { min-height: 92px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .14);
    outline: 0;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}

.check input { width: auto; min-height: auto; }

input[type="checkbox"] { accent-color: var(--brand); }

.profile, .collection-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--purple), #6a2de2);
    color: #fff;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 800;
    object-fit: cover;
}

.avatar.large { width: 86px; height: 86px; font-size: 36px; }
.avatar.photo { border: 3px solid rgba(255, 255, 255, .86); box-shadow: none; }

.collect-now {
    display: grid;
    gap: 2px;
    text-align: right;
}

.collect-now span { color: var(--muted); }
.collect-now strong { font-size: 34px; color: var(--brand-2); }

.agenda-item {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: rgba(255, 255, 255, .035);
}

.agenda-item.is-paid {
    border-color: rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .06);
}

.agenda-item.is-pending {
    border-color: rgba(250, 204, 21, .24);
    background: rgba(250, 204, 21, .055);
}

.agenda-item.is-late {
    border-color: rgba(255, 77, 95, .30);
    background: rgba(255, 77, 95, .07);
}

.overdue-panel {
    border-color: rgba(255, 77, 95, .28);
    background:
        linear-gradient(135deg, rgba(255, 77, 95, .12), rgba(250, 204, 21, .055)),
        rgba(4, 7, 26, .80);
}

.overdue-list {
    display: grid;
    gap: 10px;
}

.overdue-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 77, 95, .22);
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
}

.overdue-card > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.overdue-card small,
.overdue-money em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.overdue-money {
    text-align: right;
}

.overdue-money strong {
    color: #ff9ca7;
    font-size: 18px;
}

.agenda-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.agenda-item summary span { display: grid; }

.agenda-item summary > span:first-of-type { flex: 1; min-width: 0; }

.agenda-item summary > span:last-of-type {
    justify-items: end;
    gap: 4px;
    text-align: right;
    color: var(--muted);
    font-size: 13px;
}

.agenda-summary strong {
    color: #fff;
}

.agenda-toolbar-panel {
    border-color: rgba(20, 184, 166, .20);
    background:
        linear-gradient(135deg, rgba(20, 184, 166, .12), rgba(59, 130, 246, .07)),
        rgba(4, 7, 26, .78);
}

.cut-toolbar-panel {
    border-color: rgba(34, 197, 94, .20);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, .12), rgba(124, 58, 237, .07)),
        rgba(4, 7, 26, .78);
}

.agenda-filter {
    margin-top: 0;
    width: 100%;
    align-items: center;
}

.agenda-filter label {
    max-width: 360px;
}

.agenda-filter .print-button {
    margin-left: auto;
}

.today-button {
    color: #04111a;
    background: linear-gradient(145deg, #7dd3fc, #34d399);
    box-shadow: 0 10px 24px rgba(52, 211, 153, .22);
}

.today-button:hover {
    color: #04111a;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(125, 211, 252, .25);
}

.print-button {
    color: #dbeafe;
    border: 1px solid rgba(147, 197, 253, .28);
    background: rgba(59, 130, 246, .10);
}

.print-button:hover {
    color: #fff;
    background: rgba(59, 130, 246, .18);
    border-color: rgba(147, 197, 253, .42);
}

.inline-form, .row-actions {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.row-actions {
    align-items: center;
    gap: 8px;
    margin-top: 0;
}

td.row-actions {
    display: table-cell;
}

td.row-actions .button {
    margin: 2px 6px 2px 0;
}

td .button {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
}

td .row-actions {
    margin: 0;
}

.inline-form label { min-width: 210px; flex: 1; }

.ticket {
    max-width: 360px;
    margin-inline: auto;
    text-align: center;
}

.ticket img {
    width: 180px;
    height: 180px;
    margin: 12px auto;
    display: block;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}

.ticket-applied {
    display: grid;
    gap: 8px;
    margin: 12px 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(20, 184, 166, .28);
    background: rgba(20, 184, 166, .08);
    text-align: left;
}

.ticket-applied strong {
    color: #7dd3fc;
}

.ticket-applied p {
    display: grid;
    gap: 4px;
    margin: 0;
}

.ticket-applied code {
    width: max-content;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.ticket-applied span {
    color: #34d36f;
    font-weight: 800;
}

.verify-applied {
    max-width: 420px;
    margin-inline: auto;
}

.quota-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 14px;
}

.quota-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.quota-legend span::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.legend-paid { color: #9af6b9; background: rgba(34, 197, 94, .10); }
.legend-paid::before { background: #34d36f; }
.legend-late { color: #ffb3bb; background: rgba(244, 63, 94, .12); }
.legend-late::before { background: #fb7185; }
.legend-partial { color: #d8b4fe; background: rgba(168, 85, 247, .13); }
.legend-partial::before { background: #a855f7; }
.legend-future { color: #fde68a; background: rgba(245, 158, 11, .12); }
.legend-future::before { background: #f59e0b; }

.quota-board {
    display: grid;
    gap: 10px;
}

.quota-card {
    --quota-accent: #f59e0b;
    --quota-soft: rgba(245, 158, 11, .09);
    --quota-line: rgba(245, 158, 11, .28);
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(110px, .7fr) repeat(3, minmax(105px, .7fr)) minmax(130px, .75fr) minmax(150px, .9fr);
    gap: 10px;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--quota-line);
    border-left: 5px solid var(--quota-accent);
    border-radius: 16px;
    background:
        linear-gradient(135deg, var(--quota-soft), rgba(8, 13, 31, .76) 46%),
        rgba(9, 14, 32, .84);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.quota-card.is-paid {
    --quota-accent: #34d399;
    --quota-soft: rgba(16, 185, 129, .12);
    --quota-line: rgba(52, 211, 153, .32);
}

.quota-card.is-late {
    --quota-accent: #fb7185;
    --quota-soft: rgba(244, 63, 94, .13);
    --quota-line: rgba(251, 113, 133, .36);
}

.quota-card.is-partial {
    --quota-accent: #a855f7;
    --quota-soft: rgba(168, 85, 247, .14);
    --quota-line: rgba(192, 132, 252, .34);
}

.quota-card.is-future {
    --quota-accent: #f59e0b;
    --quota-soft: rgba(245, 158, 11, .11);
    --quota-line: rgba(251, 191, 36, .30);
}

.quota-main,
.quota-date,
.quota-money,
.quota-status,
.quota-ticket {
    min-width: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .055);
    padding: 10px;
}

.quota-main {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.quota-number {
    display: grid;
    place-items: center;
    min-height: 46px;
    border-radius: 14px;
    color: #070b18;
    background: var(--quota-accent);
    font-weight: 900;
    font-size: 13px;
}

.quota-main strong,
.quota-date strong,
.quota-money strong {
    display: block;
    color: var(--text);
}

.quota-main code {
    display: block;
    margin-top: 4px;
    color: #cbd5e1;
    white-space: normal;
    overflow-wrap: anywhere;
}

.quota-date span,
.quota-money span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.quota-money.paid strong {
    color: #86efac;
}

.quota-money.balance strong {
    color: #fcd34d;
}

.quota-card.is-paid .quota-money.balance strong {
    color: #94a3b8;
}

.quota-status {
    display: flex;
    align-items: center;
}

.quota-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #080d1f;
    background: var(--quota-accent);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.quota-ticket {
    display: flex;
    align-items: center;
}

.ticket-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 180px;
}

.legal-doc {
    max-width: 820px;
    margin-inline: auto;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
}

.print-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 14px;
    font-family: Inter, Arial, Helvetica, sans-serif;
}

.legal-page {
    margin-bottom: 18px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    color: #171421;
    box-shadow: 0 12px 35px rgba(0,0,0,.24);
}

.legal-page h2 {
    color: #171421;
    margin-bottom: 12px;
}

.legal-page table {
    color: #171421;
    font-family: Inter, Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.legal-page th,
.legal-page td {
    border-color: rgba(0, 0, 0, .14);
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-top: 58px;
}

.signature-grid span {
    display: block;
    padding-top: 10px;
    border-top: 1px solid #171421;
    text-align: center;
    font-family: Inter, Arial, Helvetica, sans-serif;
    font-size: 13px;
}

.verify { max-width: 520px; margin-inline: auto; text-align: center; }

.login-shell {
    display: grid;
    min-height: calc(100vh - 150px);
    place-items: center;
}

.login-card {
    width: min(100%, 430px);
    border-color: rgba(255, 255, 255, .14);
    box-shadow: 0 34px 100px rgba(0,0,0,.45);
}

.login-logo {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, #7dd3fc, #22c55e);
    color: #03111f;
    font-weight: 900;
    margin-bottom: 14px;
    box-shadow: var(--glow);
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.document-tile {
    display: grid;
    gap: 6px;
    min-height: 120px;
    align-content: center;
    justify-items: start;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius);
    text-decoration: none;
    background: rgba(255, 255, 255, .04);
}

.document-tile i {
    font-size: 26px;
    color: var(--brand);
}

.preserve-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(62, 214, 140, .22);
    border-radius: 12px;
    color: #dffbe9;
    background: rgba(62, 214, 140, .08);
}

.preserve-note i {
    color: var(--green);
    font-size: 18px;
}

.document-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.document-status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
}

.document-status-card > i {
    font-size: 19px;
    color: var(--muted);
}

.document-status-card span {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.document-status-card strong {
    color: var(--ink);
    font-size: 13px;
}

.document-status-card small {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.document-status-card.is-present {
    border-color: rgba(62, 214, 140, .24);
    background: rgba(62, 214, 140, .07);
}

.document-status-card.is-present > i {
    color: var(--green);
}

.document-status-card.is-missing {
    opacity: .84;
}

.settings-grid {
    display: grid;
    gap: 14px;
}

.setting-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    color: var(--ink);
}

.setting-card input {
    width: 22px;
    min-height: 22px;
    accent-color: var(--brand);
}

.setting-card span {
    display: grid;
    gap: 3px;
}

.setting-card small {
    color: var(--muted);
}

.agent-card {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(170px, 220px) minmax(220px, 1.2fr) auto auto;
    align-items: center;
}

.agent-card label {
    margin: 0;
}

.agent-card .check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-card .check input {
    width: 20px;
    min-height: 20px;
}

.agent-bank textarea {
    min-height: 58px;
}

.ocr-review {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, .045);
}

.ocr-review strong {
    display: block;
    margin-bottom: 8px;
    color: var(--brand-2);
}

.ocr-warning {
    margin: 8px 0;
    padding: 9px 11px;
    border-radius: 10px;
    color: #bae6fd;
    background: rgba(56, 189, 248, .10);
    border: 1px solid rgba(56, 189, 248, .22);
}

.ocr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.ocr-review-grid {
    display: grid;
    grid-template-columns: minmax(130px, .4fr) 1fr;
    gap: 8px 12px;
    font-size: 13px;
}

.ocr-review-grid span {
    color: var(--muted);
}

.ocr-review-grid b {
    color: #fff;
    font-weight: 700;
}

.location-tools,
.ocr-tools,
.step-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.map-card,
.map-preview {
    width: 100%;
    min-height: 260px;
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, .04);
    box-shadow: var(--shadow);
}

.map-card iframe,
.map-preview iframe {
    display: block;
    width: 100%;
    height: 280px;
    border: 0;
}

pre, code {
    background: rgba(255, 255, 255, .07);
    border-radius: 6px;
    color: #e8e6f2;
    padding: 2px 6px;
}

pre { padding: 12px; overflow: auto; }

.alert-danger {
    background: rgba(255, 77, 95, .16);
    border-color: rgba(255, 77, 95, .32);
    color: #ffdce0;
}

@media (max-width: 1100px) {
    .metrics, .metrics.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .collection-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .loan-card {
        grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(112px, .8fr));
    }
    .loan-card-status,
    .loan-card-action {
        grid-column: span 1;
    }
    .quota-card {
        grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(110px, .8fr));
    }
    .quota-status,
    .quota-ticket {
        grid-column: span 1;
    }
}

@media (max-width: 980px) {
    .sidebar {
        position: fixed;
        inset: auto 10px 8px 10px;
        width: auto;
        padding: 10px 8px;
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 22px;
        background: rgba(4, 6, 20, .97);
        box-shadow: 0 -18px 60px rgba(0, 0, 0, .55);
    }

    .brand { display: none; }

    .main {
        margin-left: 0;
        padding: 18px 14px 130px;
    }

    nav {
        display: flex;
        flex-direction: column-reverse;
        gap: 0;
    }

    .nav-primary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
        gap: 4px;
    }

    .nav-extra {
        display: none;
        grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
        gap: 4px;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .nav-extra.is-open { display: grid; }

    .nav-extra:not(:has(a)) { display: none !important; }

    .nav-primary:has(+ .nav-extra:not(:has(a))) .nav-more { display: none; }

    nav a,
    .nav-more {
        display: grid;
        justify-items: center;
        gap: 5px;
        padding: 6px 2px;
        border: 0;
        background: transparent;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .01em;
        text-align: center;
        font-family: inherit;
        cursor: pointer;
        color: #a9a7ba;
    }

    nav a i,
    .nav-more i {
        width: 42px;
        height: 42px;
        font-size: 20px;
        border-radius: 14px;
        display: grid;
        place-items: center;
    }

    .nav-more i {
        color: #e8e6f2;
        background: rgba(255, 255, 255, .09);
    }

    nav a.is-active {
        color: #fff;
        background: transparent;
        border-color: transparent;
    }

    nav a.is-active i,
    .nav-more.is-active i {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, .45);
    }

    .nav-more.is-active {
        color: #fff;
    }

    .grid.two { grid-template-columns: 1fr; }
    .client-info-grid { grid-template-columns: 1fr; }
    .loan-card {
        grid-template-columns: minmax(0, 1fr) minmax(120px, .55fr);
    }
    .loan-person,
    .loan-card-action {
        grid-column: 1 / -1;
    }
    .loan-card-action {
        grid-template-columns: 40px 1fr;
        justify-items: start;
    }
    .payment-quota-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .payment-quota-grid .highlight {
        grid-column: 1 / -1;
    }
    .quota-card {
        grid-template-columns: minmax(0, 1fr) minmax(120px, .55fr);
    }
    .quota-main,
    .quota-ticket {
        grid-column: 1 / -1;
    }
    .profile, .collection-hero, .dashboard-hero {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }
    .collect-now { text-align: left; }
    .dashboard-hero h2 { font-size: 34px; }
}

@media (max-width: 620px) {
    h1 { font-size: 22px; }
    .eyebrow { font-size: 11px; margin-bottom: 2px; }
    .metrics, .metrics.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid, .loan-preview, .quote-summary { grid-template-columns: 1fr; }

    .metrics {
        display: grid;
        overflow: visible;
        scrollbar-width: none;
    }

    .metrics::-webkit-scrollbar { display: none; }

    .metrics .metric {
        min-width: 0;
        min-height: 126px;
        padding: 13px 8px;
    }

    .metric i {
        width: 48px;
        height: 48px;
        font-size: 21px;
    }

    .metric strong {
        font-size: 19px;
    }

    .metric span {
        font-size: 12px;
    }

    .topbar {
        top: 8px;
        gap: 8px;
        padding: 6px 10px 6px 6px;
    }

    .topbar-date { display: none; }

    .userbox {
        gap: 8px;
        padding: 5px 10px;
    }

    .userbox span { display: none; }

    table { display: block; overflow-x: auto; }
    .loan-card {
        grid-template-columns: 1fr;
        padding: 10px;
        border-radius: 14px;
    }
    .loan-card-metric,
    .loan-card-status {
        display: grid;
        grid-template-columns: minmax(90px, .45fr) 1fr;
        align-items: center;
        gap: 10px;
    }
    .loan-card-metric span,
    .loan-card-status small {
        margin: 0;
    }
    .loan-state {
        width: auto;
        justify-self: start;
    }
    .payment-quota-head {
        grid-template-columns: 44px minmax(0, 1fr);
    }
    .payment-quota-head em {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
    .payment-quota-grid {
        grid-template-columns: 1fr;
    }
    .payment-quota-grid .highlight {
        grid-column: auto;
    }
    .quota-card {
        grid-template-columns: 1fr;
        padding: 10px;
        border-radius: 14px;
    }
    .quota-date,
    .quota-money,
    .quota-status,
    .quota-ticket {
        display: grid;
        grid-template-columns: minmax(88px, .45fr) 1fr;
        align-items: center;
        gap: 10px;
    }
    .quota-date span,
    .quota-money span {
        margin: 0;
    }
    .quota-state {
        width: auto;
        justify-self: start;
    }
    .search-actions .button {
        width: 100%;
        justify-content: center;
    }
    .collection-actions {
        grid-template-columns: 1fr;
    }
    .action-pill {
        min-height: 54px;
    }
    .edit-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .edit-actions .button {
        min-width: 0;
        width: 100%;
    }
    .agenda-filter label {
        max-width: none;
    }
    .agenda-filter .button,
    .agenda-filter .print-button {
        flex: 1 1 auto;
        justify-content: center;
        margin-left: 0;
    }
    .overdue-card {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .overdue-card .overdue-money,
    .overdue-card .row-actions {
        grid-column: 1 / -1;
        text-align: left;
    }
    .agent-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .agenda-item summary { align-items: start; flex-direction: column; }
    .dashboard-hero { padding: 18px; }
    .dashboard-hero h2 { font-size: 30px; }
    .form-actions-sticky {
        display: grid;
    }

    .quote-actions {
        display: grid;
    }

    .quote-page {
        padding: 18px;
    }
}

@media print {
    body::before,
    .sidebar,
    .topbar,
    .action-strip,
    .button,
    .notice,
    .no-print,
    .print-actions {
        display: none !important;
    }

    .main { margin: 0; padding: 0; }
    body { background: #fff; color: #000; }
    .ticket, .legal-doc { border: 0; box-shadow: none; color: #000; background: #fff; }

    .legal-doc {
        max-width: none;
        margin: 0;
        padding: 0;
        font-size: 14px;
    }

    .legal-page {
        min-height: 96vh;
        margin: 0;
        padding: 22mm 18mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        break-after: page;
    }

    .legal-page:last-child {
        break-after: auto;
    }

    body.print-loan-preview .main > *:not(.loan-form),
    body.print-loan-preview .loan-form > *:not(.loan-quote),
    body.print-loan-preview .loan-quote > *:not(.quote-page) {
        display: none !important;
    }

    body.print-loan-preview .loan-form,
    body.print-loan-preview .loan-quote {
        display: block !important;
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: #fff;
    }

    body.print-loan-preview .quote-page {
        min-height: 96vh;
        padding: 18mm;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        color: #111;
    }
}
