/* ========================================
   MIS FINANZAS — estilos
   Bosque (marca), menta (lo que entra),
   coral (deudas), ámbar (fondos y ahorro).
   ======================================== */

:root {
    --bosque: #0f3d2e;
    --bosque-2: #165a43;
    --menta: #2fb57a;
    --coral: #e5534b;
    --ambar: #f2a93b;
    --cielo: #5b8def;

    --bg: #eef3f0;
    --surface: #ffffff;
    --surface-2: #f5f8f6;
    --text: #15211c;
    --text-muted: #5f6f68;
    --border: #dfe7e3;
    --input-border: #c9d5cf;
    --ring-track: #e3ebe7;
    --button-bg: #e6eeea;
    --button-text: #15211c;
    --shadow: 0 1px 2px rgba(15, 61, 46, 0.06), 0 8px 24px rgba(15, 61, 46, 0.06);

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
    --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

    --nav-height: 68px;
}

body.dark {
    --bg: #0b1511;
    --surface: #12201a;
    --surface-2: #172821;
    --text: #e6efea;
    --text-muted: #94a89f;
    --border: #22362d;
    --input-border: #2f4a3e;
    --ring-track: #1d3029;
    --button-bg: #1e3229;
    --button-text: #e6efea;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
    font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    border: none;
    background: var(--button-bg);
    color: var(--button-text);
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.15s, transform 0.1s;
}

button:active {
    transform: scale(0.98);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--menta);
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

button.primary {
    background: var(--bosque);
    color: #ffffff;
}

body.dark button.primary {
    background: var(--menta);
    color: #06140e;
}

.full-width {
    width: 100%;
}

.hidden {
    display: none !important;
}


/* ---------- BARRA SUPERIOR ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--bosque);
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
}

.brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 4px;
}

#currentMonth {
    min-width: 132px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
}

.icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.lock-toggle {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 13px;
}

.lock-toggle.unlocked {
    background: var(--menta);
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.eye-toggle {
    position: relative;
    opacity: 0.85;
}

.eye-toggle.values-hidden::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    top: 50%;
    height: 2px;
    background: currentColor;
    transform: rotate(-20deg);
}

.sync-status {
    font-size: 15px;
    width: 30px;
    text-align: center;
}

.sync-status[data-state="subiendo"] {
    display: inline-block;
    animation: sync-spin 1s linear infinite;
}

@keyframes sync-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ---------- CONTENEDOR ---------- */

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px;
}


/* ---------- CORTE (anillo) ---------- */

.hero {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px 18px 18px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
}

.hero-ring-wrap {
    position: relative;
    width: min(270px, 78vw);
    aspect-ratio: 1;
}

.corte-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.corte-ring circle {
    fill: none;
    stroke-linecap: round;
}

.corte-ring .ring-segment {
    transition: stroke-dasharray 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 40px;
}

.hero-center span {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.hero-center strong {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(30px, 9vw, 40px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 4px 0;
}

.hero.deficit .hero-center strong {
    color: var(--coral);
}

.hero-center small {
    color: var(--text-muted);
    font-size: 13px;
}

.hero-legend {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.legend-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
    text-align: left;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-weight: 400;
}

button.legend-item:hover {
    background: var(--button-bg);
}

.legend-item i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    grid-row: 1;
}

.legend-item span {
    color: var(--text-muted);
    font-size: 13px;
}

.legend-item strong {
    grid-column: 2;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
}

.legend-item.income i { background: var(--menta); }
.legend-item.debts i { background: var(--coral); }
.legend-item.funds i { background: var(--ambar); }
.legend-item.savings i { background: var(--cielo); }

.status-banner {
    width: 100%;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--surface-2);
    font-size: 14px;
}

.status-banner p {
    margin-top: 2px;
    color: var(--text-muted);
}

.status-banner strong {
    color: var(--text);
}


/* ---------- TABLERO ---------- */

.dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 18px;
    min-width: 0;
}

.panel-head {
    margin-bottom: 14px;
}

.panel-head h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.panel-head p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}


/* Cuotas mes a mes */

.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 170px;
}

.trend-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    height: 100%;
    min-width: 0;
}

