/* ============================================
   MIS GASTOS — Tema oscuro elegante
   Paleta: grafito profundo + dorado champagne
   Layout: una columna centrada (máx 560px), header con total del mes,
   tabs segmentados, contenido por pestaña, FAB y bottom sheet
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    color-scheme: dark;
    --bg: #0a0b0e;
    --surface: #14161c;
    --surface-2: #1b1e26;
    --border: #262a34;
    --text: #edeff4;
    --muted: #8a91a0;
    --gold: #e8c468;
    --gold-2: #c9a24b;
    --gold-light: #f5e3ae;
    --gold-soft: rgba(232, 196, 104, 0.12);
    --on-gold: #14161c;
    --danger: #f87171;
    --radius: 16px;
    --gold-gradient: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 45%, var(--gold-2) 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(900px 400px at 50% -10%, rgba(232, 196, 104, 0.07), transparent 60%),
        var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}

/* ---------- HEADER ---------- */
.header {
    padding: calc(28px + env(safe-area-inset-top, 0px)) 8px 20px;
    text-align: center;
}

.header-label {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.header-total {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(120deg, var(--gold-light) 0%, var(--gold) 45%, var(--gold-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-sub {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
    text-transform: capitalize;
}

/* ---------- BANNER DE EJEMPLO ---------- */
.demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--gold-soft);
    border: 1px solid rgba(232, 196, 104, 0.3);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--gold);
}

.demo-banner button {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(232, 196, 104, 0.4);
    border-radius: 8px;
    color: var(--gold);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
}

/* ---------- TABS (segmented control) ---------- */
.tabs {
    position: sticky;
    top: calc(10px + env(safe-area-inset-top, 0px));
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 4px 0 18px;
    padding: 4px;
    background: rgba(20, 22, 28, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 14px;
    isolation: isolate;
}

.tab-btn {
    position: relative;
    z-index: 2;
    padding: 10px 6px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 11px;
    transition: color 0.25s ease;
}

.tab-btn.active {
    color: var(--on-gold);
}

.tab-glider {
    position: absolute;
    z-index: 1;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 3);
    border-radius: 11px;
    background: var(--gold-gradient);
    box-shadow: 0 2px 10px rgba(232, 196, 104, 0.25);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.tabs[data-active="estadisticas"] .tab-glider { transform: translateX(100%); }
.tabs[data-active="notas"] .tab-glider { transform: translateX(200%); }

/* ---------- TAB CONTENT ---------- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- LISTA DE GASTOS ---------- */
.lista-gastos {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grupo-fecha {
    margin: 14px 4px 2px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.grupo-fecha:first-child {
    margin-top: 0;
}

.gasto-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.gasto-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

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

.gasto-titulo {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gasto-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    min-width: 0;
}

.gasto-meta span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gasto-monto {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Botón borrar (gastos, notas, categorías) */
.btn-borrar {
    flex-shrink: 0;
    height: 32px;
    min-width: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--muted);
    border: none;
    border-radius: 9px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-borrar:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

.btn-borrar.confirmando {
    color: var(--on-gold);
    background: var(--danger);
    padding: 0 10px;
}

.vacio {
    text-align: center;
    color: var(--muted);
    padding: 48px 20px;
    font-size: 14px;
}

.vacio-icon {
    display: block;
    font-size: 26px;
    color: var(--gold);
    margin-bottom: 12px;
}

.vacio-hint {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.7;
}

/* ---------- ESTADÍSTICAS ---------- */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-card {
    background:
        radial-gradient(400px 160px at 20% 0%, rgba(232, 196, 104, 0.1), transparent 70%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.stat-label {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-amount {
    font-size: 36px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gold);
}

.stat-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0 6px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    font-size: 14px;
    color: var(--muted);
}

.stat-row strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 6px 4px 0;
}

.section-hint {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    margin: -6px 4px 0;
}

.categorias-stats {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.categorias-stats .vacio {
    padding: 20px;
}

.categoria-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.categoria-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.categoria-nombre {
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.categoria-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.categoria-monto {
    font-weight: 600;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.categoria-pct {
    font-size: 12px;
    color: var(--muted);
    margin-left: 6px;
}

.categoria-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}

.categoria-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Lista "Mis categorías" */
.categorias-lista {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 14px 4px 18px;
}

.cat-fila {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    border-bottom: 1px solid var(--border);
}

.cat-fila:last-child {
    border-bottom: none;
}

.cat-fila-nombre {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-tag {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
}

/* ---------- NOTAS ---------- */
.nota-composer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.nota-composer textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.45;
}

.nota-composer textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.nota-composer textarea::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.nota-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nota-estado {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--muted);
}

.lista-notas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nota {
    padding: 14px 12px 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: slideIn 0.3s ease;
}

.nota-texto {
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding-right: 4px;
}

.nota-pie {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.nota-fecha {
    font-size: 12px;
    color: var(--muted);
}

.nota-botones {
    display: flex;
    align-items: center;
    gap: 2px;
}

.btn-editar {
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--gold);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 10px;
    cursor: pointer;
}

/* ---------- BOTÓN FLOTANTE ---------- */
.fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: max(24px, env(safe-area-inset-right, 0px), calc(50% - 264px));
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--gold-gradient);
    color: var(--on-gold);
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(232, 196, 104, 0.35), 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
    z-index: 15;
}

.fab:active {
    transform: scale(0.93);
}

body[data-tab="notas"] .fab {
    display: none;
}

/* ---------- MODAL (bottom sheet) ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 8, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 20;
    animation: fadeIn 0.25s ease;
}

.modal.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    width: 100%;
    max-width: 560px;
    border-radius: 24px 24px 0 0;
    padding: 12px max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 92vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    margin: 0 auto 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-sub {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.btn-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: var(--muted);
}

/* ---------- FORM ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-group label,
.form-group .label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 13px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-group input::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.form-error {
    display: none;
    margin-top: 8px;
    font-size: 13px;
    color: var(--danger);
}

.form-error.visible {
    display: block;
}

.monto-wrap {
    position: relative;
}

.monto-symbol {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-weight: 600;
    font-size: 18px;
    pointer-events: none;
}

.monto-group input {
    padding-left: 34px;
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Chips de categoría */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    --chip-color: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.chip.activo {
    border-color: var(--chip-color);
    background: color-mix(in srgb, var(--chip-color) 18%, var(--surface-2));
    box-shadow: inset 0 0 0 1px var(--chip-color);
}

.chip-nueva {
    background: transparent;
    border-style: dashed;
    color: var(--gold);
    font-weight: 600;
}

/* Panel nueva categoría */
.nueva-cat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.nueva-cat-fila {
    display: flex;
    gap: 8px;
}

.form-group .cat-emoji {
    width: 58px;
    flex-shrink: 0;
    padding: 13px 6px;
    text-align: center;
}

.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.swatch.activo {
    border-color: var(--text);
}

.nueva-cat-acciones {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

/* ---------- BOTONES ---------- */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 13px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-sm {
    flex: none;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 11px;
}

.btn-primary {
    background: var(--gold-gradient);
    color: var(--on-gold);
    box-shadow: 0 4px 14px rgba(232, 196, 104, 0.25);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-text {
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px;
    cursor: pointer;
}

/* ---------- RESPONSIVE / ACCESIBILIDAD ---------- */
@media (max-width: 380px) {
    .header-total { font-size: 38px; }
    .stat-amount { font-size: 30px; }
    .tab-btn { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- PANTALLA DE PIN ---------- */
body.bloqueado {
    overflow: hidden;
}

body.bloqueado .fab {
    display: none;
}

.pin-screen {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background:
        radial-gradient(700px 360px at 50% 0%, rgba(232, 196, 104, 0.1), transparent 65%),
        var(--bg);
    overflow-y: auto;
}

.pin-screen[hidden] {
    display: none;
}

.pin-box {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pin-logo {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 16px;
}

.pin-titulo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.pin-sub {
    margin-top: 6px;
    font-size: 14px;
    color: var(--muted);
}

.pin-dots {
    display: flex;
    gap: 14px;
    justify-content: center;
    min-height: 14px;
    margin: 26px 0 10px;
}

.pin-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1.5px solid var(--muted);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pin-dot.lleno {
    background: var(--gold);
    border-color: var(--gold);
}

.pin-error {
    min-height: 20px;
    font-size: 13px;
    color: var(--danger);
    margin-bottom: 14px;
}

.pin-teclado {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.pin-teclado.deshabilitado {
    opacity: 0.4;
    pointer-events: none;
}

.pin-tecla {
    aspect-ratio: 1.35;
    max-width: 100%;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 26px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.pin-tecla:active {
    background: var(--surface-2);
    transform: scale(0.96);
}

.pin-tecla-sec {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    font-size: 22px;
}

.pin-tecla-ok {
    background: var(--gold-gradient);
    border-color: transparent;
    color: var(--on-gold);
    font-size: 24px;
    font-weight: 700;
}

/* ---------- BOTÓN BLOQUEAR ---------- */
.header {
    position: relative;
}

.btn-bloquear {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.btn-bloquear:active {
    color: var(--gold);
}

/* ---------- GASTO EDITABLE ---------- */
.gasto-item {
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.gasto-item:hover {
    border-color: rgba(232, 196, 104, 0.35);
}

.gasto-item:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- AVISO ---------- */
.aviso {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 40;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 11px 16px;
    border-radius: 12px;
    background: #2a1517;
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.25s ease;
}

.aviso-ok {
    background: #1f1b10;
    border-color: rgba(232, 196, 104, 0.45);
    color: var(--gold-light);
}

.aviso[hidden] {
    display: none;
}

/* ---------- EDITAR CATEGORÍAS ---------- */
.label-fila {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.label-fila .label {
    margin-bottom: 0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--gold);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 2px;
    cursor: pointer;
}

.chip-x {
    margin-left: 2px;
    font-size: 11px;
    color: var(--danger);
}

.chips.editando .chip {
    border-style: dashed;
    border-color: rgba(248, 113, 113, 0.45);
}

.chip.confirmando {
    background: var(--danger);
    border-color: var(--danger);
    border-style: solid;
    color: var(--on-gold);
    font-weight: 600;
}
