[hidden] { display: none !important; }
:root {
  --fondo: #f2f4f8;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --texto: #0f172a;
  --suave: #64748b;
  --linea: #e5e9f0;
  --primario: #0f172a;
  --primario-txt: #ffffff;
  --acento: #10b981;
  --acento-2: #0ea5e9;
  --marca: linear-gradient(135deg, #10b981, #0ea5e9);
  --bien: #059669;
  --justo: #d97706;
  --mal: #e11d48;
  --gasto: #f43f5e;
  --radio: 20px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -12px rgba(15, 23, 42, .14);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0a0f1c;
    --panel: #111a2b;
    --panel-2: #0e1625;
    --texto: #e6eaf2;
    --suave: #8e9bb2;
    --linea: #1f2a40;
    --primario: #e6eaf2;
    --primario-txt: #0a0f1c;
    --bien: #10b981;
    --mal: #fb7185;
    --gasto: #fb7185;
    --sombra: 0 1px 0 rgba(255, 255, 255, .02), 0 10px 30px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(1100px 520px at 105% -8%, color-mix(in srgb, var(--acento-2) 11%, transparent), transparent 62%),
    radial-gradient(900px 480px at -8% -6%, color-mix(in srgb, var(--acento) 10%, transparent), transparent 60%),
    var(--fondo);
  background-attachment: fixed;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1 { font-size: 1.55rem; margin: .2rem 0 .4rem; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.02rem; margin: 0 0 .7rem; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: .85rem; }
.suave { color: var(--suave); }
.pequeno { font-size: .8rem; }
.centro { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pos { color: var(--bien); }
.neg { color: var(--mal); }
.sub { margin: 2px 0 0; color: var(--suave); font-size: .82rem; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Cabecera móvil ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--fondo) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--linea) 60%, transparent);
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -.01em; }
.marca small { display: block; font-weight: 500; color: var(--suave); font-size: .74rem; letter-spacing: 0; }
.logo {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--marca); color: #fff; font-weight: 800; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .7);
}
.logo.grande { width: 68px; height: 68px; border-radius: 20px; font-size: 2rem; margin: 0 auto 14px; }
.quien { display: flex; gap: 4px; }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 700; font-size: .85rem; flex: none;
}
.avatar.yo { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--c); }
.avatar.mini { width: 20px; height: 20px; font-size: .65rem; }

/* ---------- Menú lateral (solo ordenador) ---------- */
.lateral { display: none; }

.contenido { max-width: 680px; margin: 0 auto; padding: 6px 16px 28px; }

/* ---------- Tarjetas y avisos ---------- */
.tarjeta {
  background: var(--panel); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 18px; margin: 14px 0; border: 1px solid var(--linea);
}
.titulo-fila { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.titulo-fila h2 { margin: 0; }
.titulo-fila > a { font-size: .82rem; color: var(--suave); font-weight: 600; text-decoration: none; padding: 4px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--linea); }
.titulo-fila > a:hover { color: var(--texto); }
.aviso { padding: 11px 15px; border-radius: 14px; margin: 10px 0; font-size: .92rem; font-weight: 500; border: 1px solid transparent; }
.aviso.ok { background: color-mix(in srgb, var(--bien) 12%, var(--panel)); border-color: color-mix(in srgb, var(--bien) 25%, transparent); }
.aviso.error { background: color-mix(in srgb, var(--mal) 12%, var(--panel)); border-color: color-mix(in srgb, var(--mal) 25%, transparent); }
.pildora { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; color: var(--suave); background: var(--panel-2); border: 1px solid var(--linea); white-space: nowrap; }

/* ---------- Selector de mes ---------- */
.mes-sel {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 6px auto 4px; width: fit-content;
  background: var(--panel); border: 1px solid var(--linea); border-radius: 999px; padding: 4px; box-shadow: var(--sombra);
}
.mes-sel a, .mes-sel .off {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  text-decoration: none; font-size: 1.3rem; line-height: 1; color: var(--suave);
}
.mes-sel a:hover { background: var(--panel-2); color: var(--texto); }
.mes-sel .off { opacity: .3; }
.mes-sel strong { min-width: 140px; text-align: center; font-size: .98rem; }