.trend-bar .bar {
    width: 100%;
    max-width: 38px;
    border-radius: 8px 8px 4px 4px;
    background: color-mix(in srgb, var(--coral) 35%, var(--surface));
    transition: height 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.trend-bar.current .bar {
    background: var(--coral);
}

.trend-bar .value {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.trend-bar .month {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.trend-bar.current .month {
    color: var(--text);
    font-weight: 700;
}


/* Categorías */

.category-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-row-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 5px;
}

.cat-row-head strong {
    font-weight: 700;
}

.cat-track {
    height: 9px;
    border-radius: 999px;
    background: var(--ring-track);
    overflow: hidden;
}

.cat-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}


/* Próximas a terminar */

.ending-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ending-item-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
}

.ending-item-head span {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ending-item-head em {
    font-style: normal;
    color: var(--text-muted);
    white-space: nowrap;
}

.ending-item .cat-track {
    margin-top: 6px;
}

.ending-item .cat-fill {
    background: var(--menta);
}

.ending-item small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}


/* Carro y moto */

.fuel-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.fuel-item {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    text-align: center;
}

.fuel-item .fuel-icon {
    font-size: 22px;
}

.fuel-item span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.fuel-item strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    margin-top: 2px;
}

.fuel-total {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}


/* Ahorro y fondos */

.savings-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.savings-block {
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.savings-block:first-child {
    background: color-mix(in srgb, var(--cielo) 12%, var(--surface));
}

.savings-block:last-child {
    background: color-mix(in srgb, var(--ambar) 16%, var(--surface));
}

.savings-block h2 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}

.saving-number {
    display: flex;
    align-items: center;
    gap: 4px;
}

.saving-number strong {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
}

.saving-caption {
    color: var(--text-muted);
    font-size: 12px;
}

.edit-link {
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    padding: 2px 6px;
    opacity: 0.7;
}

.edit-link:hover {
    opacity: 1;
    color: var(--text);
}

.inline-edit-input {
    width: 140px;
    padding: 6px 8px;
    font-size: 18px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}


/* ---------- LISTAS (ingresos, gastos, fondos, movimientos) ---------- */

.debt-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.debt-row:last-child {
    border-bottom: none;
}

.debt-row-info {
    min-width: 0;
}

.debt-row-info strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.debt-row-info span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 1px;
}

.debt-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.debt-row-actions button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 400;
}

.debt-row-actions button[class^="delete"]:hover {
    background: color-mix(in srgb, var(--coral) 20%, var(--surface));
    color: var(--coral);
}

.badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
    font-weight: 700;
    vertical-align: middle;
}

