/* ─── Variables (Blue Navy Light — ui-ux-pro-max) ────────────────────────── */
:root {
    /* Base azul marino claro */
    --bg:         #0d1b2e;
    --bg2:        #152238;
    --bg3:        #1c2d45;
    --surface:    rgba(255,255,255,.04);
    --surface2:   rgba(255,255,255,.07);
    --border:     rgba(100,160,255,.12);
    --border2:    rgba(100,160,255,.2);
    /* Brand */
    --accent:     #4f8ef7;
    --accent2:    #7eb3ff;
    --accent-glow:rgba(79,142,247,.22);
    /* Semantic */
    --ok:         #34d399;
    --ok-glow:    rgba(52,211,153,.2);
    --danger:     #fb7185;
    --danger-glow:rgba(251,113,133,.2);
    --warning:    #fbbf24;
    --warn-glow:  rgba(251,191,36,.2);
    /* Text */
    --text:       #e8f1ff;
    --text-soft:  rgba(200,220,255,.65);
    --text-mid:   rgba(200,220,255,.7);
    /* fg y muted como alias */
    --fg:         #e8f1ff;
    --muted:      rgba(200,220,255,.65);
    /* Chart */
    --chart:      #4f8ef7;
    /* Geometry */
    --radius:     16px;
    --radius-sm:  10px;
    --radius-xs:  6px;
    --shadow:     0 20px 60px rgba(0,10,30,.55);
    --shadow-sm:  0 4px 20px rgba(0,10,30,.3);
    --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Subtle noise texture on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: .4;
}

/* ─── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 56px;
    background: rgba(10,20,40,.88);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}
.logo {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.3px;
    background: linear-gradient(135deg, #e8f1ff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a {
    color: var(--text-soft);
    padding: .4rem .85rem;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-xs);
    transition: color var(--transition), background var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--text); background: rgba(99,102,241,.15); }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; position: relative; z-index: 1; }

.columns   { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.columns-3 { display: grid; grid-template-columns: 1fr 360px; gap: 1.25rem; align-items: start; }
.col-wide  {}
.col-narrow {}
.mt-1 { margin-top: 1.25rem; }
.mt-2 { margin-top: 2.5rem; }

@media (max-width: 900px) {
    .columns, .columns-3 { grid-template-columns: 1fr; }
    .container { padding: 1.25rem 1rem 5rem; }
}

/* ─── Hero patrimonio ────────────────────────────────────────────────────── */
.hero-patrimonio {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #132040 0%, #0e1a30 50%, #091426 100%);
    border: 1px solid rgba(79,142,247,.22);
    border-radius: var(--radius);
    padding: 2.5rem 2.25rem;
    margin-bottom: 1.25rem;
    gap: 2rem;
    overflow: hidden;
}
/* Glow orb behind hero */
.hero-patrimonio::before {
    content: '';
    position: absolute;
    top: -60px; left: -40px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(79,142,247,.18) 0%, transparent 70%);
    pointer-events: none;
}
.hero-patrimonio::after {
    content: '';
    position: absolute;
    bottom: -80px; right: 100px;
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(126,179,255,.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-left { position: relative; z-index: 1; }
.hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-soft);
    margin-bottom: .5rem;
}
.hero-amount {
    font-size: 3.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #e8f1ff 20%, var(--accent2) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.05;
    letter-spacing: -1.5px;
}
.hero-sub { color: var(--text-soft); font-size: 12.5px; margin-top: .6rem; }
.hero-fecha { color: var(--muted); font-size: 11px; margin-top: .3rem; text-transform: capitalize; }
.hero-right {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}
.hero-stat { text-align: right; }
.stat-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-soft); margin-bottom: .2rem; }
.stat-val { font-size: 1.25rem; font-weight: 800; }
.btn-hero { margin-top: .25rem; }

@media (max-width: 600px) {
    .hero-patrimonio { flex-direction: column; align-items: flex-start; gap: 1.5rem; padding: 1.75rem 1.5rem; }
    .hero-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: .75rem; }
    .hero-stat { text-align: left; }
    .hero-amount { font-size: 2.4rem; }
}