/* ---------- Cabecera del panel ---------- */
.panel-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 8px 0 16px; }
.panel-cab h1 { margin: 0; font-size: 1.45rem; }
.panel-cab h1::first-letter { text-transform: uppercase; }
.saludo { margin: 0; color: var(--suave); font-weight: 500; font-size: .92rem; }
.panel-acc { display: flex; align-items: center; gap: 12px; }
.panel-acc .mes-sel { margin: 0; }
.solo-escritorio { display: none !important; }

/* ---------- Rejilla del panel ---------- */
.panel { display: flex; flex-direction: column; gap: 14px; }
.panel > .tarjeta, .columna > .tarjeta { margin: 0; }
.columna { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Estado del mes ---------- */
.estado {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  border-radius: var(--radio); padding: 20px; color: #fff;
  background: linear-gradient(140deg, #334155, #1e293b);
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .55);
}
.estado::before, .estado::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; }
.estado::before { width: 260px; height: 260px; right: -90px; top: -110px; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); }
.estado::after { width: 220px; height: 220px; left: -80px; bottom: -120px; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%); }
.estado.bien { background: linear-gradient(140deg, #047857, #0d9488 55%, #0284c7); box-shadow: 0 18px 40px -18px rgba(13, 148, 136, .7); }
.estado.justo { background: linear-gradient(140deg, #b45309, #ea580c 60%, #f59e0b); box-shadow: 0 18px 40px -18px rgba(234, 88, 12, .7); }
.estado.mal { background: linear-gradient(140deg, #9f1239, #e11d48 60%, #f97316); box-shadow: 0 18px 40px -18px rgba(225, 29, 72, .7); }
.estado-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.chip-estado { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); margin-bottom: 10px; }
.estado h2 { margin: 0 0 6px; font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.estado p { margin: 0; opacity: .92; font-size: .93rem; }
.anillo {
  --p: 0; flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0);
}
.anillo span {
  display: grid; place-items: center; align-content: center; width: 74px; height: 74px; border-radius: 50%;
  background: rgba(0, 0, 0, .2); font-weight: 800; font-size: 1.2rem; line-height: 1.05;
}
.anillo small { font-size: .62rem; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.estado-datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .22); }
.estado-datos dt { font-size: .72rem; opacity: .8; }
.estado-datos dd { margin: 2px 0 0; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpi {
  position: relative; overflow: hidden; min-width: 0;
  background: var(--panel); border: 1px solid var(--linea); border-radius: 18px; padding: 14px 16px; box-shadow: var(--sombra);
  display: flex; flex-direction: column;
}
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c, var(--acento)); opacity: .85; }
.kpi-cab { display: flex; align-items: center; gap: 8px; }
.kpi-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-size: .95rem; background: color-mix(in srgb, var(--c, var(--acento)) 15%, var(--panel)); }
.kpi small { color: var(--suave); display: block; font-size: .8rem; font-weight: 600; }
.kpi b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 8px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi em { font-style: normal; font-size: .74rem; color: var(--suave); display: block; }
.kpi em.peor { color: var(--mal); font-weight: 600; }
.kpi em.mejor { color: var(--bien); font-weight: 600; }
.spark { height: 46px; margin-top: auto; padding-top: 8px; }
.spark svg { display: block; overflow: visible; }
.sp-area { fill: var(--c); opacity: .13; }
.sp-linea { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sp-punto { fill: var(--c); }
.sp-barra { fill: var(--c); opacity: .4; }
.sp-barra.ult { opacity: 1; }
.sp-barra.neg { fill: var(--mal); }
.kpi .kpi-barra { margin-top: auto; }
.kpi-barra i { background: var(--c) !important; }

/* ---------- Gráficos ---------- */
.chart { width: 100%; min-height: 190px; }
.chart svg.g { display: block; width: 100%; height: auto; overflow: visible; }
.g-txt { font-size: 11px; fill: var(--suave); font-variant-numeric: tabular-nums; }
.g-txt-fuerte { fill: var(--texto); font-weight: 700; }
.g-rejilla { stroke: var(--linea); stroke-width: 1; }
.g-eje { stroke: color-mix(in srgb, var(--texto) 18%, var(--linea)); stroke-width: 1; }
.g-linea { fill: none; stroke: var(--acento); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-halo { fill: var(--acento); opacity: .18; }
.g-punto { fill: var(--panel); stroke: var(--acento); stroke-width: 3; }
.g-proy { stroke: var(--acento); stroke-width: 2; stroke-dasharray: 6 6; opacity: .75; }
.g-proy-punto { fill: var(--panel); stroke: var(--acento); stroke-width: 2; opacity: .8; }
.g-ideal { stroke: var(--suave); stroke-width: 1.4; stroke-dasharray: 2 5; opacity: .7; }
.g-pres { stroke: var(--mal); stroke-width: 1.5; stroke-dasharray: 6 5; }
.g-txt-pres { fill: var(--mal); font-weight: 700; }
.g-guia { stroke: var(--suave); stroke-dasharray: 3 3; opacity: .6; }
.g-fondo-col { fill: transparent; transition: fill .15s; }
.g-grupo:hover .g-fondo-col { fill: color-mix(in srgb, var(--texto) 5%, transparent); }
.g-grupo.actual .g-fondo-col { fill: color-mix(in srgb, var(--acento) 9%, transparent); }
.g-barra-gasto { fill: var(--gasto); }
.g-barra-ingreso { fill: var(--bien); }
.g-finde { fill: color-mix(in srgb, var(--texto) 3.5%, transparent); }
.g-barra-dia { fill: var(--acento-2); opacity: .55; }
.g-barra-dia.alto { fill: var(--gasto); opacity: .75; }
.g-barra-dia.hoy { fill: var(--acento); opacity: 1; }
.g-cero { fill: var(--linea); }
.g-corte { fill: none; stroke: var(--panel); stroke-width: 3; }
.g-media { stroke: var(--suave); stroke-width: 1.2; stroke-dasharray: 4 4; }
.g-txt-media { fill: var(--suave); font-weight: 600; }
.g-donut-fondo { stroke: var(--panel-2); }
.g-seg { transition: stroke-width .15s; }
.g-donut-v { font-size: 22px; font-weight: 800; fill: var(--texto); font-variant-numeric: tabular-nums; }
.g-donut-t { font-size: 11px; fill: var(--suave); font-weight: 600; }
.donut-chart { display: grid; place-items: center; min-height: 0; margin: 4px 0 14px; }
.donut-chart svg.g { width: auto; max-width: 230px; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .76rem; color: var(--suave); font-weight: 600; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { display: inline-block; width: 16px; height: 0; border-top: 3px solid var(--acento); }
.leyenda i.l-proy { border-top: 2px dashed var(--acento); }
.leyenda i.l-ideal { border-top: 2px dotted var(--suave); }
.leyenda i.l-pres { border-top: 2px dashed var(--mal); }
.leyenda i.l-gasto, .leyenda i.l-ingreso { width: 10px; height: 10px; border: 0; border-radius: 3px; background: var(--gasto); }
.leyenda i.l-ingreso { background: var(--bien); }
.leyenda-donut { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.leyenda-donut li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; font-size: .86rem; padding: 4px 0; }
.leyenda-donut i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.leyenda-donut span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leyenda-donut b { font-variant-numeric: tabular-nums; }
.tip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 260px;
  background: #0f172a; color: #f8fafc; border-radius: 12px; padding: 9px 12px; font-size: .8rem; line-height: 1.5;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .08);
}
.tip b { display: block; margin-bottom: 2px; }
.tip b::first-letter { text-transform: uppercase; }
.tip div { display: flex; align-items: center; gap: 7px; opacity: .92; font-variant-numeric: tabular-nums; }
.tip i { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- Personas ---------- */
.personas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.persona { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--c) 8%, var(--panel)); min-width: 0; }
.persona small { display: block; color: var(--suave); font-size: .76rem; }
.persona b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.persona .avatar { width: 40px; height: 40px; font-size: 1rem; }
.reparto { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 14px 0 12px; gap: 3px; }
.reparto span { background: var(--c); border-radius: 6px; }
.balance { margin: 0; font-size: .9rem; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); }

/* ---------- Barras horizontales y ranking ---------- */
.hbarras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbarras li { display: grid; grid-template-columns: 118px 1fr auto; align-items: center; gap: 12px; font-size: .88rem; }
.hb-et { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hb-barra { height: 9px; border-radius: 6px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--linea); }
.hb-barra i { display: block; height: 100%; border-radius: 6px; background: var(--marca); }
.hb-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-v small { display: block; font-size: .72rem; color: var(--suave); font-weight: 600; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--linea); }
.ranking li:first-child { border-top: 0; }
.pos-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; flex: none; font-weight: 800; font-size: .85rem; background: var(--panel-2); color: var(--suave); border: 1px solid var(--linea); }
.ranking li:nth-child(1) .pos-n { background: color-mix(in srgb, #f59e0b 20%, var(--panel)); color: #b45309; border-color: transparent; }
.ranking li:nth-child(2) .pos-n { background: color-mix(in srgb, #64748b 18%, var(--panel)); color: var(--texto); border-color: transparent; }
.ranking li:nth-child(3) .pos-n { background: color-mix(in srgb, #ea580c 16%, var(--panel)); color: #c2410c; border-color: transparent; }

/* ---------- Categorías ---------- */
.cats { list-style: none; padding: 0; margin: 0; }
.cats li a { display: flex; gap: 12px; padding: 10px 8px; margin: 0 -8px; text-decoration: none; border-top: 1px solid var(--linea); border-radius: 12px; transition: background .15s; }
.cats li:first-child a { border-top: 0; }
.cats li a:hover { background: var(--panel-2); }
.ico {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; flex: none;
  background: color-mix(in srgb, var(--c) 16%, var(--panel)); font-size: 1.15rem;
}
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.txt small { color: var(--suave); font-size: .78rem; }
.fila { display: flex; justify-content: space-between; gap: 8px; }
.fila b:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.barra-p { display: block; height: 7px; border-radius: 4px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--linea); }
.barra-p i { display: block; height: 100%; border-radius: 4px; background: var(--c); }
.barra-p.cerca i { background: var(--justo); }
.barra-p.pasado i { background: var(--mal); }

/* ---------- Movimientos ---------- */
.lista { display: flex; flex-direction: column; }
.lista.tarjeta { padding: 4px 16px; margin-top: 6px; }
.mov { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; text-decoration: none; border-top: 1px solid var(--linea); border-radius: 12px; transition: background .15s; }
.mov:first-child { border-top: 0; }
.mov:hover { background: var(--panel-2); }
.mov .txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mov .txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.imp.ingreso { color: var(--bien); }
.dia h3 { display: flex; justify-content: space-between; margin: 20px 4px 0; color: var(--suave); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
.resumen-lista { display: flex; gap: 10px; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; margin: 12px 0; font-size: .9rem; flex-wrap: wrap; }
.resumen-lista span { padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--linea); }
.vacio { color: var(--suave); text-align: center; padding: 14px; }
.fijos-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fijo-fila { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--linea); border-radius: 14px; background: var(--panel-2); }
.tarjeta > .fijo-fila { border: 0; border-top: 1px solid var(--linea); border-radius: 0; background: none; padding: 8px 0; }
.clip { font-size: .8em; }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; border: 1px solid var(--linea); background: var(--panel); color: var(--texto);
  border-radius: 13px; padding: 12px 18px; cursor: pointer; text-decoration: none;
  transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--sombra); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 18px; height: 18px; stroke-width: 2.4; }
.btn.primario { background: var(--primario); color: var(--primario-txt); border-color: var(--primario); }
.btn.peligro { color: var(--mal); border-color: color-mix(in srgb, var(--mal) 40%, var(--linea)); width: 100%; }
.btn.mini { padding: 7px 13px; font-size: .84rem; border-radius: 10px; }
.btn.claro { background: transparent; }
.btn.ancho { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.acciones { display: flex; flex-direction: column; gap: 8px; }
.borrar { margin: 8px 0 20px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--linea);
  border-radius: 12px; padding: 11px 13px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acento) 18%, transparent); }
