/* Fundum · app. Modo «operar»: papel cálido, tinta, serif solo en títulos y cifras, datos en tiras con filetes. */
:root {
  --bg: #F4F3EF; --surface: #FBFAF7; --raise: #FFFFFF; --sunk: #EDEBE5;
  --ink: #15202E; --ink-2: #39434F; --muted: #5C6570; --rule: #E2DFD8; --rule-2: #CFCBC2;
  --accent: #8F5E28; --accent-soft: rgba(143,94,40,.10); --bar: #B07A3C;
  --gain: #276B44; --gain-soft: rgba(39,107,68,.10); --loss: #A63A2E; --loss-soft: rgba(166,58,46,.09);
  --info: #2D5680; --info-soft: rgba(45,86,128,.09);
  --btn: #15202E; --btn-ink: #FBFAF7;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121211; --surface: #191918; --raise: #1F1F1E; --sunk: #0E0E0D;
  --ink: #ECEAE5; --ink-2: #CAC7C0; --muted: #A09D96; --rule: #2B2A28; --rule-2: #3A3936;
  --accent: #D9AE73; --accent-soft: rgba(217,174,115,.12); --bar: #D9AE73;
  --gain: #6CC08F; --gain-soft: rgba(108,192,143,.12); --loss: #E58A7E; --loss-soft: rgba(229,138,126,.12);
  --info: #8DB2DA; --info-soft: rgba(141,178,218,.12);
  --btn: #ECEAE5; --btn-ink: #121211; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #121211; --surface: #191918; --raise: #1F1F1E; --sunk: #0E0E0D;
  --ink: #ECEAE5; --ink-2: #CAC7C0; --muted: #A09D96; --rule: #2B2A28; --rule-2: #3A3936;
  --accent: #D9AE73; --accent-soft: rgba(217,174,115,.12); --bar: #D9AE73;
  --gain: #6CC08F; --gain-soft: rgba(108,192,143,.12); --loss: #E58A7E; --loss-soft: rgba(229,138,126,.12);
  --info: #8DB2DA; --info-soft: rgba(141,178,218,.12);
  --btn: #ECEAE5; --btn-ink: #121211; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); text-underline-offset: 3px; }
::selection { background: var(--accent-soft); color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.serif { font-family: var(--serif); }

/* ---------- estructura */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.banner { background: #15202E; color: #EFEEEA; font-size: 14px; text-align: center; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); display: flex; gap: 8px 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.banner b { font-weight: 700; }
.banner .pill { border: 1px solid rgba(239,238,234,.35); background: transparent; color: #EFEEEA; border-radius: 999px; padding: 3px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
:root[data-theme="dark"] .banner { background: #262624; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner { background: #262624; } }
.banner .pill.gold { background: #D4A86A; border-color: #D4A86A; color: #15202E; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--rule); }
.topbar .in { padding: 10px 20px; display: flex; align-items: center; gap: 10px; min-height: 58px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--serif); font-size: 24px; background: none; border: 0; padding: 0; cursor: pointer; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.tag-admin { font-size: 13px; font-weight: 600; color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 112px; }

/* navegación: abajo en móvil, columna lateral en escritorio */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar .in { max-width: 560px; margin: 0 auto; display: flex; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; background: none; border: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; min-height: 56px; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink); }
.shell { flex: 1; display: flex; flex-direction: column; }
@media (min-width: 1024px) {
  .shell { flex-direction: row; align-items: flex-start; }
  .shell main { max-width: none; padding: 36px 48px 64px; min-width: 0; }
  .shell main > * { max-width: 1040px; }
  .tabbar { position: sticky; top: 59px; height: calc(100dvh - 59px); width: 240px; flex: 0 0 240px; border-top: 0; border-right: 1px solid var(--rule); padding: 18px 14px; order: -1; }
  .tabbar .in { flex-direction: column; gap: 2px; max-width: none; }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 10px; font-size: 15px; }
  .tab svg { width: 20px; height: 20px; }
  .tab[aria-current="page"] { background: var(--sunk); }
}

/* entrada de pantalla: breve y solo opacidad + 6px */
@media (prefers-reduced-motion: no-preference) {
  main.enter > * { animation: enter .26s var(--ease) both; }
  main.enter > *:nth-child(2) { animation-delay: .06s; }
  main.enter > *:nth-child(3) { animation-delay: .12s; }
}
@media (prefers-reduced-motion: reduce) { main.enter > * { animation: fade .2s ease-out both; } }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- tipografía */
.h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3.6vw, 36px); line-height: 1.1; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
.lead { color: var(--muted); margin: 6px 0 0; max-width: 64ch; }
.eyebrow { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.small { font-size: 14px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 22px; }
.stack-s { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.narrow { max-width: 640px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* ---------- botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--rule-2); background: var(--raise); color: var(--ink); padding: 0 18px; min-height: 44px; border-radius: 999px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .16s var(--ease), background-color .16s, border-color .16s; }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.btn.gold { background: #D4A86A; color: #15202E; border-color: #D4A86A; }
.btn.danger { color: var(--loss); border-color: currentColor; background: transparent; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not([disabled]) { border-color: var(--muted); }
  .btn.primary:hover:not([disabled]) { background: color-mix(in srgb, var(--btn) 86%, var(--bg)); }
  .chip:hover { border-color: var(--muted); color: var(--ink); }
  .tab:hover { color: var(--ink); }
  .pcard:hover { border-color: var(--rule-2); }
  .pcard:hover .pimg { transform: scale(1.02); }
  .lrow:hover, .docrow:hover { background: var(--sunk); }
  .icon-btn:hover { border-color: var(--muted); }
}
.link { background: none; border: 0; padding: 4px 0; color: var(--info); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--rule); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 0 14px; min-height: 36px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .16s var(--ease); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }

/* ---------- superficies */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.pad { padding: 20px; }

/* tira de cifras: una caja, columnas separadas por filetes */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--rule); }
.kpi i { display: none; }
.kpi .t { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--serif); font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.kpi .s { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
.big-number { font-family: var(--serif); font-size: clamp(40px, 6vw, 52px); line-height: 1; letter-spacing: -.02em; font-weight: 400; margin: 2px 0 0; }

/* ---------- catálogo */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1 1 260px; min-width: 0; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search { width: 100%; min-height: 44px; padding: 0 16px 0 42px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--raise); }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pcard { text-align: left; padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; color: inherit; width: 100%; transition: transform .16s var(--ease), border-color .16s; }
.pcard:active { transform: scale(.985); }
.pimg-wrap { overflow: hidden; position: relative; }
.pimg { aspect-ratio: 3 / 2; background: var(--sunk) center / cover no-repeat; transition: transform .5s var(--ease); }
.pbadges { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: rgba(21,32,46,.86); color: #F4F3EF; white-space: nowrap; }
.badge.demo { background: #D4A86A; color: #15202E; }
.badge.ok { background: #276B44; color: #F4F3EF; }
.badge.light { background: rgba(255,255,255,.92); color: #15202E; }
.pbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.ploc { font-size: 14px; color: var(--muted); }
.ptitle { font-family: var(--serif); font-size: 21px; line-height: 1.2; letter-spacing: -.01em; margin-top: -8px; }
.pstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.pstats div { padding: 10px 0 10px 12px; display: flex; flex-direction: column; }
.pstats div:first-child { padding-left: 0; }
.pstats div + div { border-left: 1px solid var(--rule); }
.pstats span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pstats b { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.pfoot { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); }
.pfoot b { color: var(--ink); font-weight: 600; }
.bar { height: 4px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; border: 1px dashed var(--rule-2); border-radius: var(--radius); }

/* ---------- detalle */
.hero-img { position: relative; aspect-ratio: 21 / 9; border-radius: var(--radius); background: var(--sunk) center / cover no-repeat; overflow: hidden; }
.hero-img .pbadges { left: 14px; top: 14px; }
@media (max-width: 640px) { .hero-img { aspect-ratio: 3 / 2; } }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .two-col > .side { order: -1; position: static; } }
.side { position: sticky; top: 84px; }
.side .fund { font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: -.01em; }
.prose { white-space: pre-line; color: var(--ink-2); margin: 8px 0 0; max-width: 68ch; }
.lst { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.docrow, .lrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; width: 100%; text-align: left; cursor: pointer; text-decoration: none; color: inherit; background: transparent; border: 0; transition: background-color .16s; }
.lst > * + * { border-top: 1px solid var(--rule); }
.docrow .go { color: var(--muted); font-size: 20px; line-height: 1; }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted); padding: 6px 0; cursor: pointer; font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.back svg { width: 16px; height: 16px; }

/* ---------- formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .flabel { font-weight: 600; font-size: 14.5px; }
.field input, .field select, .field textarea { min-height: 44px; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--raise); width: 100%; }
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.hint { font-size: 13.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--btn); }
.radios { display: flex; gap: 10px; }
.radios label { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--raise); cursor: pointer; font-weight: 600; }
.radios input { accent-color: var(--btn); margin: 0; }
.msg { font-size: 14.5px; border-radius: 10px; padding: 10px 14px; margin: 0; }
.msg.err { color: var(--loss); background: var(--loss-soft); }
.msg.ok { color: var(--gain); background: var(--gain-soft); }
.msg.info { color: var(--info); background: var(--info-soft); }
.note { background: var(--accent-soft); padding: 14px 16px; border-radius: 12px; font-size: 14.5px; color: var(--ink-2); }
.note b { display: block; margin-bottom: 2px; color: var(--ink); }
.note.loss { background: var(--loss-soft); } .note.loss b { color: var(--loss); }
.note.info { background: var(--info-soft); }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 3px; border-radius: 3px; background: var(--rule); }
.steps span.on { background: var(--ink); }
.q { font-weight: 600; margin-bottom: 10px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; border: 1px solid var(--rule-2); background: var(--raise); border-radius: 10px; padding: 12px 14px; min-height: 44px; cursor: pointer; transition: transform .16s var(--ease); }
.opt:active { transform: scale(.985); }
.opt[aria-pressed="true"] { border-color: var(--btn); background: var(--btn); color: var(--btn-ink); }
.opt.wrong { border-color: var(--loss); background: var(--loss-soft); color: var(--loss); }
.why { color: var(--loss); font-size: 14px; margin: 8px 0 0; }
.amounts { display: flex; gap: 8px; flex-wrap: wrap; }
.amounts .opt { flex: 1 1 96px; text-align: center; font-weight: 600; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--rule); }
.summary div:last-child { border-bottom: 0; }
.summary span { color: var(--muted); }
.summary b { text-align: right; font-weight: 600; }

/* ---------- acceso */
.auth { flex: 1; display: grid; place-items: center; padding: 32px 18px 64px; }
.auth .card { width: min(440px, 100%); padding: 30px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- cartera, perfil, admin */
.list { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--rule); }
.list > .card { border-radius: 0; border: 0; background: transparent; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; width: 100%; text-align: left; color: inherit; cursor: pointer; background: transparent; border: 0; transition: background-color .16s; }
@media (hover: hover) and (pointer: fine) { .item:hover { background: var(--sunk); } }
.item .t { font-weight: 600; }
.status { font-size: 13.5px; font-weight: 600; }
.status.gain { color: var(--gain); } .status.gold { color: var(--accent); } .status.muted { color: var(--muted); }
.amt { font-family: var(--serif); font-size: 20px; white-space: nowrap; }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 16px 1fr; gap: 14px; position: relative; }
.tl:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--rule); }
.tl .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--rule-2); margin-top: 6px; position: relative; z-index: 1; }
.tl .dot.done { background: var(--gain); border-color: var(--gain); } .tl .dot.now { background: var(--ink); border-color: var(--ink); }
.tl .b { padding-bottom: 16px; } .tl .b b { display: block; } .tl .b span { font-size: 14px; color: var(--muted); }
.rows > div, .rows > button { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; min-height: 48px; align-items: center; border-bottom: 1px solid var(--rule); }
.rows > :last-child { border-bottom: 0; }
.rows > div span:first-child { color: var(--muted); }
.rows > button { background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; color: var(--ink); }
.pillstate { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pillstate.ok { background: var(--gain-soft); color: var(--gain); }
.pillstate.wait { background: var(--accent-soft); color: var(--accent); }
.pillstate.info { background: var(--info-soft); color: var(--info); }
.admin-item { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.admin-item .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.admin-item .name { font-weight: 600; word-break: break-word; }
.admin-item .quote { font-size: 14.5px; color: var(--ink-2); background: var(--sunk); border-radius: 8px; padding: 8px 12px; }
.img-prev { aspect-ratio: 3 / 2; border-radius: 10px; border: 1px solid var(--rule); background: var(--sunk) center / cover no-repeat; max-width: 360px; }
.confirm { border: 1px solid var(--loss); background: var(--loss-soft); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; color: var(--loss); font-size: 14.5px; }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: #15202E; color: #EFEEEA; padding: 10px 18px; border-radius: 999px; font-size: 14.5px; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.22); max-width: calc(100vw - 32px); animation: toast .22s var(--ease) both; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 1024px) { .toast { bottom: 32px; } }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }
@media (prefers-reduced-motion: no-preference) { .bar > span { transition: width .5s var(--ease); } }
.imgnote { position: absolute; right: 10px; bottom: 10px; font-size: 12px; color: #fff; background: rgba(0,0,0,.5); padding: 2px 9px; border-radius: 99px; }

/* ---- estados: carga, error, sin conexión */
.sk { display: block; background: var(--sunk); border-radius: 6px; }
.sk-img { aspect-ratio: 3 / 2; border-radius: 0; }
.sk-line { height: 12px; margin: 10px 0; width: 100%; }
.sk-line.big { height: 22px; }
.sk-line.w30 { width: 30%; } .sk-line.w40 { width: 40%; } .sk-line.w55 { width: 55%; } .sk-line.w70 { width: 70%; }
.sk-card { pointer-events: none; }
.sk-list { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.sk-row { display: flex; justify-content: space-between; gap: 24px; padding: 8px 18px; border-bottom: 1px solid var(--rule); }
.sk-row:last-child { border-bottom: 0; }
.sk-row .w30 { max-width: 90px; }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: sk 1.1s ease-in-out infinite alternate; }
  @keyframes sk { from { opacity: .55; } to { opacity: 1; } }
  .spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--rule-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 10px; }
  @keyframes spin { to { transform: rotate(360deg); } }
}
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.empty .btn { display: flex; width: fit-content; margin: 18px auto 0; }
.empty.err { border-style: solid; border-color: var(--loss-soft); background: var(--loss-soft); color: var(--ink-2); }
.empty.err b { color: var(--loss); }
.banner.off { background: #5A2A23; }
.banner.off svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---- calendario judicial */
.timeline.legal { list-style: none; margin: 0; }
.timeline.legal .b > b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline.legal .badge { background: var(--ink); color: var(--surface); font-size: 12px; }
.timeline.legal .b span { display: block; }
.timeline.legal .when { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; margin: 2px 0; }
.fset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px 6px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.fset legend { font-weight: 700; padding: 0 6px; }
.lrow { display: grid; grid-template-columns: 1fr 170px auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); }
.lrow > label:first-child { font-weight: 600; font-size: 14.5px; }
.lrow input[type="date"] { min-height: 44px; padding: 8px 10px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--raise); color: var(--ink); font: inherit; width: 100%; }
@media (max-width: 560px) { .lrow { grid-template-columns: 1fr auto; } .lrow > label:first-child { grid-column: 1 / -1; } }

/* ---- evaluación del inversor */
.eur-input { position: relative; }
.eur-input input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.eur-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.summary.sim { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.summary b { font-variant-numeric: tabular-nums; }

/* ---- administración: altas */
.admin-item .pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.kpis.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.mini .kpi .v { font-size: 22px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; border-bottom: 1px solid var(--rule-2); }
.chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart .col i { display: flex; flex-direction: column; justify-content: flex-end; width: 100%; min-height: 2px; background: var(--accent-soft); border-radius: 3px 3px 0 0; overflow: hidden; }
.chart .col i em { display: block; background: var(--bar); }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--accent-soft); margin-left: 8px; }
.legend i.c { background: var(--bar); margin-left: 0; }
.srcs > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 2fr) 40px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14.5px; }
.srcs span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srcs .sbar { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.srcs .sbar i { display: block; height: 100%; background: var(--bar); }
.srcs b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .tag-admin, .top-actions .lbl { display: none; } }
