/* Gestión — estilo. Colores vivos sobre fondo claro; menú oscuro en el ordenador. Sin estilos dentro del HTML (CSP). */

@font-face { font-family: 'Bricolage Grotesque'; font-weight: 200 800; font-display: swap; src: url('fonts/bricolage.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 300 900; font-display: swap; src: url('fonts/figtree.woff2') format('woff2'); }

:root {
  --ink: #14123A;
  --muted: #5A5780;
  --ground: #F3F4FB;
  --white: #FFFFFF;
  --indigo: #4B3FE0;
  --pink: #FF3D9A;
  --mint: #19C39A;
  --orange: #FF7A1A;
  --sky: #2AA7FF;
  --lime: #C6F135;
  --yellow: #FFD23F;
  --lilac: #B79CFF;
  --coral: #D62D45;
  --navy2: #2D2878;
  --gray: #E4E5F3;
  --line: #E4E5F3;
  --ok-bg: #C9F5E8; --ok-fg: #0B5A47;
  --warn-bg: #FFF0CC; --warn-fg: #7A4B00;
  --bad-bg: #FFE0E4; --bad-fg: #9C1630;
  --disp: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.4 var(--body); min-height: 100dvh; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; border-radius: 10px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 18px; height: 18px; }
.ic.lg { width: 26px; height: 26px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── arranque y candado ───────── */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--ink); z-index: 90; }
.boot img { width: 96px; height: 96px; border-radius: 24px; animation: pop .6s ease-out both; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

.auth, .lock {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: max(20px, var(--safe-t)) 20px max(20px, var(--safe-b));
  background: var(--ink); position: relative; overflow: hidden;
}
.lock { position: fixed; inset: 0; z-index: 80; overflow-y: auto; }
.auth::before, .lock::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--indigo); top: -220px; right: -160px; opacity: .55; }
.auth::after, .lock::after { content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: var(--pink); bottom: -170px; left: -120px; opacity: .45; }
.auth-card {
  position: relative; z-index: 1; width: min(440px, 100%); background: var(--white); color: var(--ink);
  border-radius: 36px; padding: 30px 26px 26px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px #0006;
}
.auth-logo { width: 64px; height: 64px; border-radius: 18px; }
.auth-card h1 { font: 800 30px/1.1 var(--disp); letter-spacing: -.5px; }
.auth-card p { color: var(--muted); font-weight: 500; }
.auth-card .small { font-size: 13px; }
.qr { align-self: center; padding: 12px; border-radius: 22px; background: var(--white); border: 2px solid var(--gray); }
.qr svg { display: block; width: 210px; height: 210px; }
.secret { font: 700 15px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 1.5px; word-break: break-all; padding: 12px 14px; border-radius: 16px; background: var(--ground); user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes span { font: 700 15px/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 1px; padding: 12px 8px; text-align: center; border-radius: 14px; background: var(--ground); user-select: all; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 6px; border-radius: 9px; background: var(--gray); }
.steps i.on { background: var(--indigo); }
.lock-card { align-items: stretch; }
.lock-card .who { display: flex; align-items: center; gap: 14px; }

/* ───────── formularios ───────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .lbl { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .2px; }
.field small { font-size: 12px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=date], input[type=month], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 2px solid var(--gray); border-radius: 18px; background: var(--white);
  font: 600 16px/1.3 var(--body); color: var(--ink); appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); }
input::placeholder, textarea::placeholder { color: #9C99BD; font-weight: 500; }
.code-input { text-align: center; font: 800 28px/1 var(--disp); letter-spacing: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .grid2.keep { grid-template-columns: 1fr 1fr; } .grid2:not(.keep) { grid-template-columns: 1fr; } }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 2px; font-weight: 600; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; accent-color: var(--indigo); margin: 0; }
.check small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; inset: 0; }
.swatches span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; background: var(--bg); color: var(--fg); font: 800 14px var(--disp); border: 3px solid transparent; }
.swatches input:checked + span { border-color: var(--ink); }
.swatches input:focus-visible + span { outline: 3px solid var(--indigo); outline-offset: 2px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--gray); }
.seg button, .seg label { flex: 1; min-height: 44px; display: grid; place-items: center; border: 0; border-radius: 99px; background: transparent; font-weight: 800; font-size: 15px; color: var(--muted); padding: 0 14px; cursor: pointer; text-align: center; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg .on, .seg label:has(input:checked) { background: var(--ink); color: var(--white); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--indigo); outline-offset: 2px; }
.err { color: var(--bad-fg); background: var(--bad-bg); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 14px; }
.okmsg { color: var(--ok-fg); background: var(--ok-bg); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 14px; }

/* ───────── botones y píldoras ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 99px; background: var(--indigo); color: var(--white); font-weight: 800; font-size: 15px; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.pink { background: var(--pink); color: var(--white); }
.btn.mint { background: var(--mint); color: var(--ink); }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.ink { background: var(--ink); color: var(--white); }
.btn.ghost { background: transparent; color: var(--indigo); box-shadow: inset 0 0 0 2px var(--indigo); }
.btn.soft { background: var(--ground); color: var(--ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad-fg); }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.dash { background: transparent; color: var(--indigo); box-shadow: inset 0 0 0 2px var(--indigo); border: 0; background-image: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 15px; background: var(--white); color: var(--ink); }
.icon-btn.flat { background: transparent; }
.linkbtn { border: 0; background: transparent; color: var(--indigo); font-weight: 800; font-size: 14px; padding: 8px 4px; min-height: 40px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--gray); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip.bad { background: var(--bad-bg); color: var(--bad-fg); }
.chip.white { background: var(--white); color: var(--ink); }
.chip.lime { background: var(--lime); color: var(--ink); }
.chip.indigo { background: #E6E3FF; color: var(--indigo); }
.chip.sky { background: #D8EEFF; color: #0B5C93; }
.chip.dark { background: var(--ink); color: var(--white); }

/* ───────── estructura ───────── */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--ink); color: var(--white); padding: 30px 18px 22px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand b { display: block; font: 800 19px/1.1 var(--disp); }
.brand small { font-size: 13px; font-weight: 600; color: #B9B4F7; }
.sidenav { display: flex; flex-direction: column; gap: 6px; }
.sidenav a, .sidenav button.navbtn { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 10px; border: 0; border-radius: 20px; background: transparent; color: #D8D5FA; font-size: 16px; font-weight: 700; text-align: left; width: 100%; }
.sidenav a[aria-current=page] { background: var(--navy2); color: var(--white); }
.sidenav .nb { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--c); color: var(--cf, var(--ink)); flex: none; }
.sidefoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 24px; background: #221E5E; font-size: 13px; color: #D8D5FA; }
.sidefoot b { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--lime); }
.sidefoot .navbtn2 { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--white); font-weight: 700; font-size: 13px; padding: 6px 0; min-height: 36px; text-align: left; }
.main { min-width: 0; padding: 36px 40px 60px; display: flex; flex-direction: column; gap: 20px; max-width: 1240px; width: 100%; }
.view { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tabs { display: none; }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.head .kick { font-size: 15px; font-weight: 600; color: var(--muted); }
.head h1 { font: 800 48px/1.05 var(--disp); letter-spacing: -1px; margin-top: 2px; }
.head .sub { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--muted); }
.head .acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.head .badge { display: none; }
.crumb { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--indigo); font-weight: 800; font-size: 15px; padding: 6px 0; min-height: 40px; }