input[type="color"] { padding: 4px; height: 46px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .86rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.form fieldset:not(.segmentado):not(.chips) { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--linea); border-radius: 16px; padding: 14px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acceso { margin: 8vh auto 0; text-align: center; padding: 28px 24px; max-width: 420px; }
.acceso .form { text-align: left; margin-top: 14px; }

/* Apuntar */
.nuevo h1 { margin-bottom: 0; }
.segmentado { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--linea); border-radius: 15px; padding: 4px; flex-wrap: wrap; }
.segmentado legend { float: left; width: 100%; padding: 4px 6px 2px; }
.segmentado label { flex: 1; font-weight: 600; }
.segmentado input { position: absolute; opacity: 0; pointer-events: none; }
.segmentado span { display: block; text-align: center; padding: 9px 6px; border-radius: 11px; cursor: pointer; white-space: nowrap; transition: background .15s; }
.segmentado span:hover { background: var(--panel-2); }
.segmentado input:checked + span { background: var(--c, var(--primario)); color: var(--primario-txt); box-shadow: 0 6px 14px -8px rgba(15, 23, 42, .6); }
.segmentado label[style] input:checked + span { color: #fff; }
.segmentado input:focus-visible + span { outline: 2px solid var(--acento); }
.importe { position: relative; }
.importe input { font-size: 2.6rem; font-weight: 800; text-align: center; padding: 16px 48px; border-radius: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.importe .moneda { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--suave); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--linea);
  background: var(--panel); font-weight: 500; font-size: .9rem; cursor: pointer; transition: border-color .15s, background .15s;
}
.chip span:hover { border-color: var(--c); }
.chip input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 700; box-shadow: 0 6px 14px -8px var(--c); }
.chip input:focus-visible + span { outline: 2px solid var(--acento); }
.chip[hidden] { display: none; }
.ticket-campo { display: flex; flex-direction: column; gap: 8px; }
.ticket-campo .etiqueta { font-size: .86rem; font-weight: 600; }
.form label.ticket-subir { position: relative; flex-direction: row; font-size: 1rem; font-weight: 700; border-style: dashed; border-width: 1.5px; background: var(--panel-2); }
.ticket-subir.lleno { border-style: solid; border-color: var(--acento); background: color-mix(in srgb, var(--acento) 8%, var(--panel)); }
.ticket-actual { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

/* Filtros */
.filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; padding: 12px; background: var(--panel); border: 1px solid var(--linea); border-radius: 18px; box-shadow: var(--sombra); }
.filtros input[type="search"] { grid-column: 1 / -1; }
.filtros input, .filtros select { padding: 9px 11px; font-size: .9rem; }