.badge.approx { background: #fdf0d5; color: #8a5a00; }
.badge.finished { background: #d6f3e5; color: #0d6b44; }
.badge.pending { background: #fde2e0; color: #a3261f; }

.budget-row,
.category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.budget-row:last-child,
.category-row:last-child {
    border-bottom: none;
}

.category-row button {
    padding: 4px 10px;
    font-size: 13px;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 18px 8px;
    font-size: 14px;
}


/* ---------- NAVEGACIÓN INFERIOR ---------- */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding: 6px 6px env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.nav-item {
    background: none;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.nav-item .nav-icon {
    font-size: 19px;
    line-height: 1;
}

.nav-item.active {
    color: var(--bosque);
}

body.dark .nav-item.active {
    color: var(--menta);
}

.nav-item:hover {
    background: var(--surface-2);
}


/* ---------- COPIA DE SEGURIDAD ---------- */

.backup-footer {
    position: relative;
    text-align: center;
    margin-top: 22px;
}

.backup-link {
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
}

.backup-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    min-width: 160px;
}

.backup-menu button {
    background: none;
    text-align: left;
    padding: 9px 10px;
    font-size: 14px;
    font-weight: 500;
}

.backup-menu button:hover {
    background: var(--surface-2);
}


/* ---------- VENTANAS ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(8, 20, 15, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
    position: relative;
    animation: sheet-up 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes sheet-up {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
}

.modal-content-wide {
    max-width: 760px;
    display: flex;
    flex-direction: column;
}

.modal-content h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 16px;
    padding-right: 36px;
}

.debts-scroll-area {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(92vh - 190px);
}

.close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    font-size: 20px;
    font-weight: 400;
}

.modal-content label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    margin-top: 5px;
    padding: 11px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font-weight: 400;
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
}

.modal-content textarea {
    resize: vertical;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
}

.modal-content input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--bosque);
}

.modal-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 14px;
    font-weight: 400;
}

.optional-tag {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-row label {
    flex: 1;
}


/* ---------- EXTRACTOS ---------- */

.drop-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 16px;
    margin-bottom: 12px;
    border: 2px dashed var(--input-border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    font-weight: 400;
}

.drop-zone strong {
    font-weight: 600;
}

.drop-zone-icon {
    font-size: 24px;
}

.drop-zone span:last-child {
    color: var(--text-muted);
    font-size: 13px;
}

.statement-status {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 14px;
}

.statement-status.error {
    background: #fde2e0;
    color: #a3261f;
}

.api-key-steps {
    margin: 0 0 14px 18px;
    font-size: 14px;
    color: var(--text-muted);
}

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

.import-chip {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.import-chip span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.import-chip strong {
    font-size: 15px;
}

.import-month {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.modal-content .import-month select {
    width: auto;
    margin-top: 0;
}

.import-section h3 {
    font-family: var(--font-display);
    font-size: 16px;
    margin: 16px 0 2px;
}

.import-section > p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.import-row {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.import-row:last-child {
    border-bottom: none;
}

.import-row.excluded .import-info {
    opacity: 0.45;
}

.import-info {
    flex: 1;
    min-width: 0;
}

.import-info strong {
    display: block;
    font-size: 14px;
}

.import-info > span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
}

.import-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.modal-content .import-controls select {
    width: auto;
    max-width: 100%;
    margin-top: 0;
    padding: 6px 8px;
    font-size: 13px;
}

.import-notes {
    background: #fdf0d5;
    color: #8a5a00;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}


/* ---------- INICIO DE SESIÓN ---------- */

.sync-login {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--bosque);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sync-login-card {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.sync-login-card img {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin: 0 auto 4px;
}

.sync-login-card h2 {
    font-family: var(--font-display);
    font-size: 22px;
}

.sync-login-card p {
    color: var(--text-muted);
    font-size: 14px;
}

.sync-login-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
}

.sync-login-error {
    color: var(--coral);
    font-size: 14px;
    min-height: 18px;
}


/* ---------- PANTALLAS GRANDES ---------- */

@media (min-width: 760px) {

    .hero {
        grid-template-columns: auto 1fr;
        justify-items: stretch;
        align-items: center;
        padding: 26px 30px;
        gap: 30px;
    }

    .hero-ring-wrap {
        width: 270px;
        grid-row: 1 / span 2;
    }

    .hero-legend {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel-wide {
        grid-column: 1 / -1;
    }

    .modal {
        align-items: center;
        padding: 20px;
    }

    .modal-content {
        border-radius: var(--radius-lg);
        max-height: calc(100vh - 40px);
    }

    .bottom-nav {
        left: 50%;
        right: auto;
        bottom: 16px;
        transform: translateX(-50%);
        width: 520px;
        height: var(--nav-height);
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: 22px;
        box-shadow: var(--shadow);
    }
}

@media (max-width: 420px) {

    .topbar {
        grid-template-columns: auto 1fr auto;
        padding-left: 12px;
        padding-right: 8px;
    }

    .brand span {
        display: none;
    }

    #currentMonth {
        min-width: 0;
        flex: 1;
        font-size: 13px;
        white-space: nowrap;
    }

    .icon-button {
        width: 32px;
    }

    .month-selector {
        justify-self: center;
    }

    .savings-section {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}


/* ---------- MENÚ DE LA ESQUINA ---------- */

.menu-button {
    font-size: 20px;
}

.app-menu {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(8, 20, 15, 0.35);
}

.app-menu-panel {
    position: absolute;
    top: calc(56px + env(safe-area-inset-top));
    right: 12px;
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 80px - env(safe-area-inset-top));
    overflow-y: auto;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 50px rgba(8, 20, 15, 0.3);
    padding: 8px;
    transform-origin: top right;
    animation: menu-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
}

.menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--border);
}

.menu-head img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.menu-head strong {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
}

.menu-head span {
    color: var(--text-muted);
    font-size: 12px;
}

.menu-section {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.menu-section:last-child {
    border-bottom: none;
}

.menu-section h3 {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px 2px;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: left;
    font-weight: 500;
    font-size: 15px;
}

.menu-item:hover {
    background: var(--surface-2);
}

.menu-icon {
    width: 24px;
    text-align: center;
    font-size: 17px;
}

.menu-label {
    flex: 1;
}

.menu-hint {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.menu-item.danger {
    color: var(--coral);
}

.menu-switch {
    width: 40px;
    height: 24px;
    border-radius: 999px;
    background: var(--ring-track);
    position: relative;
    transition: background-color 0.2s;
}

.menu-switch i {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
}

.menu-switch.on {
    background: var(--menta);
}

.menu-switch.on i {
    transform: translateX(16px);
}

.menu-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.menu-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--menta);
}

.menu-sync-subiendo .menu-sync-dot {
    background: var(--ambar);
}

.menu-sync-pendiente .menu-sync-dot {
    background: var(--coral);
}

.restore-button {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 420px) {

    .app-menu-panel {
        right: 8px;
        left: 8px;
        width: auto;
    }
}


/* ========================================
   ESTILO STELNET
   (encabezado morado, menú lateral, tarjetas
   con borde fino, números monoespaciados)
   ======================================== */

:root {
    --bg: #f4f5fa;
    --surface: #ffffff;
    --surface-2: #f6f7fb;
    --text: #1c2033;
    --text-muted: #6b7090;
    --border: #e4e7f0;
    --input-border: #d5d9e6;
    --ring-track: #eceef5;
    --button-bg: #eef0f6;
    --button-text: #1c2033;
    --shadow: none;

    --marca-1: #150d3a;
    --marca-2: #2a1763;
    --acento: #4f5bd5;

    --radius-lg: 14px;
    --radius-md: 12px;
    --radius-sm: 10px;

    --font-display: "Manrope", system-ui, sans-serif;
    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-num: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

    --sidebar-width: 232px;
    --topbar-height: 64px;
}

body.dark {
    --bg: #0c0f1c;
    --surface: #141828;
    --surface-2: #1a1f33;
    --text: #e8eaf4;
    --text-muted: #9097b5;
    --border: #252b42;
    --input-border: #323a57;
    --ring-track: #232a40;
    --button-bg: #1f2540;
    --button-text: #e8eaf4;
}

button.primary {
    background: var(--marca-2);
}

body.dark button.primary {
    background: var(--acento);
    color: #ffffff;
}


/* Encabezado */

.topbar {
    display: flex;
    justify-content: space-between;
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 18px 0;
    background: linear-gradient(90deg, var(--marca-1), var(--marca-2));
}

.brand {
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
}

.brand-text strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.brand-text span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #9ee7ff;
    opacity: 0.85;
}

.header-right {
    gap: 10px;
}

.square-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 15px;
}

.square-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.avatar-button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee, #5b6cf0);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.sync-status {
    font-size: 0;
    width: auto;
    display: inline-flex;
    align-items: center;
}

.sync-status::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.sync-status[data-state="subiendo"] {
    animation: none;
}

.sync-status[data-state="subiendo"]::before {
    background: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}

.sync-status[data-state="pendiente"]::before {
    background: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}


/* Menú lateral */

.sidebar {
    display: none;
}


/* Título de la página y mes */

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
}