.card { background: var(--white); border-radius: 32px; padding: 26px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card h2, .tile h2 { font: 700 22px/1.15 var(--disp); }
.card .chead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; min-width: 0; }
.g3 { grid-template-columns: 1.55fr 1fr 1fr; }
.g2 { grid-template-columns: 1.4fr 1fr; }
.g2e { grid-template-columns: 1fr 1fr; }
.g3e { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g1 { grid-template-columns: minmax(0, 1fr); }
.fichagrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* tarjetas de color */
.tile { border-radius: 36px; padding: 28px 30px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; min-width: 0; color: var(--ink); }
.tile > * { position: relative; z-index: 1; }
.tile h2 { font-size: 19px; font-weight: 700; }
.tile .big { font: 800 clamp(40px, 6vw, 84px)/1 var(--disp); letter-spacing: -2px; }
.tile .mid { font: 800 clamp(34px, 3.4vw, 46px)/1 var(--disp); letter-spacing: -1px; }
.tile .note { font-size: 14px; font-weight: 600; line-height: 1.45; }
.tile .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.t-indigo { background: var(--indigo); color: var(--white); }
.t-indigo::before { content: ''; position: absolute; width: 230px; height: 230px; border-radius: 50%; background: var(--pink); top: -90px; right: -70px; }
.t-indigo::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: var(--yellow); bottom: -70px; right: 18%; }
.t-pink { background: var(--pink); color: var(--ink); }
.t-lime { background: var(--lime); }
.t-ink { background: var(--ink); color: var(--white); }
.t-orange { background: var(--orange); }
.t-sky { background: var(--sky); }
.t-mint { background: var(--mint); }
.t-yellow { background: var(--yellow); }
.t-lilac { background: var(--lilac); }
.t-ink .big, .t-ink .mid { color: var(--lime); }
.prog { height: 14px; border-radius: 99px; background: #0003; overflow: hidden; }
.prog > i { display: block; height: 100%; width: var(--w, 0%); border-radius: 99px; background: var(--ink); transition: width .5s ease; }
.prog.light { background: var(--gray); }
.prog.light > i { background: var(--mint); }
.t-indigo .prog { background: #FFFFFF30; }
.t-indigo .prog > i { background: var(--mint); }

/* barras mes a mes */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 260px; padding-top: 28px; }
.bars .b { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 8px; font-size: 13px; font-weight: 700; text-align: center; }
.bars .b > em { font-style: normal; color: var(--muted); }
.bars .b > strong { font-size: 13px; color: var(--ink); }
.bars .b > i { display: block; height: var(--h, 4%); min-height: 8px; border-radius: 16px; background: var(--indigo); }
.bars .b.now > i { background: var(--pink); }
.bars .b.now > strong { color: var(--pink); }
.bars .b.next > i { background: #FFF0E3; border: 2px dashed var(--orange); }
.bars .b.next > strong { color: var(--orange); }
.bars .b.now > em { color: var(--ink); font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* filas */
.list { display: flex; flex-direction: column; gap: 4px; }
.item { display: flex; align-items: center; gap: 14px; padding: 10px 0; min-width: 0; border-radius: 18px; text-align: left; width: 100%; border: 0; background: transparent; color: inherit; }
button.item:hover, a.item:hover { background: var(--ground); }
.item .tx { flex: 1; min-width: 0; }
.item .tt { font-weight: 800; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.item .ss { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.item .rt { flex: none; text-align: right; font: 800 16px/1.2 var(--body); }
.item .rt small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.item.struck .tt, .item.struck .rt { text-decoration: line-through; opacity: .6; }
.avatar { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--bg, var(--lilac)); color: var(--fg, var(--ink)); font: 800 17px var(--disp); }
.avatar.xl { width: 72px; height: 72px; border-radius: 24px; font-size: 26px; }
.avatar.sm { width: 40px; height: 40px; border-radius: 14px; font-size: 14px; }
.ibadge { flex: none; width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--bg, var(--lilac)); color: var(--fg, var(--ink)); }
.date { flex: none; width: 58px; height: 60px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg, var(--coral)); color: var(--fg, var(--white)); font: 800 22px/1 var(--disp); }
.date small { font: 800 11px/1 var(--body); letter-spacing: .6px; margin-top: 3px; }
.clientgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.clientgrid .item { padding: 10px 12px; background: var(--ground); border-radius: 20px; }
.empty { padding: 22px 12px; text-align: center; color: var(--muted); font-weight: 600; }
.sep { height: 1px; background: var(--line); border: 0; margin: 4px 0; width: 100%; }
.hint { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.45; }

/* clientes */
.search { position: relative; }
.search .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 46px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 18px; border-radius: 99px; border: 0; background: var(--white); font-weight: 800; font-size: 15px; color: var(--ink); }
.pill[aria-pressed=true] { background: var(--ink); color: var(--white); }
.clients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ccard { background: var(--white); border-radius: 28px; padding: 18px 18px; display: flex; gap: 14px; align-items: center; text-align: left; border: 0; width: 100%; min-width: 0; }
.ccard .tx { flex: 1; min-width: 0; }
.ccard .tt { font-weight: 800; font-size: 16px; line-height: 1.2; }
.ccard .ss { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.ccard .rt { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-weight: 800; }

/* meses */
.months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.mo { min-height: 58px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 800; background: var(--ground); color: var(--muted); border: 0; }
.mo b { font-size: 15px; }
.mo.paid { background: var(--ok-bg); color: var(--ok-fg); }
.mo.late { background: var(--bad-bg); color: var(--bad-fg); }
.mo.next { background: var(--warn-bg); color: var(--warn-fg); box-shadow: inset 0 0 0 2px var(--orange); }
.mo.off { opacity: .55; }
button.mo:hover { filter: brightness(.96); }
.kv { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-weight: 600; }
.kv b { font-weight: 800; }
.stepdone { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--mint); color: var(--ink); }
.stepdone.no { background: var(--white); box-shadow: inset 0 0 0 3px var(--gray); }

/* calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 6px 0; }
.cal .day { position: relative; min-height: 54px; border: 0; border-radius: 16px; background: var(--ground); font-weight: 800; font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px; }
.cal .day.out { opacity: .35; }
.cal .day.today { box-shadow: inset 0 0 0 3px var(--indigo); }
.cal .day.sel { background: var(--ink); color: var(--white); }
.cal .day.has-r { background: var(--bad-bg); color: var(--bad-fg); }
.cal .day.has-e { background: var(--warn-bg); color: var(--warn-fg); }
.cal .day.has-c { background: #E6E3FF; color: var(--indigo); }
.dots { display: flex; gap: 3px; height: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.calnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.calnav h2 { text-align: center; text-transform: capitalize; }

/* gastos */
.stack { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: #FFFFFF40; gap: 2px; }
.stack i { display: block; height: 100%; width: var(--w); background: var(--c); }
.cat { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.cat::before { content: ''; width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.cat b { margin-left: auto; }
.clip { flex: none; width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; border: 2px dashed var(--indigo); background: transparent; color: var(--indigo); }
.clip.has { background: var(--mint); border: 0; color: var(--ink); }
.cdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; margin-right: 6px; }

/* ventanas (hojas) */
#layer { position: relative; z-index: 60; }
.shade { position: fixed; inset: 0; background: #14123A99; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease-out both; }
.sheet { background: var(--white); color: var(--ink); border-radius: 36px; width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 16px; animation: rise .2s ease-out both; overscroll-behavior: contain; }
.sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet h2 { font: 800 26px/1.1 var(--disp); letter-spacing: -.3px; }
.sheet .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.sheet .acts .btn { flex: 1 1 140px; }
.sheet form { display: flex; flex-direction: column; gap: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 100; max-width: min(520px, calc(100vw - 32px)); padding: 14px 20px; border-radius: 20px; background: var(--ink); color: var(--white); font-weight: 700; font-size: 15px; box-shadow: 0 12px 40px #0005; text-align: center; }
.toast.bad { background: var(--coral); }
.toast.ok { background: #0B5A47; }

/* hostinger / ajustes */
.setgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.row2 { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; font-weight: 700; }
.toggle > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toggle input { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 99px; background: #CFCDE8; position: relative; flex: none; cursor: pointer; margin: 0; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); transition: transform .15s; }
.toggle input:checked { background: var(--indigo); }
.toggle input:checked::after { transform: translateX(20px); }
.toggle input:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.keyrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--ground); border-radius: 20px; }
.keyrow .tx { flex: 1; min-width: 0; }
.keyrow .pw { font: 700 15px/1.3 ui-monospace, 'SF Mono', Menlo, monospace; overflow-wrap: anywhere; letter-spacing: .3px; }
.keyrow .ss { font-size: 13px; font-weight: 600; color: var(--muted); }
.vaultlock { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 22px; background: #EFEBFF; }
.vaultlock .tx { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.assetrow { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 22px; background: var(--ground); }
.assetrow .keys { display: flex; flex-direction: column; gap: 8px; padding-left: 4px; }

/* ───────── teléfono ───────── */
@media (max-width: 959px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: max(16px, var(--safe-t)) max(16px, env(safe-area-inset-right, 0px)) calc(104px + var(--safe-b)) max(16px, env(safe-area-inset-left, 0px)); gap: 16px; max-width: none; }
  .view { gap: 16px; }
  .head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t g" "a a"; align-items: center; gap: 12px; }
  .head .kick { display: none; }
  .head h1 { font-size: 30px; letter-spacing: -.5px; margin: 0; }
  .head > .htitle { grid-area: t; display: flex; align-items: center; gap: 12px; min-width: 0; }
  .head > .gearbtn { grid-area: g; }
  .head > .acts { grid-area: a; }
  .head > .acts:empty { display: none; }
  .head .acts .btn { flex: 1 1 0; min-width: 110px; }
  .head .badge { display: grid; width: 46px; height: 46px; border-radius: 16px; place-items: center; background: var(--bg); color: var(--fg, var(--ink)); flex: none; }
  .head .sub { margin-top: 2px; font-size: 14px; }
  .head .acts .hide-m { display: none; }
  .card { padding: 22px 20px; border-radius: 28px; }
  .tile { padding: 24px 22px; border-radius: 30px; }
  .g3, .g2, .g2e, .g3e, .fichagrid, .setgrid, .clients { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 14px; }
  .col { gap: 14px; }
  .bars { height: 220px; gap: 8px; }
  .months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(12px + var(--safe-b)) max(12px, env(safe-area-inset-left, 0px)); background: var(--white); border-top: 1px solid var(--line);
  }
  .tabs a { min-height: 56px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 800; color: var(--muted); }
  .tabs a[aria-current=page] { background: var(--c); color: var(--cf, var(--ink)); }
  .sheet { border-radius: 32px 32px 0 0; width: 100%; max-height: calc(100dvh - 24px); padding-bottom: calc(24px + var(--safe-b)); }
  .shade { align-items: flex-end; padding: 0; }
  .sheet .grid2 { grid-template-columns: 1fr 1fr; }
  .toast { bottom: calc(96px + var(--safe-b)); }
  .tile .big { font-size: 64px; }
}
@media (max-width: 380px) { .sheet .grid2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───────── añadidos ───────── */
.mid { font: 800 40px/1 var(--disp); letter-spacing: -1px; }
.card .chips, .item .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.grow { flex: 1; min-width: 0; }
.only-m { display: none; }
.itemmain { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 0; color: inherit; font: inherit; border-radius: 18px; }
.itemmain:is(button):hover { background: var(--ground); }
.item .clip { margin-left: 4px; }
@media (max-width: 959px) { .only-m { display: grid; } }
@media (max-width: 520px) {
  .item, .itemmain { gap: 10px; }
  .item .tt { font-size: 15px; }
  .item .rt { font-size: 15px; }
  .item .clip { width: 38px; height: 38px; margin-left: 0; }
  .ibadge { width: 40px; height: 40px; border-radius: 14px; }
}
