/* ==========================================================================
   Mis Finanzas — estilos
   Todo color sale de variables: el tema (claro/oscuro/auto) y el acento se
   eligen con data-theme / data-accent en <html> (ver includes/ui.php).
   ========================================================================== */

/* --- Acentos: valor para tema claro (-l) y para tema oscuro (-d) --- */
:root, [data-accent="azul"]    { --accent-l: #2563eb; --accent-d: #60a5fa; }
[data-accent="verde"]          { --accent-l: #047857; --accent-d: #34d399; }
[data-accent="violeta"]        { --accent-l: #7c3aed; --accent-d: #a78bfa; }
[data-accent="naranja"]        { --accent-l: #c2410c; --accent-d: #fb923c; }
[data-accent="rosa"]           { --accent-l: #be185d; --accent-d: #f472b6; }
[data-accent="grafito"]        { --accent-l: #334155; --accent-d: #94a3b8; }

/* --- Tema claro (por defecto) --- */
:root {
    --bg: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef1f6;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --border: #e3e8ef;
    --border-strong: #cbd5e1;
    --primary: var(--accent-l);
    --on-primary: #ffffff;
    --primary-soft: color-mix(in srgb, var(--primary) 11%, transparent);
    --ingreso: #15803d;
    --ingreso-soft: #dcfce7;
    --ingreso-ink: #166534;
    --egreso: #dc2626;
    --egreso-soft: #fee2e2;
    --egreso-ink: #991b1b;
    --warn-soft: #fef3c7;
    --warn-ink: #92400e;
    --btn-danger: #dc2626;
    --btn-success: #15803d;
    --sidebar-bg: #0f172a;
    --sidebar-ink: #cbd5e1;
    --sidebar-muted: #64748b;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 6px rgba(15, 23, 42, .04);
    --shadow-lg: 0 14px 34px rgba(15, 23, 42, .16);
    --chart-grid: #e5e9f0;
    --chart-axis: #64748b;
    --chart-a: #94a3b8;
    --chart-b: var(--primary);
    --radius: 14px;
    --radius-sm: 10px;
    color-scheme: light;
}

/* --- Tema oscuro (se repite para "auto" con sistema en oscuro) --- */
[data-theme="oscuro"] {
    --bg: #0b1020; --surface: #121a2b; --surface-2: #162034; --surface-3: #1d2940;
    --text: #e7eaf0; --text-2: #c3cad6; --muted: #8d97a9; --border: #233049; --border-strong: #33425f;
    --primary: var(--accent-d); --on-primary: #0b1020;
    --ingreso: #4ade80; --ingreso-soft: rgba(74, 222, 128, .14); --ingreso-ink: #86efac;
    --egreso: #f87171; --egreso-soft: rgba(248, 113, 113, .14); --egreso-ink: #fca5a5;
    --warn-soft: rgba(251, 191, 36, .14); --warn-ink: #fcd34d;
    --sidebar-bg: #080c18; --sidebar-ink: #c3cad6; --sidebar-muted: #6b7690; --sidebar-hover: rgba(255, 255, 255, .05);
    --shadow: 0 1px 0 rgba(255, 255, 255, .02); --shadow-lg: 0 14px 34px rgba(0, 0, 0, .5);
    --chart-grid: #233049; --chart-axis: #8d97a9; --chart-a: #64748b;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg: #0b1020; --surface: #121a2b; --surface-2: #162034; --surface-3: #1d2940;
        --text: #e7eaf0; --text-2: #c3cad6; --muted: #8d97a9; --border: #233049; --border-strong: #33425f;
        --primary: var(--accent-d); --on-primary: #0b1020;
        --ingreso: #4ade80; --ingreso-soft: rgba(74, 222, 128, .14); --ingreso-ink: #86efac;
        --egreso: #f87171; --egreso-soft: rgba(248, 113, 113, .14); --egreso-ink: #fca5a5;
        --warn-soft: rgba(251, 191, 36, .14); --warn-ink: #fcd34d;
        --sidebar-bg: #080c18; --sidebar-ink: #c3cad6; --sidebar-muted: #6b7690; --sidebar-hover: rgba(255, 255, 255, .05);
        --shadow: 0 1px 0 rgba(255, 255, 255, .02); --shadow-lg: 0 14px 34px rgba(0, 0, 0, .5);
        --chart-grid: #233049; --chart-axis: #8d97a9; --chart-a: #64748b;
        color-scheme: dark;
    }
}

/* --- Colores de tarjetas (bolsillos, cuentas, muestras) --- */
.c-violeta { --g1: #5b21b6; --g2: #a855f7; }
.c-azul    { --g1: #1e40af; --g2: #38bdf8; }
.c-verde   { --g1: #065f46; --g2: #34d399; }
.c-naranja { --g1: #c2410c; --g2: #f59e0b; }
.c-rojo    { --g1: #991b1b; --g2: #f43f5e; }
.c-rosa    { --g1: #9d174d; --g2: #f472b6; }
.c-grafito { --g1: #0f172a; --g2: #64748b; }
.c-dorado  { --g1: #78350f; --g2: #eab308; }

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 650; margin: 0 0 8px; }
.icon { flex-shrink: 0; vertical-align: -3px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); }

/* ==========================================================================
   Estructura: barra lateral + contenido
   ========================================================================== */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 50;
    display: flex; flex-direction: column; gap: 10px;
    padding: 18px 14px; overflow-y: auto;
    background: var(--sidebar-bg); color: var(--sidebar-ink);
}
.sb-brand { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 750; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-logo {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-l), var(--accent-d)); color: #fff;
}
.brand-logo-sm { width: 30px; height: 30px; border-radius: 9px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--sidebar-ink); font-size: 14px; font-weight: 500;
}
.sb-nav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sb-nav a.active { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.sb-footer { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sidebar-muted); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.seg button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 4px; border: 0; border-radius: 8px; background: none; cursor: pointer;
    color: var(--sidebar-ink); font: inherit; font-size: 10.5px;
}
.seg button:hover { background: rgba(255, 255, 255, .06); }
.seg button.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.accent-row { display: flex; gap: 8px; margin-top: 10px; padding: 0 2px; }
.accent-row button {
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer; padding: 0;
    background: var(--sw); border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset;
}
.accent-row button.active { border-color: var(--sidebar-bg); box-shadow: 0 0 0 2px #fff; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0; font-size: 13px; }
.sb-username { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; font-size: 13px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    border: 0; background: none; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: var(--sidebar-hover); text-decoration: none; }
.sb-close { display: none; }
.sb-backdrop { display: none; }

.app { margin-left: 248px; min-height: 100vh; }
.app-plain { margin-left: 0; }
.mobilebar, .fab { display: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; }

.login-wrap { max-width: 380px; margin: 10vh auto; padding: 0 16px; }
.login-wrap h1 { text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ==========================================================================
   Componentes
   ========================================================================== */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h1, .card-head h2 { margin: 0; }
.card-muted { opacity: .6; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 20px; }

.stat-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-card .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.stat-card .label .icon { color: var(--muted); }
.stat-card .value { font-size: 25px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-card .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-card.ingreso .value { color: var(--ingreso); }
.stat-card.egreso .value { color: var(--egreso); }
.stat-card .value.positive { color: var(--ingreso); }
.stat-card .value.negative { color: var(--egreso); }
.stat-icon {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
    background: var(--surface-3); color: var(--text-2);
}
.stat-card.ingreso .stat-icon { background: var(--ingreso-soft); color: var(--ingreso); }
.stat-card.egreso .stat-icon { background: var(--egreso-soft); color: var(--egreso); }
.stat-card.balance .stat-icon { background: var(--primary-soft); color: var(--primary); }
.stat-card.hero { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.stat-link { color: inherit; display: block; transition: border-color .15s, transform .15s; }
.stat-link:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
thead tr th:first-child { border-top-left-radius: 8px; }
thead tr th:last-child { border-top-right-radius: 8px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-compact th, .table-compact td { padding: 8px 8px; font-size: 13px; white-space: nowrap; }
tr.row-paid td { color: var(--muted); }
tr.row-paid td strong { color: var(--text); }

.amount { font-variant-numeric: tabular-nums; font-weight: 650; }
.amount.ingreso { color: var(--ingreso); }
.amount.egreso { color: var(--egreso); }

.badge, .pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
    background: var(--surface-3); color: var(--text-2); vertical-align: middle; white-space: nowrap;
}
.badge.ingreso, .pill-ok { background: var(--ingreso-soft); color: var(--ingreso-ink); }
.badge.egreso { background: var(--egreso-soft); color: var(--egreso-ink); }
.pill-ok { font-size: 12px; padding: 3px 10px; }
.pill-wallet { background: var(--warn-soft); color: var(--warn-ink); }
.pill-late { background: var(--egreso-soft); color: var(--egreso-ink); }
.pill-card { background: var(--primary-soft, var(--surface-3)); color: var(--text-2); }
.pill-card .icon { margin-right: 1px; }
a.pill:hover { text-decoration: none; filter: brightness(.97); }
.tag-color { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }

/* --- Formularios --- */
form .field { margin-bottom: 14px; }
label { display: block; margin-bottom: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search],
input[type=file], select, textarea {
    width: 100%; padding: 9px 11px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font: inherit; font-size: 14px; background: var(--surface); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
input[disabled] { opacity: .55; }
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type=checkbox] { width: auto; accent-color: var(--primary); }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
label.radio { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 14px; margin: 0; cursor: pointer; }
label.radio input { width: auto; margin: 0; accent-color: var(--primary); }
.input-group { display: flex; }
.input-group select { width: auto; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; background: var(--surface-2); }
.input-group input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.inline-form { display: flex; align-items: center; gap: 6px; margin: 0; flex-wrap: nowrap; }
input.input-sm, select.input-sm { padding: 5px 8px; font-size: 13px; width: auto; border-radius: 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.filters .field { margin-bottom: 0; min-width: 140px; }

/* --- Botones --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--primary); color: var(--on-primary);
    border: 1px solid transparent; padding: 9px 16px; border-radius: var(--radius-sm);
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.btn-secondary { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.btn.btn-secondary:hover { filter: none; background: var(--border); }
.btn.btn-danger { background: var(--btn-danger); color: #fff; }
.btn.btn-ingreso { background: var(--btn-success); color: #fff; }
.btn.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-link-dark { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; font: inherit; font-size: 12px; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* --- Avisos --- */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.flash-success { background: var(--ingreso-soft); color: var(--ingreso-ink); }
.flash-error { background: var(--egreso-soft); color: var(--egreso-ink); }
.flash-info { background: var(--primary-soft); color: var(--text); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }

/* --- Barras y gráficos --- */
.bar { background: var(--surface-3); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-fill { background: var(--egreso); height: 8px; border-radius: 999px; }
.bar-fill.bar-invest { background: var(--primary); }
.chart-wrap { overflow-x: auto; }
.chart-legend { display: flex; gap: 16px; font-size: 13px; margin-top: 10px; flex-wrap: wrap; color: var(--text-2); }
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.ch-grid { stroke: var(--chart-grid); stroke-width: 1; }
.ch-axis { font-size: 11px; fill: var(--chart-axis); }
.ch-zero { stroke: var(--chart-axis); stroke-width: 1; stroke-dasharray: 4 3; }
.line-chart { display: block; max-width: 1000px; }
.line-chart .ch-line-a { stroke: var(--chart-a); stroke-width: 2; stroke-dasharray: 6 4; }
.line-chart .ch-line-b { stroke: var(--chart-b); stroke-width: 2.5; }
.line-chart .ch-line-a-dot { fill: var(--chart-a); stroke: var(--surface); stroke-width: 2; }
.line-chart .ch-line-b-dot { fill: var(--chart-b); stroke: var(--surface); stroke-width: 2; }
.line-chart .ch-label { font-size: 12px; fill: var(--text-2); }
.line-chart .ch-label-b { font-weight: 700; }
.line-chart .ch-hit { fill: transparent; }
.line-chart .ch-hit:hover { fill: color-mix(in srgb, var(--primary) 7%, transparent); }

/* --- Vista mensual --- */
.month-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.month-nav h1 { margin: 0; min-width: 190px; text-align: center; }

/* --- Buscador de tablas --- */
.table-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.table-search input[type=search] {
    flex: 1 1 240px; max-width: 360px; padding-left: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 11px center;
}
.table-search select { width: auto; }
.table-search .search-count { font-size: 12px; color: var(--muted); }

/* --- Cotizaciones --- */
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.rate { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.rate-active { border-color: var(--primary); background: var(--primary-soft); }
.rate-name { font-size: 12px; color: var(--muted); font-weight: 600; }
.rate-val { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; margin: 2px 0; }
.rate-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ingreso); display: inline-block; animation: live-pulse 2s infinite; }
.live-dot.is-stale { background: #f59e0b; animation: none; }
@keyframes live-pulse { 50% { opacity: .35; } }
.flash-update { animation: flash-update 1.2s ease-out; }
@keyframes flash-update { from { background: var(--warn-soft); } to { background: transparent; } }

/* --- Simulador --- */
.scenario-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.scenario-tabs .inline-form { margin-left: auto; }
.item-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ==========================================================================
   Bolsillos: tarjeta prepaga y voucher
   ========================================================================== */
.wallet-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); margin-bottom: 20px; }
.wcard {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
    padding: 18px 20px; border-radius: 18px; color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
        linear-gradient(135deg, var(--g1), var(--g2));
    box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--g1) 70%, transparent);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
}
.wcard::after { /* círculos decorativos */
    content: ""; position: absolute; z-index: -1; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255, 255, 255, .09); box-shadow: -70px -30px 0 -20px rgba(255, 255, 255, .06);
}
.wcard-tarjeta { aspect-ratio: 1.586 / 1; max-width: 400px; }
.wc-top { display: flex; align-items: center; gap: 8px; }
.wc-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .18); }
.wc-name { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-chip {
    width: 38px; height: 28px; border-radius: 6px;
    background: linear-gradient(135deg, #fde68a, #d97706 60%, #fbbf24);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
    background-image:
        linear-gradient(90deg, transparent 32%, rgba(0, 0, 0, .18) 33%, transparent 35%, transparent 64%, rgba(0, 0, 0, .18) 65%, transparent 67%),
        linear-gradient(0deg, transparent 46%, rgba(0, 0, 0, .18) 48%, transparent 52%),
        linear-gradient(135deg, #fde68a, #d97706 60%, #fbbf24);
}
.wc-wave { opacity: .8; transform: rotate(90deg); display: inline-flex; }
.wc-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.wc-balance { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wc-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: 12.5px; opacity: .92; }
.wc-kind { font-weight: 800; letter-spacing: .18em; font-size: 11px; opacity: .85; }

/* Voucher: ticket con muescas laterales y talón punteado */
.wcard-voucher {
    padding-left: 92px; min-height: 150px; border-radius: 14px;
    -webkit-mask: radial-gradient(circle 11px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle 11px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
            mask: radial-gradient(circle 11px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle 11px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.wcard-voucher::before { content: ""; position: absolute; left: 74px; top: 12px; bottom: 12px; border-left: 2px dashed rgba(255, 255, 255, .45); }
.wcard-voucher .wc-stamp {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .12);
}
.wcard-voucher .wc-icon { display: none; }
.wcard-compact.wcard-tarjeta { aspect-ratio: auto; min-height: 150px; }
.wcard-compact .wc-balance { font-size: 23px; }
a.wcard:hover { text-decoration: none; filter: brightness(1.05); }
.wcard-credit .wc-chip { margin-left: auto; }
.wc-number { font-variant-numeric: tabular-nums; letter-spacing: .08em; }

.wallet-block { margin-bottom: 26px; }
.wallet-block-head { display: grid; grid-template-columns: minmax(260px, 400px) 1fr; gap: 20px; align-items: start; }
.wallet-side { display: flex; flex-direction: column; gap: 10px; }

/* Selector de color */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { margin: 0; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); transition: transform .1s; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); transform: scale(1.06); }
.swatch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 3px; }
.look-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.look-option { position: relative; margin: 0; cursor: pointer; }
.look-option input { position: absolute; opacity: 0; }
.look-option .look-box { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 600; color: var(--text); }
.look-option input:checked + .look-box { border-color: var(--primary); background: var(--primary-soft); }

/* ==========================================================================
   Inversiones: cuentas y "billetes" por moneda
   ========================================================================== */
.acc-head { display: flex; align-items: center; gap: 12px; }
.acc-badge { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); flex-shrink: 0; }
.acc-total { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bills { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.bill {
    --b1: #334155; --b2: #64748b;
    position: relative; overflow: hidden; isolation: isolate;
    padding: 16px 18px; border-radius: 14px; color: #fff;
    background:
        repeating-radial-gradient(circle at 88% 30%, rgba(255, 255, 255, .07) 0 1.5px, transparent 1.5px 9px),
        linear-gradient(135deg, var(--b1), var(--b2));
    box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--b1) 80%, transparent);
}
.bill::before { /* marco interior tipo billete */
    content: ""; position: absolute; inset: 7px; z-index: -1; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .28);
}
.bill-seal {
    position: absolute; right: 14px; top: 12px; z-index: -1;
    display: grid; place-items: center; min-width: 58px; height: 58px; padding: 0 8px; border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .35); font-weight: 800; font-size: 20px; color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .08);
}
.bill-desc { font-weight: 700; font-size: 14px; padding-right: 74px; }
.bill-meta { font-size: 11.5px; opacity: .8; padding-right: 74px; }
.bill-qty { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 2px; font-variant-numeric: tabular-nums; }
.bill-values { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; opacity: .95; font-variant-numeric: tabular-nums; }
.bill-values span { white-space: nowrap; }
.bill-values .muted { color: rgba(255, 255, 255, .7); }
.bill-actions { display: flex; gap: 6px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.bill input.input-sm { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; width: 130px; }
.bill input.input-sm::placeholder { color: rgba(255, 255, 255, .6); }
.bill .btn-sm { background: rgba(255, 255, 255, .92); color: #0f172a; border: 0; }
.bill .bill-edit { color: #fff; opacity: .85; font-size: 12px; text-decoration: underline; }
.cur-usd  { --b1: #14532d; --b2: #3f8f4f; }
.cur-ars  { --b1: #0c4a6e; --b2: #4aa3d8; }
.cur-eur  { --b1: #1e3a8a; --b2: #4f6fd1; }
.cur-brl  { --b1: #14532d; --b2: #a16207; }
.cur-usdt { --b1: #115e59; --b2: #26a17b; }
.cur-usdc { --b1: #1e3a8a; --b2: #2775ca; }
.cur-btc  { --b1: #9a3412; --b2: #f7931a; }
.cur-eth  { --b1: #312e81; --b2: #627eea; }
.cur-gen  { --b1: #334155; --b2: #64748b; }
.cur-usd .bill-seal { font-family: Georgia, "Times New Roman", serif; }

/* ==========================================================================
   Celular y tablet
   ========================================================================== */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); width: 280px; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open { overflow: hidden; }
    .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(2, 6, 23, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
    body.nav-open .sb-backdrop { opacity: 1; pointer-events: auto; }
    .sb-close { display: inline-grid; }
    .app { margin-left: 0; }
    .mobilebar {
        position: sticky; top: 0; z-index: 30;
        display: flex; align-items: center; gap: 10px;
        padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
        background: color-mix(in srgb, var(--surface) 88%, transparent);
        backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
        border-bottom: 1px solid var(--border);
        color: var(--text);
    }
    .mobilebar .icon-btn:hover { background: var(--surface-3); }
    .mobilebar-title { flex: 1; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .fab {
        display: grid; place-items: center; position: fixed; z-index: 35;
        right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
        width: 56px; height: 56px; border-radius: 18px;
        background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg);
    }
    .container { padding: 18px 16px 96px; }
    .wallet-block-head { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    body { font-size: 15px; }
    h1 { font-size: 21px; }
    /* Evita el zoom automático de iOS al enfocar campos */
    input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], select, textarea { font-size: 16px; }
    input.input-sm, select.input-sm { font-size: 15px; }
    .card { padding: 16px; border-radius: 12px; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 13px 14px; }
    .stat-card .value { font-size: 19px; }
    .stat-icon { display: none; }
    .month-nav { justify-content: space-between; }
    .month-nav h1 { order: -1; width: 100%; min-width: 0; text-align: left; }
    .filters .field { flex: 1 1 140px; min-width: 0; }
    .inline-form { flex-wrap: wrap; }
    .scenario-tabs .inline-form { margin-left: 0; width: 100%; }
    .scenario-tabs .inline-form input { flex: 1; }
    .table-search input[type=search] { max-width: none; }
    .bills, .wallet-grid { grid-template-columns: 1fr; }

    /* Tablas "stack": cada fila pasa a ser una ficha con etiquetas (las pone app.js) */
    table.stack thead { display: none; }
    table.stack, table.stack tbody { display: block; }
    table.stack tr {
        display: flex; flex-direction: column; gap: 2px;
        padding: 12px 14px; margin-bottom: 10px;
        border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    }
    table.stack tbody tr:hover td { background: none; }
    table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
    table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex-shrink: 0; }
    table.stack td[data-label=""]::before { content: none; }
    table.stack td.cell-main { order: -1; display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
    table.stack td.cell-main::before { content: none; }
    table.stack td[colspan] { display: block; text-align: left; }
    table.stack td[colspan]::before { content: none; }
    table.stack td:empty { display: none; }
    table.stack td .inline-form { justify-content: flex-end; }
}
.cat { white-space: nowrap; }
@media (max-width: 720px) {
    table.stack td { white-space: normal; }
    table.stack td.cell-main { overflow-wrap: anywhere; }
}

/* ==========================================================================
   Cuentas, planes y suscripción (versión multiusuario)
   ========================================================================== */
.btn-block { width: 100%; justify-content: center; }
.btn.btn-mp { background: #009ee3; color: #fff; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-2 > .card { margin-bottom: 0; }
.field.grow { flex: 1; min-width: 200px; }
.positive { color: var(--ingreso); }
.negative { color: var(--egreso); }

.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); margin-bottom: 20px; }
.login-brand:hover { text-decoration: none; }
.auth-title { font-size: 21px; margin: 0 0 12px; }
.auth-center { text-align: center; }
.auth-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); margin-bottom: 8px; }
.auth-links { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 18px; font-size: 14px; }
.login-legal { text-align: center; margin-top: 8px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 16px; cursor: pointer; }
.check-row input { margin-top: 3px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.sb-account { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; padding: 4px; border-radius: 10px; }
.sb-account:hover, .sb-account.active { background: var(--sidebar-hover); text-decoration: none; }
.sb-who { display: flex; flex-direction: column; min-width: 0; }
.sb-plan { display: inline-block; width: max-content; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: rgba(148, 163, 184, .18); color: var(--muted); }
.sb-user .sb-plan { color: var(--sidebar-ink); }
.sb-plan.plan-active, .sb-plan.plan-admin, .sb-plan.plan-free { background: var(--ingreso-soft); color: var(--ingreso-ink); }
.sb-plan.plan-trial { background: var(--primary-soft); color: var(--primary); }
.sb-plan.plan-cancelled { background: var(--warn-soft); color: var(--warn-ink); }
.sb-plan.plan-expired { background: var(--egreso-soft); color: var(--egreso-ink); }
h1 .sb-plan { vertical-align: middle; font-size: 13px; }

.plan-banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 18px; border-radius: var(--radius-sm);
    background: var(--warn-soft); color: var(--warn-ink); font-size: 14px; }
.plan-banner:hover { text-decoration: none; filter: brightness(.98); }
.plan-banner-cta { margin-left: auto; font-weight: 700; white-space: nowrap; }

.plan-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.plan-status .actions { margin-top: 0; }
.plan-status-name { font-size: 22px; font-weight: 800; margin: 2px 0 4px; }
.plan-status-expired { border-color: color-mix(in srgb, var(--egreso) 40%, var(--border)); }
.plan-status-active { border-color: color-mix(in srgb, var(--ingreso) 40%, var(--border)); }

.pricing { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
.pricing-pay { grid-column: 1 / -1; margin-bottom: 0; }
.price-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; cursor: pointer;
    background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.price-card input { position: absolute; opacity: 0; }
.price-card:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.price-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.price-name { font-weight: 600; color: var(--muted); }
.price-amount { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.price-amount small { font-size: 14px; font-weight: 500; color: var(--muted); }
.price-badge { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--ingreso-soft); color: var(--ingreso-ink); }
.feature-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature-list li { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.feature-list .icon { color: var(--ingreso); flex: none; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { border-color: color-mix(in srgb, var(--egreso) 35%, var(--border)); }
.card h2 .icon { vertical-align: -3px; color: var(--muted); }

@media (max-width: 720px) {
    .pricing { grid-template-columns: 1fr; }
    .plan-banner { flex-wrap: wrap; }
}

/* ==========================================================================
   Landing pública
   ========================================================================== */
.lp { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.lp-nav .login-brand { margin: 0; white-space: nowrap; }
.lp-nav-links { display: flex; gap: 8px; align-items: center; }
.lp-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 48px 0 56px; }
.lp-hero h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 16px; }
.lp-hero p { font-size: 18px; color: var(--text-2); line-height: 1.55; margin: 0 0 24px; }
.lp-hero .actions { margin-top: 0; }
.lp-hero .btn { padding: 12px 22px; font-size: 16px; }
.lp-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.lp-install { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; font-size: 14px; }
.lp-mock { display: grid; gap: 12px; }
.lp-mock .stat-card { margin: 0; }
.lp-mock .wcard { width: 100%; max-width: 340px; aspect-ratio: auto; min-height: 200px; justify-self: end; }
.lp-section { padding: 48px 0; }
.lp-section h2 { font-size: 28px; letter-spacing: -.02em; text-align: center; margin: 0 0 8px; }
.lp-section > p { text-align: center; color: var(--muted); margin: 0 0 32px; }
.lp-features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.lp-feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.lp-feature .stat-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); margin-bottom: 12px; }
.lp-feature h3 { margin: 0 0 6px; font-size: 17px; }
.lp-feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.lp-pricing { max-width: 720px; margin: 0 auto; }
.lp-pricing .price-card { cursor: default; }
.lp-footer { border-top: 1px solid var(--border); padding: 24px 0 40px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; color: var(--muted); font-size: 13px; }
.lp-footer a { color: var(--muted); }
.legal { max-width: 760px; margin: 0 auto; padding: 0 20px 48px; line-height: 1.6; }
.legal h1 { margin-top: 8px; }
@media (max-width: 860px) {
    .lp-hero { grid-template-columns: 1fr; padding-top: 24px; }
    .lp-mock .wcard { justify-self: start; }
}
@media (max-width: 420px) {
    .lp { padding: 0 16px; }
    .lp-nav .login-brand { font-size: 17px; gap: 8px; }
    .lp-nav-links .btn-secondary { display: none; }
    .lp-hero .actions .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Gráficos (includes/charts.php): colores por rol, validados para daltonismo
   y contraste en claro y oscuro. Marcas finas, grilla de 1px, tooltip por mes.
   ========================================================================== */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-muted: #898781; --viz-grid: #e7eaee; --viz-base: #c3c8d0; }
[data-theme="oscuro"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-grid: #233049; --viz-base: #3a4864; }
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-grid: #233049; --viz-base: #3a4864; }
}
.viz { position: relative; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.viz-col path { transition: opacity .12s; }
.viz-dim path { opacity: .45; }
.viz-hit { fill: transparent; cursor: default; outline: none; }
.viz-hit:hover, .viz-hit:focus-visible { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.viz-ref { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.viz-ref-label { font-size: 11.5px; font-weight: 600; fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line-proj { opacity: .45; }
.viz-area { opacity: .1; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-end-label { font-size: 12px; font-weight: 650; fill: var(--text); }
.viz-cross { stroke: var(--viz-base); stroke-width: 1; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-table { margin-top: 8px; font-size: 12.5px; }
.viz-table summary { cursor: pointer; color: var(--muted); }
.viz-tip {
    position: fixed; z-index: 60; pointer-events: none; min-width: 150px; max-width: 260px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 24px -8px rgba(15, 23, 42, .25); padding: 8px 10px; font-size: 12.5px;
}
.viz-tip-title { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; }
.viz-tip-row b { font-variant-numeric: tabular-nums; margin-left: auto; }
.viz-tip-row i { width: 12px; height: 2px; border-radius: 2px; flex-shrink: 0; }
.spark { display: block; }
.spark path { fill: none; stroke: var(--viz-muted); stroke-width: 1.5; stroke-linejoin: round; }
.spark circle { fill: var(--viz-1); }
.num { font-variant-numeric: tabular-nums; }
.delta-up { color: var(--egreso-ink); }
.delta-down { color: var(--ingreso-ink); }
.kpi-note { font-size: 12px; color: var(--muted); }
.viz-cross[hidden] { display: none; }
.grid-tight { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stat-card.hero-wide { grid-column: span 2; }
.stat-card.hero-wide .value { font-size: 36px; white-space: nowrap; }
@media (max-width: 720px) { .stat-card.hero-wide { grid-column: 1 / -1; } .stat-card.hero-wide .value { font-size: 30px; } }
.bar-fill.bar-viz { background: var(--viz-1); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 7px 0; color: inherit; font-size: 13.5px; }
a.rank-row:hover { text-decoration: none; }
a.rank-row:hover .rank-name { color: var(--primary); }
.rank-row .bar { grid-column: 1 / -1; }
.row-selected td { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.num { white-space: nowrap; }
.stat-card .value { white-space: nowrap; font-size: clamp(19px, 1.9vw, 25px); }
/* Listas compactas de Inicio (por pagar, últimos movimientos): no se cortan en el celular. */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.item-list .il-date { flex: 0 0 auto; min-width: 46px; color: var(--muted); }
.item-list .il-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item-list .il-amount { flex: 0 0 auto; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-list .il-amount.ingreso { color: var(--ingreso); }
.item-list .il-amount.egreso { color: var(--egreso); }
.item-list li.il-total { border-bottom: 0; font-weight: 700; }
.inline-form:has(.next-dates) { flex-wrap: wrap; }
.next-dates { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