/* ─── KPI row ───────────────────────────────────────────────────────────── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .75rem;
    margin-bottom: 2rem;
}
.kpi-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    cursor: default;
}
.kpi-card[onclick] { cursor: pointer; }
.kpi-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.kpi-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.kpi-body { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kpi-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-soft); }
.kpi-val { font-size: 1.2rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 10.5px; color: var(--text-soft); line-height: 1.3; }
.kpi-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge-ok    { background: rgba(52,211,153,.12); color: var(--ok); border: 1px solid rgba(52,211,153,.2); }
.badge-draft { background: rgba(251,191,36,.1);  color: var(--warning); border: 1px solid rgba(251,191,36,.2); }

/* ─── Colores semánticos ────────────────────────────────────────────────── */
.text-ok      { color: var(--ok); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ─── Espacios (cuentas) grid ───────────────────────────────────────────── */
.section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-soft);
    margin-bottom: 1rem;
    padding-left: 2px;
}
.cuentas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
/* ── Drawer espacio ─────────────────────────────────────────────────── */
.drawer-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(2,6,23,.7);
    backdrop-filter: blur(2px);
}
.drawer {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 501;
    width: min(520px, 95vw);
    max-height: 90vh;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 16px;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: popIn .2s ease;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.drawer.hidden, .drawer-overlay.hidden { display: none; }
.drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-title-wrap { display: flex; align-items: center; gap: .75rem; }
.drawer-icono {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.drawer-nombre { font-size: 1rem; font-weight: 700; color: var(--text); }
.drawer-proposito { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.drawer-close {
    background: none; border: none; color: var(--muted);
    font-size: 1.5rem; cursor: pointer; padding: .25rem .5rem;
    line-height: 1; border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}
.drawer-close:hover { background: rgba(255,255,255,.06); color: var(--text); }
.drawer-saldo-wrap {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-saldo-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: .3rem; }
.drawer-saldo { font-size: 1.9rem; font-weight: 900; letter-spacing: -.5px; }
.drawer-acciones {
    display: flex; gap: .5rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.drawer-body {
    flex: 1; overflow-y: auto;
    padding: 0 1.5rem 1.5rem;
}
.drawer-movimientos {
    padding: 0;
}
.drawer-mes-grupo { margin-bottom: 1.25rem; }
.drawer-mes-label {
    font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: .5rem;
}
.drawer-mov-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: .5rem;
    padding: .5rem 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.drawer-mov-row:last-child { border-bottom: none; }
.drawer-mov-desc { font-size: 13px; color: var(--text-mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-mov-importe { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ── Tarjeta clicable ───────────────────────────────────────────────── */
.cuenta-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    display: block;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.cuenta-card-clickable { cursor: pointer; }
.cuenta-card-clickable:active { transform: translateY(-1px) scale(.985); }
.cuenta-card.drag-source { opacity: .45; transform: scale(.97); }
.cuenta-card.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), 0 12px 40px rgba(99,102,241,.3);
    transform: translateY(-4px);
}
/* Modal transferencia */
.transfer-preview {
    display: flex; align-items: center; gap: .75rem;
    background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
    padding: .75rem 1rem; margin-bottom: 1rem;
}
.transfer-espacio {
    flex: 1; font-weight: 600; font-size: .95rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.transfer-arrow { font-size: 1.3rem; color: var(--accent); flex-shrink: 0; }
.cuenta-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ec, #6366f1), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}
.cuenta-card:hover {
    border-color: rgba(99,102,241,.3);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.cuenta-card:hover::before { opacity: 1; }
.cuenta-top { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.1rem; }
.cuenta-icono {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: rgba(99,102,241,.12);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.cuenta-nombre { font-size: 13px; font-weight: 600; color: var(--text-mid); flex: 1; }
.cuenta-saldo { font-size: 1.65rem; font-weight: 900; color: var(--text); margin-bottom: .15rem; letter-spacing: -.5px; }
.cuenta-proposito { font-size: 11.5px; color: var(--text-soft); margin-bottom: .5rem; }
.cuenta-asig { font-size: 11px; color: var(--accent2); font-weight: 600; }
.cuenta-tag-estimado { font-size: 10px; color: var(--text-soft); opacity: .6; margin-bottom: .4rem; font-style: italic; }
.cuenta-tras-fijos {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--text-mid);
    background: rgba(255,255,255,.04); border-radius: 6px;
    padding: .35rem .6rem; margin: .4rem 0 .5rem;
    border-left: 2px solid var(--border);
}
.cuenta-tras-fijos span:first-child { opacity: .7; }
.subespacios-wrap {
    margin: .5rem 0 .3rem;
    border-left: 2px solid var(--border);
    padding-left: .5rem;
    display: flex; flex-direction: column; gap: .25rem;
}
.subespacio-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--text-soft);
    padding: .2rem .3rem; border-radius: 4px;
    transition: background .15s;
}
.subespacio-row:hover { background: rgba(255,255,255,.05); }
.btn-edit-saldo {
    background: none; border: none; cursor: pointer;
    font-size: 13px; padding: 2px 4px; opacity: .45; border-radius: 4px;
    transition: opacity .15s;
}
.btn-edit-saldo:hover { opacity: 1; background: rgba(255,255,255,.08); }

/* Gastos — tags de cuenta y frecuencia */
.gasto-tag {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: 10px; font-weight: 600; padding: 2px 7px;
    border-radius: 20px; white-space: nowrap;
}
.gasto-tag-frec {
    background: rgba(255,255,255,.07);
    color: var(--text-soft);
    border: 1px solid rgba(255,255,255,.1);
    text-transform: capitalize;
}

/* ─── Card sections ─────────────────────────────────────────────────────── */
.card-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.section-hdr h2 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-soft);
}

/* ─── Meses lista ───────────────────────────────────────────────────────── */
.meses-list { display: flex; flex-direction: column; gap: .35rem; }
.mes-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.02);
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition);
}
.mes-row:hover { background: rgba(99,102,241,.07); border-color: rgba(99,102,241,.15); }
.mes-row-left { display: flex; align-items: center; gap: .75rem; }
.mes-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.5); }
.dot-draft { background: var(--warning); }
.mes-row-nombre { font-size: 14px; font-weight: 500; }
.mes-row-right { display: flex; align-items: center; gap: .75rem; }
.mes-row-nomina { font-size: 14px; font-weight: 700; }
.mes-row-badge { font-size: 10px; padding: .2rem .65rem; border-radius: 20px; font-weight: 600; }
.mes-row-arrow { color: var(--text-soft); font-size: 16px; opacity: .6; }

