/* ════════════════════════════════════════════════════════════════
   CATALEIA BANK · Sistema de Préstamos y Cobros
   Paleta: Crema + Coral suave (Marrón profundo · Coral · Crema)
   ════════════════════════════════════════════════════════════════ */

:root {
    /* Marrón primario (oscuro, sólido) */
    --primary: #5C3A2E;
    --primary-dark: #3F2820;
    --primary-light: #8B6F5E;

    /* Coral (acento cálido) */
    --accent: #D85A30;
    --accent-dark: #A3401F;
    --accent-light: #F0997B;

    /* Crema (fondos) */
    --bg: #FAF5F2;
    --bg-soft: #FDFAF8;
    --surface: #FFFFFF;
    --surface-alt: #F5EDE7;

    /* Texto */
    --text: #2C1F18;
    --text-muted: #8B7868;
    --text-soft: #B5A294;
    --text-tertiary: #D4C5B8;

    /* Bordes */
    --border: #ECE0D5;
    --border-soft: #F4ECE3;
    --border-strong: #D9C7B6;

    /* Semánticos */
    --success: #4A7C2F;
    --success-bg: #ECF3E2;
    --danger: #B33A2B;
    --danger-bg: #F9E8E4;
    --warning: #C77A1A;
    --warning-bg: #FBEEDA;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(92,58,46,.05);
    --shadow: 0 4px 12px rgba(92,58,46,.08);
    --shadow-lg: 0 12px 32px rgba(92,58,46,.14);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

/* ============ LOGIN ============ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Decoración sutil de fondo */
.login-screen::before,
.login-screen::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.08;
    pointer-events: none;
}
.login-screen::before {
    width: 400px; height: 400px;
    top: -100px; right: -100px;
}
.login-screen::after {
    width: 300px; height: 300px;
    bottom: -80px; left: -80px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 36px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.login-brand {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
}

.login-brand-sub {
    font-size: 11px;
    color: var(--accent);
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.login-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 18px;
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.login-error {
    color: var(--danger);
    font-size: 12px;
    min-height: 16px;
    margin-top: 4px;
    margin-bottom: 8px;
    font-weight: 500;
}

.password-wrap { position: relative; }
.btn-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    padding: 4px;
    display: flex;
}
.btn-eye:hover { color: var(--primary); }

.login-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
    text-align: center;
}

.powered-by {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-soft);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-weight: 500;
}

.powered-logo {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    opacity: 0.7;
}

.powered-logo svg {
    height: 18px;
    width: auto;
}

/* ============ FORM GENERICS ============ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    outline: none;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(216,90,48,.12);
}
.form-input-sm { padding: 7px 10px; font-size: 13px; }

/* ============ BUTTONS ============ */
.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: background .15s, transform .05s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.2px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.98); }

.btn-accent {
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
}
.btn-secondary:hover { background: var(--border); }

.btn-full { width: 100%; }

/* ============ HEADER ============ */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-display);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    color: var(--primary);
    letter-spacing: -0.2px;
}
.brand-sub {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.header-center { justify-self: center; }
.header-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface-alt);
    padding: 6px 22px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.balance-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.balance-amount {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    margin-top: 1px;
}

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--font-display);
}
.user-details { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-link {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0;
    transition: color .15s;
}
.user-link:hover { color: var(--accent); }

/* ============ LAYOUT ============ */
.layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 22px 20px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
}

/* ============ SIDEBAR ============ */
.sidebar {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 80px;
}
.nav-menu { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: background .15s, color .15s;
    text-align: left;
    width: 100%;
}
.nav-item:hover:not(.disabled) { background: var(--surface-alt); }
.nav-item.active {
    background: var(--accent);
    color: #fff;
}
.nav-item.active svg { stroke: #fff; }
.nav-item.disabled {
    color: var(--text-soft);
    cursor: not-allowed;
    opacity: 0.6;
}
.nav-item svg { flex-shrink: 0; }
.nav-item span:not(.nav-count):not(.nav-soon) { flex: 1; }
.nav-count {
    font-size: 11px;
    background: rgba(255,255,255,.25);
    color: inherit;
    padding: 1px 7px;
    border-radius: 9px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.nav-item:not(.active) .nav-count {
    background: var(--surface-alt);
    color: var(--text-muted);
}
.nav-soon {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-soft);
    background: var(--surface-alt);
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* ============ SECTION HEADERS ============ */
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 14px;
    flex-wrap: wrap;
}
.section-header .card-title { margin-bottom: 2px; }
.section-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ FILTERS ROW ============ */
.filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filters-row .form-input-sm { min-width: 240px; flex: 1; max-width: 360px; }

/* ============ TABLA ============ */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface-alt);
}
.data-table th:first-child { border-top-left-radius: var(--radius-sm); }
.data-table th:last-child { border-top-right-radius: var(--radius-sm); }
.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--bg-soft); }

.cli-nombre {
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cli-tel { font-size: 11px; color: var(--text-soft); display: none; }
@media (max-width: 640px) {
    .cli-tel { display: block; }
}

.mora-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
}
.mora-chip.mora-on { background: var(--warning-bg); color: var(--warning); }
.mora-chip.mora-off { background: var(--surface-alt); color: var(--text-soft); }