.page-head h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.today-label {
    font-family: var(--font-num);
    font-size: 12px;
    color: var(--text-muted);
}

.page-head .month-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
}

.page-head #currentMonth {
    font-family: var(--font-display);
    font-weight: 700;
    min-width: 150px;
    white-space: nowrap;
}

.month-arrow {
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border-radius: 8px;
    font-size: 18px;
    color: var(--text);
}

.month-arrow:hover {
    background: var(--surface-2);
}

.lock-toggle {
    background: var(--surface-2);
    color: var(--text);
}


/* Tarjetas */

.hero,
.panel {
    box-shadow: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.panel-head h2,
.savings-block h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
}

.legend-item {
    background: var(--surface);
    border: 1px solid var(--border);
}

.legend-item strong,
.hero-center strong,
.saving-number strong,
.cat-row-head strong,
.fuel-item strong,
.trend-bar .value,
.import-chip strong {
    font-family: var(--font-num);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.legend-item strong {
    font-size: 18px;
}

.hero-center {
    padding: 0 34px;
}

.hero-center strong {
    font-size: clamp(22px, 7vw, 28px);
    white-space: nowrap;
}

.corte-ring circle {
    stroke-width: 14;
}

.status-banner {
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.trend-bar .bar {
    background: color-mix(in srgb, var(--acento) 28%, var(--surface));
}

.trend-bar.current .bar {
    background: var(--acento);
}

.ending-item .cat-fill {
    background: #22c55e;
}

.savings-block:first-child,
.savings-block:last-child {
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.nav-item.active,
body.dark .nav-item.active {
    color: var(--acento);
}

body.dark .nav-item.active {
    color: #8b95ff;
}

.sync-login {
    background: linear-gradient(135deg, var(--marca-1), var(--marca-2));
}


/* Computador: menú lateral fijo, sin barra de abajo */

@media (min-width: 1000px) {

    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 2px;
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        padding: 16px 10px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        overflow-y: auto;
        z-index: 10;
    }

    .sidebar h4 {
        font-size: 12px;
        font-weight: 600;
        color: var(--text-muted);
        padding: 16px 12px 6px;
    }

    .side-item {
        display: flex;
        align-items: center;
        gap: 12px;
        background: none;
        text-align: left;
        padding: 10px 12px;
        border-radius: 10px;
        font-weight: 500;
        font-size: 15px;
        color: var(--text);
    }

    .side-item span {
        width: 18px;
        text-align: center;
        color: var(--text-muted);
    }

    .side-item:hover {
        background: var(--surface-2);
    }

    .side-item.active {
        background: color-mix(in srgb, var(--acento) 12%, var(--surface));
        color: var(--acento);
        font-weight: 700;
    }

    body.dark .side-item.active {
        color: #a5adff;
    }

    .side-item.active span {
        color: inherit;
    }

    .container {
        margin-left: var(--sidebar-width);
        max-width: none;
        padding: 22px 32px;
    }

    .container > * {
        max-width: 1100px;
    }

    .bottom-nav {
        display: none;
    }

    body {
        padding-bottom: 24px;
    }
}

@media (max-width: 420px) {

    .brand-text span {
        display: none;
    }

    .page-head .month-selector {
        width: 100%;
        justify-content: space-between;
    }
}


/* ========================================
   DISEÑO STELNET (valores de app.stelnet.net)
   ======================================== */

:root {
    --bg: #F2F4FA;
    --surface: #FFFFFF;
    --surface-2: #F2F4FA;
    --text: #12142B;
    --text-muted: #5C6178;
    --border: #E1E3F0;
    --input-border: #E1E3F0;
    --ring-track: #ECEEF6;
    --button-bg: #FFFFFF;
    --button-text: #12142B;

    --brand: #2F6FED;
    --brand-deep: #17399E;
    --brand-wash: #E9EFFE;
    --ok: #2F8F5B;
    --ok-wash: #E5F4EC;
    --bad: #C1462F;
    --bad-wash: #FBEAE5;
    --amber: #E8952E;
    --amber-wash: #FCEFDC;
    --topbar-grad: linear-gradient(120deg, #0A0F3D 0%, #170B4D 55%, #240A4F 100%);

    /* colores de la app de finanzas, con los tonos de STELNET */
    --menta: var(--ok);
    --coral: var(--bad);
    --ambar: var(--amber);
    --cielo: var(--brand);
    --acento: var(--brand);

    --radius-lg: 10px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --topbar-height: 64px;
    --nav-height: 64px;
}

body.dark {
    --bg: #0B0D17;
    --surface: #171A28;
    --surface-2: #11131F;
    --text: #EDEEF6;
    --text-muted: #9599B3;
    --border: #2B2E42;
    --input-border: #2B2E42;
    --ring-track: #232638;
    --button-bg: #171A28;
    --button-text: #EDEEF6;

    --brand: #5B8CFF;
    --brand-deep: #8FB0FF;
    --brand-wash: #1B2A4D;
    --ok: #4CC98A;
    --ok-wash: #16301F;
    --bad: #E37460;
    --bad-wash: #3A1E1A;
    --amber: #F0AC55;
    --amber-wash: #3B2C16;
}

body {
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--brand);
    color: #ffffff;
}


/* Botones como los de STELNET */

button {
    font-weight: 700;
    border-radius: 7px;
}

.modal-content button:not(.close):not(.primary):not(.menu-item),
.restore-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

button.primary,
body.dark button.primary {
    background: var(--brand);
    border: 1px solid var(--brand);
    color: #ffffff;
}


/* Barra superior */

.topbar {
    background: var(--topbar-grad);
    height: auto;
    min-height: calc(58px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 18px 0;
    z-index: 40;
}

.brand {
    gap: 10px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.brand-text strong {
    font-size: 18px;
    font-weight: 800;
}

.brand-text span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.62);
    opacity: 1;
}

.header-right {
    gap: 8px;
}

.square-button,
.theme-toggle.square-button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    opacity: 1;
}

.square-button svg {
    width: 17px;
    height: 17px;
}

.square-button:hover {
    background: rgba(255, 255, 255, 0.18);
}

.eye-toggle.values-hidden::after {
    left: 7px;
    right: 7px;
}

.avatar-button {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3F8BFF, #2F6FED 55%, #5B4BE0);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.sync-status::before {
    width: 7px;
    height: 7px;
    background: #4CD08A;
    box-shadow: none;
}

.sync-status[data-state="subiendo"]::before {
    background: #F0AC55;
    box-shadow: none;
}

.sync-status[data-state="pendiente"]::before {
    background: #F1786A;
    box-shadow: none;
}


/* Título de la sección */

.section-head {
    align-items: flex-end;
    margin: 0 0 16px;
}

.section-head h1 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.section-head .count {
    font-family: var(--font-num);
    font-size: 12.5px;
    color: var(--text-muted);
}

.page-head .month-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
}