/* ─── Chart ─────────────────────────────────────────────────────────────── */
#chart-container { margin-bottom: 1.25rem; }
#chart-nominas { width: 100%; display: block; }

/* ─── Proyección ────────────────────────────────────────────────────────── */
.proy-card {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.2rem;
    margin-bottom: .75rem;
    transition: border-color var(--transition);
}
.proy-card:hover { border-color: var(--border2); }
.proy-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .7rem; }
.proy-mes { font-size: 14px; font-weight: 700; }
.proy-libre { font-size: 13px; font-weight: 700; }
.proy-bar-bg { height: 4px; background: rgba(255,255,255,.06); border-radius: 4px; margin-bottom: .75rem; overflow: hidden; }
.proy-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--danger)); border-radius: 4px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.proy-detail { display: flex; gap: 1.25rem; font-size: 12px; color: var(--text-soft); margin-bottom: .5rem; }
.proy-detalles summary { font-size: 11px; color: var(--accent2); cursor: pointer; margin-top: .4rem; opacity: .8; }
.proy-detalles summary:hover { opacity: 1; }
.proy-item { display: flex; justify-content: space-between; font-size: 12px; padding: .28rem 0; border-bottom: 1px solid var(--border); }
.proy-item:last-child { border-bottom: none; }

/* ─── Documentos ────────────────────────────────────────────────────────── */
.btn-upload {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent2);
    cursor: pointer;
    padding: .32rem .75rem;
    border: 1px solid rgba(99,102,241,.25);
    border-radius: var(--radius-xs);
    transition: background var(--transition), border-color var(--transition);
}
.btn-upload:hover { background: rgba(99,102,241,.1); border-color: rgba(99,102,241,.4); }
.doc-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: none; }
.doc-icon { font-size: 1.15rem; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-nombre { font-size: 13px; font-weight: 500; color: var(--accent2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; transition: color var(--transition); }
.doc-nombre:hover { color: #fff; text-decoration: underline; }
.doc-fecha { font-size: 10.5px; color: var(--text-soft); }

/* ─── Page header ───────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 { font-size: 1.7rem; font-weight: 900; letter-spacing: -.5px; }
.page-subtitle { font-size: 13px; color: var(--text-soft); margin-top: .3rem; }
.header-actions { display: flex; gap: .75rem; align-items: center; }

/* ─── Cards métricas ────────────────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .85rem;
    margin-bottom: 1.5rem;
}
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
}
.card.highlight {
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(99,102,241,.04));
    border-color: rgba(99,102,241,.25);
}
.card-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-soft); margin-bottom: .5rem; }
.card-value { font-size: 1.45rem; font-weight: 900; letter-spacing: -.3px; }

/* ─── Secciones genéricas ───────────────────────────────────────────────── */
.section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.section h2 {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-soft);
    margin-bottom: 1rem;
}
.section h3 {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-soft);
    margin: 1.25rem 0 .75rem;
}
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.gastos-search-wrap { position: relative; display: flex; align-items: center; }
.gastos-search-icon { position: absolute; left: .55rem; font-size: .8rem; pointer-events: none; opacity: .6; }
.gastos-search {
    background: var(--bg); border: 1px solid var(--border2); border-radius: 8px;
    color: var(--text); font-size: 12px; padding: .35rem .6rem .35rem 1.8rem;
    width: 140px; transition: width .2s, border-color .2s;
}
.gastos-search:focus { outline: none; border-color: var(--accent); width: 200px; }
.gastos-search::placeholder { color: var(--muted); }
.section-desc { font-size: 12px; color: var(--text-soft); margin-top: .2rem; }

/* ─── Row items ─────────────────────────────────────────────────────────── */
.row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 0;
    border-bottom: 1px solid var(--border);
    gap: .75rem;
}
.row-item:last-child { border-bottom: none; }
.row-item strong { display: block; font-size: 13.5px; }
.row-item small { color: var(--text-soft); font-size: 11px; }
.row-nombre { font-size: 13.5px; font-weight: 500; }
.row-right { display: flex; align-items: center; gap: .5rem; }
.importe { font-weight: 700; font-size: 13.5px; white-space: nowrap; }