.archivado-tag {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface-alt);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.fecha-cell {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.actions-cell { white-space: nowrap; text-align: right; }
.row-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    margin-left: 2px;
    transition: background .15s, color .15s;
}
.row-btn:hover { background: var(--surface-alt); color: var(--primary); }
.row-btn-danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 36px; color: var(--accent); opacity: 0.5; margin-bottom: 10px; }
.empty-state p { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state span { font-size: 12px; }

/* ============ TOGGLE ============ */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}
.filter-toggle input { display: none; }
.toggle-track {
    width: 32px;
    height: 18px;
    background: var(--border-strong);
    border-radius: 18px;
    position: relative;
    transition: background .15s;
    flex-shrink: 0;
}
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.filter-toggle input:checked + .toggle-track { background: var(--accent); }
.filter-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(14px); }

/* ============ MODALES ============ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(63, 40, 32, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    backdrop-filter: blur(3px);
}
.modal-backdrop.open { display: flex; }
#modalBackdrop { z-index: 300; }

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-icon { font-size: 30px; color: var(--warning); margin-bottom: 6px; }
.modal-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--primary);
}
.modal-msg { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.5; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Modal de form (más grande) */
.modal-form {
    max-width: 560px;
    text-align: left;
}
.modal-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    text-align: left;
    gap: 12px;
}
.modal-header-inner .modal-title { margin-bottom: 2px; }
.modal-sub { font-size: 12px; color: var(--text-muted); }
.btn-close-modal {
    color: var(--text-muted);
    font-size: 24px;
    padding: 0 6px;
    line-height: 1;
    flex-shrink: 0;
}
.btn-close-modal:hover { color: var(--accent); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
}
.btn-danger:hover { background: #8E2E22; }

/* ============ FORMS ============ */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.form-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 14px; }
.form-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-dark);
    margin-bottom: 12px;
    font-weight: 700;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-textarea {
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    line-height: 1.5;
}
.form-hint {
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 4px;
}
.form-error {
    color: var(--danger);
    font-size: 12px;
    min-height: 16px;
    margin: 4px 0 12px;
    font-weight: 500;
}
.req { color: var(--danger); font-weight: 700; }

/* ============ MAIN ============ */
.main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

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

.card-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
    letter-spacing: -0.3px;
}

/* ============ LOADING ============ */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ FOOTER ============ */
.app-footer {
    text-align: center;
    padding: 14px 0 4px;
    color: var(--text-soft);
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 50px));
    background: var(--primary);
    color: #fff;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 500;
    z-index: 200;
    transition: transform .25s;
    max-width: 90%;
    text-align: center;
    pointer-events: none;
    opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
    .header-inner {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 8px 12px;
    }
    .brand { grid-column: 1; grid-row: 1; }
    .header-actions { grid-column: 2; grid-row: 1; justify-self: end; }
    .header-center {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
    }
    .header-balance {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 6px 14px;
        width: 100%;
    }
    .header-balance .balance-label::after { content: ":"; }
    .balance-amount { font-size: 16px; }
    .layout { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
    .sidebar { position: static; }
}

@media (max-width: 640px) {
    .header-inner { padding: 0 12px; }
    .brand-text { display: none; }
    .user-details { display: none; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .filters-row .form-input-sm { min-width: 0; max-width: none; width: 100%; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 6px; }
    .modal { padding: 18px; }
}

@media (max-width: 480px) {
    .login-card { padding: 32px 24px 22px; }
    .login-brand { font-size: 26px; }
}

/* ============ HEADER BALANCE MULTIMONEDA ============ */
.header-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface-alt);
    padding: 6px 22px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.balance-monedas {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.balance-amount {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.2px;
}
.balance-amount-neg { color: var(--danger); }
.balance-sep {
    color: var(--text-soft);
    font-weight: 400;
}
.balance-empty {
    font-size: 16px;
    color: var(--text-soft);
    font-weight: 500;
}

/* ============ TOTALES POR MONEDA ============ */
.totales-monedas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.total-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 14px 18px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}
.total-card::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.18;
    top: -30px;
    right: -30px;
}
.total-card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    font-weight: 500;
    position: relative;
    z-index: 1;
}
.total-card-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.4px;
    position: relative;
    z-index: 1;
}
.total-card-neg .total-card-value { color: #FFD7CE; }

/* ============ BILLETERAS GRID ============ */
.billeteras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.billetera-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--bc, var(--accent));
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow .15s, transform .1s;
}
.billetera-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.bil-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.bil-info { flex: 1; min-width: 0; }
.bil-nombre {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bil-moneda {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}
.bil-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
}
.billetera-card:hover .bil-actions { opacity: 1; }
.bil-saldo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}
.bil-saldo-neg { color: var(--danger); }
.bil-footer {
    font-size: 11px;
    color: var(--text-soft);
    padding-top: 4px;
    border-top: 1px solid var(--border-soft);
}

/* ============ SECTION DIVIDER ============ */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0 20px;
}
.subsection-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

/* ============ MOVIMIENTOS TABLE ============ */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.type-income { background: var(--success-bg); color: var(--success); }
.type-expense { background: var(--danger-bg); color: var(--danger); }
.type-transfer { background: var(--warning-bg); color: var(--warning); }

.bil-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--c, var(--primary));
    white-space: nowrap;
}

.amount-pos { color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-neg { color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-neutral { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }

/* ============ COLOR PICKER ============ */
.color-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid transparent;
    transition: transform .1s, border-color .15s;
    padding: 0;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--text); }

/* ============ MISC ============ */
.moneda-tag {
    font-size: 9px;
    background: var(--surface-alt);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-left: 4px;
}
.form-span-full { grid-column: 1 / -1; }
.movimientos-wrap { margin-top: 8px; }

@media (max-width: 640px) {
    .balance-monedas { gap: 6px; }
    .balance-amount { font-size: 15px; }
    .billeteras-grid { grid-template-columns: 1fr; }
    .bil-actions { opacity: 1; }
    .total-card-value { font-size: 18px; }
}