.page-head #currentMonth {
    font-size: 14px;
    font-weight: 800;
}


/* Tarjetas */

.hero,
.panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.panel {
    padding: 16px;
}

.panel-head {
    margin-bottom: 10px;
}

.panel-head h2,
.savings-block h2 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.panel-head p {
    font-size: 12.5px;
    margin-top: 3px;
}

.legend-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 14px 12px;
}

.legend-item span {
    font-size: 11.5px;
}

.legend-item strong {
    font-family: var(--font-num);
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-deep);
}

.hero.deficit .hero-center strong {
    color: var(--bad);
}

.hero-center span,
.hero-center small {
    font-size: 12.5px;
}

.status-banner {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
}

.cat-row-head {
    font-size: 13px;
}

.cat-row-head strong,
.ending-item-head em,
.fuel-item strong,
.saving-number strong {
    font-family: var(--font-num);
}

.cat-row-head strong,
.saving-number strong {
    color: var(--text);
    font-weight: 600;
}

.cat-track {
    height: 7px;
}

.ending-item .cat-fill {
    background: var(--ok);
}

.trend-bar .bar {
    border-radius: 6px 6px 3px 3px;
    background: color-mix(in srgb, var(--brand) 22%, var(--surface));
}

.trend-bar.current .bar {
    background: var(--brand);
}