/* Espacio icon en config */
.espacio-icon {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ─── Botones ───────────────────────────────────────────────────────────── */
button, .btn-primary, .btn-secondary, .btn-danger, .btn-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
    font-family: inherit;
    letter-spacing: -.1px;
    white-space: nowrap;
}
button:active, .btn-primary:active { transform: scale(.97); }

.btn-primary {
    background: linear-gradient(135deg, #3a7de8 0%, #6fa8ff 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(58,125,232,.32), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(58,125,232,.5); opacity: .92; }
.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    background: linear-gradient(135deg, #2a4a7a 0%, #3a5a9a 100%);
    border: 1px solid rgba(255,255,255,.08);
}

.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border2);
}
.btn-secondary:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }

.btn-danger { background: rgba(248,113,113,.1); color: var(--danger); border: 1px solid rgba(248,113,113,.18); }
.btn-danger:hover { background: rgba(248,113,113,.2); border-color: rgba(248,113,113,.3); }

.btn-pdf {
    background: linear-gradient(135deg, #2563eb, #4f8ef7);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,99,235,.32);
}
.btn-pdf:hover { box-shadow: 0 6px 24px rgba(37,99,235,.5); opacity: .9; }

.btn-sm { padding: .38rem .9rem; font-size: 12px; }
.btn-xs { padding: .18rem .5rem; font-size: 11px; border-radius: 5px; }

/* ─── Modal ─────────────────────────────────────────────────────────────── */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 600;
    padding: 1rem;
    animation: fadeIn .15s ease;
}
.modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
    animation: slideUp .2s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-box h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ─── Formularios ───────────────────────────────────────────────────────── */