/* Presupuesto */
.pres-lista { display: flex; flex-direction: column; }
.pres-fila { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--linea); }
.pres-fila:first-child { border-top: 0; }
.pres-fila .txt b { font-size: .95rem; }
.pres-in { flex-direction: row !important; align-items: center; width: 112px; flex: none; position: relative; }
.pres-in input { text-align: right; padding-right: 28px; font-weight: 700; }
.pres-in span { position: absolute; right: 11px; color: var(--suave); }

/* Categorías */
.cat-edit { display: grid; grid-template-columns: 52px 1fr 52px auto; gap: 8px; align-items: center; }
.cat-edit select { grid-column: 1 / -1; }
.cat-fila { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--linea); }
.cat-fila.archivada { opacity: .5; }
.emoji-in { text-align: center; font-size: 1.2rem; padding: 8px 4px; }
.enlaces { display: flex; flex-direction: column; }
.enlaces a { padding: 12px 0; border-top: 1px solid var(--linea); text-decoration: none; font-weight: 600; }
.enlaces a:first-child { border-top: 0; }

/* ---------- Barra inferior (móvil) ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--linea); padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
}
.barra a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .66rem; font-weight: 600; text-decoration: none; color: var(--suave); padding: 4px 0; }
.barra a .i { width: 23px; height: 23px; }
.barra a.on { color: var(--acento); }
.barra a.mas span {
  display: grid; place-items: center; width: 58px; height: 58px; margin-top: -28px; border-radius: 20px;
  background: var(--marca); color: #fff; box-shadow: 0 10px 22px -8px rgba(16, 185, 129, .75);
  border: 4px solid var(--fondo);
}
.barra a.mas .i { width: 28px; height: 28px; stroke-width: 2.6; }
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--primario); color: var(--primario-txt); padding: 10px 18px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); z-index: 30; white-space: nowrap;
}

/* ---------- Tableta ---------- */
@media (min-width: 720px) {
  .contenido { padding: 10px 24px 32px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .filtros { grid-template-columns: 1.6fr 1.5fr 1fr 1.3fr 1.3fr auto; }
  .filtros input[type="search"] { grid-column: auto; }
  .panel { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
  .panel > .tarjeta { display: flex; flex-direction: column; }
  .panel .chart { flex: 1; }
  .panel .donut-chart { flex: none; }
  .columna { align-self: start; }
  .panel > * { grid-column: span 12; }
  .panel > .c-6 { grid-column: span 6; }
  .fijos-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .panel-cab h1 { font-size: 1.8rem; }
  .solo-escritorio { display: inline-flex !important; }
  .pg-inicio .contenido { max-width: 1100px; }
  .pg-movimientos .contenido { max-width: 960px; }
}

/* ---------- Ordenador ---------- */
@media (min-width: 1024px) {
  body.con-menu { padding: 0 0 0 264px; }
  .con-menu .top, .con-menu .barra { display: none; }
  .con-menu .toast { bottom: 28px; left: calc(50% + 132px); }
  .lateral {
    display: flex; flex-direction: column; gap: 22px;
    position: fixed; z-index: 15; left: 0; top: 0; bottom: 0; width: 264px; padding: 24px 18px 20px;
    background: color-mix(in srgb, var(--panel) 82%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--linea);
  }
  .lateral .marca { padding: 0 6px; font-size: 1.05rem; }
  .lateral .logo { width: 40px; height: 40px; border-radius: 13px; font-size: 1.15rem; }
  .apuntar { background: var(--marca) !important; border: 0 !important; color: #fff !important; box-shadow: 0 12px 24px -10px rgba(16, 185, 129, .8); padding: 13px 18px; }
  .apuntar:hover { filter: brightness(1.05); }
  .menu { display: flex; flex-direction: column; gap: 3px; }
  .menu a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
    text-decoration: none; color: var(--suave); font-weight: 600; font-size: .94rem; transition: background .15s, color .15s;
  }
  .menu a:hover { background: var(--panel-2); color: var(--texto); }
  .menu a.on { background: color-mix(in srgb, var(--acento) 13%, var(--panel)); color: var(--texto); }
  .menu a.on .i { color: var(--acento); }
  .lateral-pie { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--linea); }
  .persona-mini { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: .9rem; font-weight: 600; }
  .persona-mini small { color: var(--suave); font-weight: 500; }
  .persona-mini .avatar { width: 28px; height: 28px; font-size: .78rem; }
  .salir { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin-top: 4px; border: 0; background: none; color: var(--suave); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; border-radius: 10px; }
  .salir:hover { color: var(--mal); background: var(--panel-2); }
  .salir .i { width: 18px; height: 18px; }

  .contenido { max-width: 780px; padding: 28px 40px 48px; }
  .pg-inicio .contenido { max-width: 1440px; }
  .pg-movimientos .contenido { max-width: 1060px; }
  .tarjeta { padding: 22px; }
  .panel { gap: 20px; }
  .panel > .c-4 { grid-column: span 4; }
  .panel > .c-5 { grid-column: span 5; }
  .panel > .c-6 { grid-column: span 6; }
  .panel > .c-7 { grid-column: span 7; }
  .panel > .c-8 { grid-column: span 8; }
  .panel > .estado { align-self: stretch; padding: 24px; }
  .panel > .kpis { grid-template-columns: repeat(2, 1fr); gap: 16px; align-self: stretch; }
  .columna { gap: 20px; }
  .kpi { padding: 16px 18px; }
  .kpi b { font-size: 1.65rem; }
  .panel-cab { margin: 0 0 22px; }
  .panel-cab h1 { font-size: 2rem; }
  .estado h2 { font-size: 1.75rem; }
  .pg-inicio .mes-sel { box-shadow: none; }
}
@media (min-width: 1440px) {
  .kpi b { font-size: 1.8rem; }
}