.trend-bar .value,
.trend-bar .month {
    font-family: var(--font-num);
    font-size: 10.5px;
}

.fuel-item,
.savings-block:first-child,
.savings-block:last-child {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.debt-row {
    padding: 11px 0;
}

.debt-row-info strong {
    font-size: 14px;
    font-weight: 800;
}

.debt-row-info span {
    font-size: 12.5px;
}

.debt-row-actions button {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.badge.approx { background: var(--amber-wash); color: var(--amber); }
.badge.finished { background: var(--ok-wash); color: var(--ok); }
.badge.pending { background: var(--bad-wash); color: var(--bad); }


/* Menú lateral (rail) */

@media (min-width: 900px) {

    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 2px;
        position: fixed;
        top: calc(58px + env(safe-area-inset-top));
        left: 0;
        bottom: 0;
        width: 232px;
        padding: 18px 12px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        z-index: 10;
    }

    .rail-group-label {
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        padding: 16px 12px 6px;
    }

    .side-item {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 10px 12px;
        border-radius: 8px;
        background: none;
        border: none;
        color: var(--text-muted);
        font-weight: 600;
        font-size: 14px;
        text-align: left;
    }

    .side-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .side-item:hover {
        background: var(--bg);
        color: var(--text);
    }

    .side-item.active,
    body.dark .side-item.active {
        background: var(--brand-wash);
        color: var(--brand-deep);
        font-weight: 600;
    }

    .container {
        margin-left: 232px;
        padding: 28px 32px 40px;
    }

    .container > * {
        max-width: 960px;
    }

    .bottom-nav {
        display: none;
    }
}


/* Barra de abajo (tabbar) */

.bottom-nav {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: auto;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 0 env(safe-area-inset-bottom);
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: var(--surface);
}

.nav-item {
    border-radius: 0;
    padding: 9px 4px 8px;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.nav-item .nav-icon svg {
    width: 21px;
    height: 21px;
}

.nav-item:hover {
    background: none;
}

.nav-item.active,
body.dark .nav-item.active {
    color: var(--brand-deep);
}


/* Ventanas: hoja que sube en el celular, caja en el computador */

.modal {
    background: rgba(10, 14, 30, 0.5);
}

.modal-content {
    border-radius: 16px 16px 0 0;
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
}

.modal-content::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 4px auto 14px;
}

.modal-content h2 {
    font-size: 16px;
    font-weight: 800;
}

.modal-content label {
    font-size: 13px;
    font-weight: 700;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 15px;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
    border-color: var(--border);
}

@media (min-width: 760px) {

    .modal-content {
        border-radius: 14px;
        padding: 22px 20px 18px;
        box-shadow: 0 20px 60px rgba(10, 14, 30, 0.35);
    }

    .modal-content::before {
        display: none;
    }
}


/* Menú de la esquina */

.app-menu {
    background: rgba(10, 14, 30, 0.35);
}

.app-menu-panel {
    top: calc(62px + env(safe-area-inset-top));
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(10, 14, 30, 0.35);
}

.menu-head img {
    border-radius: 10px;
}

.menu-head strong {
    font-weight: 800;
}

.menu-section h3 {
    font-size: 11px;
    font-weight: 700;
}

.menu-item {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.menu-item:hover {
    background: var(--bg);
}

.menu-icon {
    display: inline-flex;
    justify-content: center;
    color: var(--text-muted);
}

.menu-icon svg {
    width: 18px;
    height: 18px;
}

.menu-item.danger,
.menu-item.danger .menu-icon {
    color: var(--bad);
}

.menu-switch {
    background: #C7CBD6;
}

body.dark .menu-switch {
    background: #3C4160;
}

.menu-switch.on,
body.dark .menu-switch.on {
    background: var(--brand);
}

.menu-sync-dot {
    background: var(--ok);
}

.menu-sync-subiendo .menu-sync-dot {
    background: var(--amber);
}

.menu-sync-pendiente .menu-sync-dot {
    background: var(--bad);
}


/* Inicio de sesión (como login.html de STELNET) */

.sync-login {
    background: var(--topbar-grad);
    padding: 24px;
}

.sync-login-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 36px 28px 28px;
    max-width: 340px;
    gap: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.sync-login-card img {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    margin: 0 auto 2px;
}

.sync-login-card h2 {
    font-size: 22px;
    font-weight: 800;
}

.sync-login-card p {
    font-size: 12.5px;
    margin-bottom: 12px;
}

.sync-login-card input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 14px;
    font-size: 15px;
    text-align: center;
}

.sync-login-card input:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.sync-login-card button {
    padding: 12px;
    font-size: 14px;
}

.sync-login-error:empty {
    display: none;
}

.sync-login-error {
    font-size: 12.5px;
    color: var(--bad);
    background: var(--bad-wash);
    border-radius: 7px;
    padding: 8px 10px;
    min-height: 0;
}


/* Avisos de extractos */

.import-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.import-notes {
    background: var(--amber-wash);
    color: var(--amber);
}

.statement-status.error {
    background: var(--bad-wash);
    color: var(--bad);
}

.drop-zone {
    background: var(--bg);
    border-color: var(--border);
    border-radius: 10px;
}

/* v2.6.0 — leyenda sin desbordar en celular */
.hero-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-legend, .hero-legend > *, .financial-status, #financialStatus { min-width: 0; max-width: 100%; box-sizing: border-box; }
.legend-item strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 520px) {
  .legend-item { padding: 12px 10px 10px; }
  .legend-item strong { font-size: clamp(14px, 4.4vw, 18px); }
}