label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: .4px;
}
label input, label select {
    display: block; width: 100%; margin-top: .38rem;
    padding: .65rem 1rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
label select { appearance: auto; cursor: pointer; }
label select option { background: var(--bg2); }
label input:focus, label select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(99,102,241,.06);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.inline-form {
    display: flex; flex-wrap: wrap; gap: .5rem;
    margin-bottom: 1rem; align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(99,102,241,.04);
    border: 1px solid rgba(99,102,241,.12);
    border-radius: var(--radius-sm);
    animation: slideDown .15s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.inline-form input, .inline-form select {
    padding: .5rem .85rem;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-xs);
    font-size: 13px; color: var(--text);
    min-width: 110px; flex: 1;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.inline-form input:focus, .inline-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.inline-form select option { background: var(--bg2); }
.inline-form.hidden { display: none; }

/* ─── Empty state ───────────────────────────────────────────────────────── */
.empty {
    color: var(--text-soft);
    font-size: 14px;
    padding: 2.5rem 1rem;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.empty-icon { font-size: 2rem; opacity: .6; }
.empty-cta {
    margin-top: 0.25rem;
    font-size: 13px;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* ─── CTA vacío primer mes ──────────────────────────────────────────────── */
.empty-mes-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2.5rem 1rem;
    text-align: center;
    border: 1.5px dashed var(--border2);
    border-radius: 1rem;
    background: var(--surface);
}
.empty-mes-icon { font-size: 2.5rem; opacity: .7; }
.empty-mes-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; }
.empty-mes-sub { font-size: 0.85rem; color: var(--text-soft); margin: 0; }

/* ─── Banner PWA ─────────────────────────────────────────────────────────── */
#pwa-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(99,102,241,.12);
    border-bottom: 1px solid rgba(99,102,241,.25);
    padding: 0.6rem 1rem;
    font-size: 13px;
    color: var(--text);
}
#pwa-banner button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
#pwa-banner button:last-child {
    background: transparent;
    color: var(--muted);
    padding: 0.3rem 0.5rem;
}

/* ─── Pantalla Reparto ──────────────────────────────────────────────────── */
.reparto-wrap { max-width: 740px; margin: 0 auto; }
.reparto-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; }
.reparto-titulo { font-size: 1.7rem; font-weight: 900; letter-spacing: -.5px; }
.reparto-sub { color: var(--text-soft); font-size: 13px; margin-top: .2rem; }

/* Barra nómina */
.nomina-bar-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
}
.nomina-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem 0;
    font-size: 14px;
}
.nomina-bar-row.libre { margin-top: .5rem; }
.nb-label { color: var(--text-soft); font-size: 13.5px; }
.nb-val { font-weight: 700; }
.nb-libre { font-size: 1.5rem; font-weight: 900; color: var(--ok); letter-spacing: -.5px; }
.nomina-divider { height: 1px; background: var(--border); margin: .75rem 0; }
.nb-barra-bg {
    height: 8px;
    border-radius: 99px;
    background: rgba(255,255,255,.05);
    display: flex;
    overflow: hidden;
    margin-top: 1.1rem;
}
.nb-barra-gasto { background: var(--danger); transition: width .7s cubic-bezier(.4,0,.2,1); }
.nb-barra-cuota { background: var(--warning); transition: width .7s cubic-bezier(.4,0,.2,1); }
.nb-barra-libre { background: var(--ok); transition: width .7s cubic-bezier(.4,0,.2,1); flex: 1; }
.nb-barra-legend {
    display: flex; gap: 1.25rem;
    margin-top: .6rem;
    font-size: 11px;
    color: var(--text-soft);
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot-danger { background: var(--danger); box-shadow: 0 0 6px var(--danger-glow); }
.dot-warning { background: var(--warning); box-shadow: 0 0 6px var(--warn-glow); }
.dot-ok { background: var(--ok); box-shadow: 0 0 6px var(--ok-glow); }

/* Alertas reparto */
.alertas-wrap { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; }
.alerta {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .8rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
}
.alerta-danger { background: rgba(248,113,113,.07); border: 1px solid rgba(248,113,113,.2); }
.alerta-ok { background: rgba(52,211,153,.07); border: 1px solid rgba(52,211,153,.2); }
.alerta-icon { font-size: .95rem; flex-shrink: 0; margin-top: .1rem; }

/* Espacios reparto grid */
.reparto-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-soft);
    margin-bottom: 1rem;
    padding-left: 2px;
}
.espacios-reparto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
    margin-bottom: 5.5rem;
}
.espacio-reparto-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    border-left: 3px solid var(--ec, #6366f1);
    position: relative;
}
.espacio-reparto-card:focus-within {
    border-color: var(--ec, #6366f1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ec, #6366f1) 12%, transparent);
}
.erc-top { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.erc-emoji {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--ec, #6366f1) 15%, transparent);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.erc-info { flex: 1; }
.erc-nombre { display: block; font-size: 13.5px; font-weight: 700; }
.erc-proposito { font-size: 11.5px; color: var(--text-soft); }
.erc-input-wrap {
    display: flex; align-items: center;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.erc-input-wrap:focus-within {
    border-color: var(--ec, #6366f1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ec, #6366f1) 12%, transparent);
}
.erc-eur {
    padding: 0 .75rem;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-soft);
    border-right: 1px solid var(--border);
}
.erc-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: .7rem .9rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    font-family: inherit;
    letter-spacing: -.3px;
    min-width: 0;
}
.erc-input:focus { outline: none; }
.erc-input::-webkit-inner-spin-button,
.erc-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.erc-sugerido {
    width: 100%;
    margin-top: .75rem;
    padding: .45rem 1rem;
    background: color-mix(in srgb, var(--ec, #6366f1) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--ec, #6366f1) 25%, transparent);
    border-radius: var(--radius-xs);
    color: var(--accent2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    text-align: left;
}
.erc-sugerido:hover { background: color-mix(in srgb, var(--ec, #6366f1) 18%, transparent); }

/* Barra inferior reparto */
.reparto-resumen-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(10,20,40,.93);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border2);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    z-index: 100;
}
.rrb-item { text-align: right; }
.rrb-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-soft); }
.rrb-val { font-size: 1.1rem; font-weight: 800; }
.rrb-val.highlight { color: var(--ok); }
.bar-overbudget .rrb-val.highlight { color: var(--danger); }
.bar-overbudget #btn-confirmar { background: rgba(248,113,113,.15); color: var(--danger); box-shadow: none; cursor: not-allowed; }

/* ─── Gastos fijos (pantalla /gastos) ───────────────────────────────────── */
.gastos-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .85rem;
    margin-bottom: 2rem;
}
.resumen-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    transition: border-color var(--transition);
}
.resumen-card.resumen-total {
    border-color: rgba(99,102,241,.25);
    background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(99,102,241,.03));
}
.resumen-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-soft); }
.resumen-valor { font-size: 1.65rem; font-weight: 900; letter-spacing: -.5px; }

.gastos-grid { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }

.gasto-grupo {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: .5rem;
}
.gasto-grupo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem 1rem;
    background: rgba(255,255,255,.025);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border);
}
.gasto-grupo .row-item { border-radius: 0; border-left: none; border-right: none; border-top: none; padding: .7rem 1rem; }
.gasto-grupo .row-item:last-child { border-bottom: none; }

.cuotas-lista { display: flex; flex-direction: column; gap: .85rem; margin-top: .5rem; }
.cuota-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    transition: border-color var(--transition);
}
.cuota-card.cuota-aviso { border-color: rgba(251,191,36,.2); }
.cuota-card.cuota-alerta { border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.04); }
.cuota-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .9rem; }
.cuota-top strong { display: block; font-size: .95rem; font-weight: 700; }
.cuota-top small { color: var(--text-soft); font-size: 11px; }
.cuota-importes { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.cuota-total-badge {
    font-size: 10.5px;
    color: var(--text-soft);
    background: rgba(255,255,255,.05);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.cuota-barra-wrap {
    height: 5px;
    background: rgba(255,255,255,.06);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: .4rem;
}
.cuota-barra { height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.cuota-alerta .cuota-barra { background: var(--danger); }
.cuota-aviso .cuota-barra { background: var(--warning); }
.cuota-pct { font-size: 10.5px; color: var(--text-soft); text-align: right; }

/* ─── Barra visual mes ──────────────────────────────────────────────────── */
.mes-barra-wrap {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.mes-barra-bg {
    height: 10px;
    border-radius: 99px;
    background: rgba(52,211,153,.15);
    display: flex;
    overflow: hidden;
    margin-bottom: .7rem;
}
.mes-barra-seg { height: 100%; transition: width .7s cubic-bezier(.4,0,.2,1); }
.seg-gastos  { background: var(--danger); }
.seg-cuotas  { background: var(--warning); }
.seg-distrib { background: var(--accent); }
.mes-barra-legend {
    display: flex; gap: 1.25rem;
    font-size: 11px; color: var(--text-soft);
    flex-wrap: wrap;
}

/* ─── Skeleton loading ──────────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,.05) 25%,
        rgba(255,255,255,.1)  50%,
        rgba(255,255,255,.05) 75%
    );
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: var(--radius-sm);
}
.sk-text  { height: 14px; margin-bottom: .5rem; }
.sk-title { height: 28px; width: 55%; margin-bottom: .75rem; }
.sk-card  { height: 90px; border-radius: var(--radius); }
.sk-hero  { height: 48px; width: 45%; }

/* ─── prefers-reduced-motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); }

/* ─── Toggle Espacio de Entrada ─────────────────────────────────────────── */
.toggle-entrada-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    user-select: none;
    padding: .25rem .5rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}
.toggle-entrada-label:hover {
    background: rgba(99,102,241,.1);
    border-color: var(--accent);
}
.toggle-entrada-cb {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.toggle-entrada-txt {
    font-size: .78rem;
    color: var(--text-mid);
    transition: color var(--transition);
}
.toggle-entrada-cb:checked + .toggle-entrada-txt {
    color: var(--accent2);
    font-weight: 600;
}

/* Badge Espacio de entrada en cards del dashboard */
.entrada-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--accent2);
    background: var(--accent-glow);
    border: 1px solid rgba(99,102,241,.3);
    border-radius: 99px;
    padding: .15rem .55rem;
    margin-top: .35rem;
    letter-spacing: .02em;
}

/* ─── Timeline del mes ───────────────────────────────────────────────────── */
.gasto-rapido-wrap {
    display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
    background: rgba(255,255,255,.03); border-radius: 10px;
    padding: .75rem; margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.timeline-inicio {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--text-soft);
    padding: .4rem .2rem .6rem;
    border-bottom: 1px dashed var(--border);
    margin-bottom: .5rem;
}
.timeline-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem .25rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.timeline-pendiente { opacity: .55; }
.timeline-icono { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-nombre { font-size: 13px; font-weight: 500; color: var(--text); }
.timeline-dia { font-size: 11px; color: var(--text-soft); margin-left: .5rem; }
.timeline-right { text-align: right; flex-shrink: 0; }
.timeline-importe { font-size: 13px; font-weight: 600; display: block; }
.timeline-saldo { font-size: 11px; display: block; }
.timeline-hoy-sep {
    text-align: center; font-size: 11px; font-weight: 700;
    color: var(--accent); letter-spacing: .05em;
    padding: .5rem 0; margin: .4rem 0;
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
}

/* ─── Selector de meses de cobro ─────────────────────────────────────────── */
.meses-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .3rem;
    margin-bottom: .5rem;
}
.mes-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 600;
    padding: .35rem .2rem;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}
.mes-btn:hover { border-color: var(--accent); color: var(--text); }
.mes-btn-on {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px rgba(79,142,247,.4);
}

/* ── Alertas ─────────────────────────────────────────────────────────────── */
.alerta-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    margin-bottom: .75rem;
    border: 1px solid;
    animation: slideDown .3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alerta-duplicado {
    background: rgba(220,53,69,.08);
    border-color: rgba(220,53,69,.3);
}
.alerta-info {
    background: rgba(99,102,241,.08);
    border-color: rgba(99,102,241,.3);
}
.alerta-icono { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.alerta-body { flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.alerta-titulo { font-weight: 700; font-size: .95rem; color: var(--text); }
.alerta-msg { font-size: .85rem; color: var(--text-muted); }
.alerta-gastos { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; align-items: center; }
.alerta-gasto-tag {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .2rem .6rem;
    font-size: .8rem;
    color: var(--text);
}
.alerta-gasto-tag strong { color: var(--danger); }
.alerta-total { font-size: .82rem; font-weight: 700; color: var(--danger); margin-left: auto; }
.alerta-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 .2rem;
    line-height: 1;
    flex-shrink: 0;
}
.alerta-close:hover { color: var(--text); }

.alerta-warning {
    background: rgba(255,193,7,.08);
    border-color: rgba(255,193,7,.35);
}

/* ── Drawer rediseñado ───────────────────────────────────────────────────── */
.drawer-saldos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    padding: 1rem 1.2rem;
    background: var(--bg2);
    border-radius: 10px;
    margin: .75rem 0;
}
.drawer-saldo-box {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.drawer-edit-saldo-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: .75rem;
    padding: .2rem .5rem;
    cursor: pointer;
    margin-top: .3rem;
    width: fit-content;
}
.drawer-edit-saldo-btn:hover { color: var(--text); border-color: var(--border2); }
.drawer-edit-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .5rem 0;
    flex-wrap: wrap;
}
.drawer-edit-form input {
    width: 130px;
    padding: .4rem .6rem;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    color: var(--text);
    font-size: .9rem;
}
.drawer-edit-form input:focus,
.drawer-edit-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.drawer-section-title {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 1rem 0 .4rem;
}
.drawer-fijo-row {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    padding: .3rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid);
}

.drawer-fijos-resumen {
    display: flex; align-items: center; gap: .5rem;
    font-size: .87rem; font-weight: 600;
    padding: .4rem 0;
    cursor: pointer;
    color: var(--text);
}
.drawer-fijos-resumen:hover { opacity: .8; }
.drawer-fijos-toggle { font-size: .75rem; color: var(--text-muted); margin-left: auto; }
.drawer-fijos-detalle { padding: .2rem 0 .4rem; max-height: 180px; overflow-y: auto; }
.drawer-fijos-detalle.hidden { display: none; }
.drawer-fijo-row {
    display: flex; align-items: center; gap: .5rem;
    font-size: .82rem; padding: .3rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid);
}
.drawer-fijo-row span:first-child { flex: 1; }
.drawer-fijo-dia { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }
.drawer-fijo-row.fijo-cobrado { opacity: .55; }

.drawer-mov-del {
    background: none; border: none; cursor: pointer;
    font-size: .85rem; opacity: 0; transition: opacity .15s;
    padding: .1rem .3rem; border-radius: 4px; flex-shrink: 0;
}
.drawer-mov-row:hover .drawer-mov-del { opacity: 1; }
.drawer-mov-del:hover { background: var(--danger-glow); }

/* ── Campana de alertas ──────────────────────────────────────────────────── */
.alertas-bell {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(251,191,36,.08);
    border: 1px solid rgba(251,191,36,.25);
    border-radius: 20px;
    padding: .3rem .9rem;
    font-size: .82rem; font-weight: 600;
    color: var(--warning);
    cursor: pointer;
    transition: background var(--transition);
    margin-bottom: .5rem;
}
.alertas-bell:hover { background: rgba(251,191,36,.15); }
.alertas-count { color: var(--text); }
.alertas-arrow { font-size: .7rem; opacity: .7; }
#alertas-panel { margin-bottom: 1rem; }

/* ── Rentabilidad drawer ─────────────────────────────────────────────────── */
#drawer-rentabilidad { padding: .25rem 0 .5rem; }
.rent-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-top: .4rem;
}
.rent-box {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .6rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.rent-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.rent-val { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rent-val small { font-size: .75rem; font-weight: 600; }
