/* ═══════════════════════════════════════════════════════════════════════════
   Imperio Bancario · tema oscuro "noche financiera"
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #060a14;
  --bg2: #0b1220;
  --card: rgba(16, 24, 42, .78);
  --card-solid: #111a2c;
  --card2: #172238;
  --line: rgba(139, 160, 210, .13);
  --line2: rgba(139, 160, 210, .24);
  --text: #eaf0fb;
  --text2: #c5cfe4;
  --muted: #8794b3;
  --gold: #f2c14e;
  --gold2: #ffd97a;
  --gold-ink: #241a02;
  --green: #34d399;
  --red: #fb7185;
  --orange: #fbb04d;
  --blue: #60a5fa;
  --purple: #a78bfa;
  /* Serie categórica para gráficos (validada contra la superficie de las tarjetas) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(56, 97, 196, .28), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(124, 77, 196, .16), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
b, .num { font-variant-numeric: tabular-nums; font-weight: 650; }
h2, h3 { letter-spacing: -.01em; }
h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
small { font-size: 12px; }
.muted { color: var(--muted); }
[data-c="pos"] { color: var(--green); }
[data-c="neg"] { color: var(--red); }
[data-c="warn"] { color: var(--orange); }
[data-c="gold"] { color: var(--gold); }
::selection { background: rgba(242, 193, 78, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(139, 160, 210, .18); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── Barra superior ─────────────────────────────────────────────────────── */
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: rgba(6, 10, 20, .72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.brand-icon {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 24px; flex: none;
  background: linear-gradient(145deg, #2b3d6e, #141e38);
  border: 1px solid var(--line2); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 18px rgba(0, 0, 0, .35);
}
.brand-text { min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; letter-spacing: -.01em; }
.brand-tier { display: flex; align-items: center; gap: 8px; color: var(--gold); font-size: 12px; font-weight: 650; }
.tier-bar { width: 70px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.tier-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 99px; transition: width .4s; }

.clock { display: flex; align-items: center; gap: 12px; }
.date { display: flex; align-items: center; gap: 6px; font-weight: 650; min-width: 140px; justify-content: flex-end; font-variant-numeric: tabular-nums; color: var(--text2); }
.speed { display: flex; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.speed button {
  background: none; border: 0; padding: 5px 10px; border-radius: 9px; cursor: pointer; color: var(--muted);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 36px;
}
.speed button:hover { color: var(--text); background: var(--card2); }
.speed button.on { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); box-shadow: 0 2px 10px rgba(242, 193, 78, .3); }

.stats { display: flex; gap: 8px; margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stats::-webkit-scrollbar { display: none; }
.stat {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 9px; min-width: 112px;
  background: linear-gradient(180deg, rgba(23, 34, 56, .9), rgba(14, 21, 37, .9));
  border: 1px solid var(--line); border-radius: 13px;
}
.stat > i { font-style: normal; font-size: 17px; width: 30px; height: 30px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); border-radius: 9px; }
.stat span { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.stat b { font-size: 15px; display: inline-block; }
.stat em { font-style: normal; font-size: 10.5px; font-weight: 700; margin-left: 4px; letter-spacing: 0; text-transform: none; }
.stat b, .stat span { white-space: nowrap; }
.stat em[data-c="pos"]::before { content: '▲ '; font-size: 8px; vertical-align: 1px; }
.stat em[data-c="neg"]::before { content: '▼ '; font-size: 8px; vertical-align: 1px; }

/* ─── Estructura ─────────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 236px 1fr 300px; height: calc(100vh - 72px); }
.sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 10px; overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 12px 12px 4px; }
.nav-group:first-child { padding-top: 2px; }
.nav button {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: 1px solid transparent; border-radius: 11px; padding: 8px 12px; cursor: pointer; color: var(--muted); font-weight: 550; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav button:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav button.on { background: linear-gradient(90deg, rgba(242, 193, 78, .14), rgba(242, 193, 78, .03)); border-color: rgba(242, 193, 78, .22); color: var(--text); }
.nav button.on::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.nav button.locked { opacity: .45; }
.nav .ico { width: 20px; text-align: center; }
.nav .lock { margin-left: auto; font-size: 11px; }
.nav .badge { margin-left: auto; background: var(--gold); color: var(--gold-ink); border-radius: 99px; padding: 0 7px; font-size: 11px; font-weight: 800; }
.nav .badge.dim { background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line2); font-weight: 650; }
.nav-foot { display: flex; flex-direction: column; gap: 6px; }

main { overflow-y: auto; padding: 18px 20px 40px; }
.feed { border-left: 1px solid var(--line); padding: 16px 14px; overflow-y: auto; background: rgba(6, 10, 20, .35); }
.feed h3 { display: flex; align-items: center; gap: 8px; }
.feed ul { list-style: none; margin: 0; padding: 0 0 0 12px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line2); }
.feed li { position: relative; font-size: 12.5px; padding: 8px 11px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; color: var(--text2); }
.feed li::before { content: ''; position: absolute; left: -17px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--line2); border: 2px solid var(--bg); }
.feed li .d { color: var(--muted); font-size: 10.5px; display: block; font-weight: 600; letter-spacing: .3px; }
.feed li.good::before { background: var(--green); }
.feed li.bad::before { background: var(--red); }
.feed li.warn::before { background: var(--orange); }

/* ─── Tarjetas ───────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.layout > *, .grid > *, .inv-grid > *, .policy > * { min-width: 0; }
.span2 { grid-column: span 2; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .18);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.hint { margin: 12px 0 0; padding: 10px 13px; background: rgba(96, 165, 250, .07); border: 1px solid rgba(96, 165, 250, .22); border-radius: var(--radius-sm); color: #d2e5ff; font-size: 13px; }
.warnbox { margin: 12px 0 0; padding: 10px 13px; background: rgba(251, 113, 133, .08); border: 1px solid rgba(251, 113, 133, .3); border-radius: var(--radius-sm); color: #ffd5dc; font-size: 13px; }
.pill { display: inline-block; background: var(--card2); border: 1px solid var(--line2); border-radius: 99px; padding: 1px 9px; font-size: 12px; margin-left: 6px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { position: relative; background: linear-gradient(180deg, rgba(23, 34, 56, .65), rgba(11, 18, 32, .65)); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; overflow: hidden; }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 193, 78, .1), transparent 70%); }
.kpi span { color: var(--muted); font-size: 12px; display: block; font-weight: 550; }
.kpi b { font-size: 23px; display: block; margin: 3px 0 1px; font-weight: 750; letter-spacing: -.02em; }
.kpi small { color: var(--muted); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl td, .tbl th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.tbl td:first-child, .tbl th:first-child { text-align: left; color: var(--text2); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.tbl tr.total td { font-weight: 750; border-bottom: 0; border-top: 1px solid var(--line2); color: var(--text); }
.tbl tr.sub td { color: var(--muted); font-size: 12px; }
.tbl tr.me td { background: rgba(242, 193, 78, .1); color: var(--gold2); font-weight: 650; }
.tbl tr:hover td { background-color: rgba(255, 255, 255, .02); }
.tbl-wrap { overflow-x: auto; }

/* ─── Botones y controles ────────────────────────────────────────────────── */
.btn {
  border: 1px solid var(--line2); background: linear-gradient(180deg, #1c2943, #152036); color: var(--text);
  padding: 8px 14px; border-radius: 11px; cursor: pointer; font-weight: 650; white-space: nowrap;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { border-color: rgba(139, 160, 210, .4); background: linear-gradient(180deg, #223252, #18243d); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .62; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); border-color: #c99a2e; box-shadow: 0 4px 16px rgba(242, 193, 78, .22); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe39a, var(--gold2)); }
.btn.green { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .45); color: var(--green); }
.btn.green:hover:not(:disabled) { background: rgba(52, 211, 153, .2); }
.btn.red { background: rgba(251, 113, 133, .08); border-color: rgba(251, 113, 133, .4); color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.big { padding: 12px 20px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn.icon { min-width: 32px; padding-left: 8px; padding-right: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { display: flex; justify-content: space-between; gap: 10px; color: var(--text2); }
input[type="range"] { width: 100%; accent-color: var(--gold); height: 22px; }
input[type="text"], select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line2); color: var(--text);
  padding: 11px 13px; border-radius: 11px; font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, .15); }
.chk { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; margin-right: 5px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--gold); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg .btn.on { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); border-color: #c99a2e; }
.chip { border: 1px solid var(--line2); background: rgba(11, 18, 32, .75); color: var(--text2); border-radius: 99px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.chip:hover { border-color: var(--gold); color: var(--text); }

/* ─── Calificaciones ─────────────────────────────────────────────────────── */
.grade {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 5px;
  border-radius: 7px; font-weight: 800; font-size: 12px; color: #08101f;
}
.gA { background: #34d399; } .gB { background: #a3e635; } .gC { background: #f2c14e; }
.gD { background: #fb923c; } .gE { background: #fb7185; }
.grade.unsure::after { content: '?'; font-size: 10px; margin-left: 1px; opacity: .7; }

.mode-goal { margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; }
.stars-big { font-size: 34px; color: var(--gold); letter-spacing: 6px; }
.founder:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Préstamos ──────────────────────────────────────────────────────────── */
.policy { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.rates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rate-chip { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rate-chip b { font-size: 14px; }
.rate-chip small { color: var(--muted); font-size: 11px; }
.auto { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line2); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: center; }

.req-list { display: flex; flex-direction: column; gap: 8px; }
.req {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(160px, 1.3fr) 2.4fr auto; gap: 14px; align-items: center;
  background: linear-gradient(90deg, rgba(23, 34, 56, .55), rgba(11, 18, 32, .55)); border: 1px solid var(--line); border-radius: 13px; padding: 11px 14px 14px 18px;
  transition: border-color .15s;
}
.req:hover { border-color: var(--line2); }
.req::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--g, var(--line2)); }
.req.gr-A { --g: #34d399; } .req.gr-B { --g: #a3e635; } .req.gr-C { --g: #f2c14e; } .req.gr-D { --g: #fb923c; } .req.gr-E { --g: #fb7185; }
.req.vip { border-color: rgba(242, 193, 78, .6); box-shadow: 0 0 0 1px rgba(242, 193, 78, .2) inset, 0 0 24px rgba(242, 193, 78, .08); }
.req-name { font-weight: 700; }
.req-purpose { color: var(--muted); font-size: 12.5px; }
.req-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.req-nums > div > span { display: block; color: var(--muted); font-size: 11px; }
.req-nums b { font-size: 14px; }
.req-actions { display: flex; gap: 6px; }
.req-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .04); }
.req-timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); opacity: .7; transition: width .3s linear; }
.empty { color: var(--muted); padding: 26px; text-align: center; border: 1px dashed var(--line2); border-radius: 13px; }

/* ─── Panel principal ────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: auto 1fr minmax(270px, 340px); gap: 20px; align-items: center; }
.hero-icon {
  font-size: 46px; width: 80px; height: 80px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #34508f, #141e38 70%); border: 1px solid var(--line2); border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.hero h2 { margin: 0; font-size: 21px; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.ladder-mini { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.ladder-mini span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 15px; filter: grayscale(1); opacity: .45; }
.ladder-mini span.done { filter: none; opacity: .9; border-color: rgba(52, 211, 153, .4); }
.ladder-mini span.now { filter: none; opacity: 1; border-color: var(--gold); box-shadow: 0 0 14px rgba(242, 193, 78, .35); background: rgba(242, 193, 78, .1); }
.ladder-mini i { flex: 1; max-width: 16px; height: 2px; background: var(--line2); border-radius: 2px; }
.ladder-mini i.done { background: var(--green); }
.goal { background: rgba(11, 18, 32, .7); border: 1px solid var(--line); border-radius: 14px; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.goal-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; font-weight: 700; }
.req-line { font-size: 12.5px; }
.req-line > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 6px; background: rgba(255, 255, 255, .06); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); border-radius: 99px; transition: width .4s; }
.bar.ok i { background: var(--green); }
.bar.mid i { background: var(--orange); }
.bar.bad i { background: var(--red); }
.bar.big { height: 10px; }

.chart-wrap { position: relative; height: 250px; }
.chart-wrap canvas, .spark { width: 100%; height: 100%; display: block; }
.chart-tip {
  position: absolute; pointer-events: none; background: rgba(8, 13, 25, .94); border: 1px solid var(--line2); border-radius: 10px;
  padding: 8px 11px; font-size: 12px; min-width: 180px; box-shadow: var(--shadow); white-space: nowrap; z-index: 2;
}
.chart-tip .r { display: flex; align-items: center; gap: 12px; justify-content: space-between; color: var(--text2); }
.chart-tip .r i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.chart-tip .d { color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 3px; }
.spark-wrap { height: 70px; margin: 8px 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text2); flex-wrap: wrap; }
.lg::before { content: ''; display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--lg); }
.lg-as { --lg: var(--s1); } .lg-eq { --lg: var(--s2); }

/* Composición del balance (barras apiladas) */
.comp { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.comp-row > span { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.comp-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .04); }
.comp-bar i { display: block; height: 100%; min-width: 2px; transition: width .4s; }
.comp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text2); }
.comp-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }

.quick { display: flex; flex-direction: column; gap: 10px; }
.quick .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ─── Tarjetas de unidades (personal, productos, logros…) ────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.unit { background: linear-gradient(180deg, rgba(23, 34, 56, .6), rgba(11, 18, 32, .6)); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s; }
.unit:hover { border-color: var(--line2); }
.unit.locked { opacity: .86; }
.unit.owned { border-color: rgba(52, 211, 153, .4); }
.unit-head { display: flex; align-items: center; gap: 11px; }
.unit-icon { font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; }
.unit-name { font-weight: 700; }
.unit-lvl { color: var(--gold); font-size: 12px; font-weight: 650; }
.unit p { margin: 0; color: var(--muted); font-size: 12.5px; }
.unit .effect { font-size: 12.5px; color: #d2e5ff; }
.pips { display: flex; gap: 3px; }
.pips i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .07); }
.pips i.on { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.unit .btn { margin-top: auto; }

.inv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.inv-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.inv-row span { color: var(--muted); }
.inv-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.inv-actions .lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }

.locked-view { max-width: 520px; margin: 60px auto; text-align: center; }
.locked-view .big-ico { font-size: 54px; }

.help h4 { margin: 18px 0 6px; color: var(--gold); }
.help p, .help li { color: var(--text2); }
.help ul { padding-left: 18px; margin: 6px 0; }

/* ─── Modal y avisos ─────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(3, 6, 14, .72); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(6px); }
.modal.hidden { display: none; }
.modal-card {
  width: min(580px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: linear-gradient(180deg, rgba(25, 36, 62, .97), rgba(14, 21, 38, .97));
  border: 1px solid var(--line2); border-radius: 22px; padding: 26px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: pop .2s ease-out;
}
.modal-card h2 { margin: 0 0 10px; font-size: 21px; }
.modal-card p { color: var(--text2); }
.modal-card .btn-row { justify-content: flex-end; margin-top: 20px; }
.modal-card .center { text-align: center; }
.title-logo { font-size: 58px; text-align: center; filter: drop-shadow(0 8px 24px rgba(242, 193, 78, .25)); }
.title-name { font-size: 32px; font-weight: 850; text-align: center; margin: 0; letter-spacing: -.02em; background: linear-gradient(90deg, var(--gold2), var(--gold), #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title-sub { text-align: center; color: var(--muted); margin: 4px 0 18px; }
.ladder { display: flex; justify-content: center; gap: 4px; font-size: 22px; margin: 6px 0 16px; flex-wrap: wrap; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.unlock-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.unlock-list li { background: rgba(11, 18, 32, .7); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; }

#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; width: min(360px, calc(100vw - 32px)); }
.toast {
  position: relative; overflow: hidden; background: rgba(18, 27, 47, .96); border: 1px solid var(--line2); border-radius: 13px;
  padding: 11px 14px 13px 16px; box-shadow: var(--shadow); animation: slide .25s ease-out; font-size: 13px; color: var(--text2); backdrop-filter: blur(8px);
}
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.toast::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--line2); animation: shrink 4.2s linear forwards; }
.toast.good::before { background: var(--green); }
.toast.bad::before { background: var(--red); }
.toast.warn::before { background: var(--orange); }
.toast.out { opacity: 0; transform: translateX(16px); transition: all .3s; }

@keyframes pop { from { transform: scale(.96) translateY(6px); opacity: 0; } }
@keyframes slide { from { transform: translateY(14px); opacity: 0; } }
@keyframes shrink { to { width: 0; } }

/* ─── Alertas, etiquetas, negociación, logros, accionistas ───────────────── */
#banner { display: flex; flex-direction: column; gap: 8px; }
#banner:not(:empty) { margin-bottom: 16px; }
.alert { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); font-size: 13.5px; backdrop-filter: blur(8px); }
.alert.bad { border-color: rgba(251, 113, 133, .45); background: rgba(251, 113, 133, .09); }
.alert.warn { border-color: rgba(251, 176, 77, .45); background: rgba(251, 176, 77, .09); }
.alert.good { border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .09); }

.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line2); color: var(--muted); font-weight: 600; }
.tag.good { color: var(--green); border-color: rgba(52, 211, 153, .45); }
.tag.big { font-size: 13px; padding: 4px 10px; }
.tag.cc { font-weight: 800; letter-spacing: .5px; color: var(--blue); border-color: rgba(96, 165, 250, .4); }
.tag.cc.big { font-size: 15px; padding: 7px 10px; border-radius: 11px; }

.neg { display: flex; flex-direction: column; gap: 14px; margin: 14px 0; }
.neg-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.neg-sum > div, .nem-stats > div { background: rgba(11, 18, 32, .7); border: 1px solid var(--line); border-radius: 11px; padding: 8px 12px; }
.neg-sum span, .nem-stats span { display: block; color: var(--muted); font-size: 11px; }
.neg-sum b { font-size: 15px; }

.nemesis { margin-bottom: 16px; border-color: rgba(251, 113, 133, .3); background: linear-gradient(120deg, rgba(60, 18, 34, .55), var(--card) 55%); }
.nem-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nem-row h3 { margin: 2px 0; font-size: 18px; }
.nem-row p { margin: 0; }
.nem-ico { font-size: 44px; }
.nem-stats { display: flex; gap: 10px; }
.unit.nem-unit { border-color: rgba(251, 113, 133, .5); }

.unit.ach.owned { border-color: rgba(242, 193, 78, .55); background: linear-gradient(180deg, rgba(242, 193, 78, .12), rgba(11, 18, 32, .6)); }
.unit.ach:not(.owned) .unit-icon { filter: grayscale(1); opacity: .55; }

.satbar { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; margin-bottom: 8px; }
.satbar i { display: block; height: 100%; border-radius: 99px; transition: width .3s; }
.spark-wrap.tall { height: 130px; }

.unit.prod .field { margin: 4px 0; }
.unit.prod .tbl { font-size: 12.5px; }
.unit.prod .seg .btn, .unit.prod .btn-row .btn { margin-top: 0; }

/* ─── Globo terráqueo ────────────────────────────────────────────────────── */
.world { display: grid; grid-template-columns: 1fr; gap: 16px; }
.globe-card { padding: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #0e1a36 0%, #070c1a 70%); }
.globe-wrap { position: relative; }
#globe { width: 100%; height: auto; display: block; aspect-ratio: 1000 / 620; cursor: grab; touch-action: none; user-select: none; }
#globe:active { cursor: grabbing; }
#globe .stars circle { fill: #cfe0ff; }
#globe.flat .stars, #globe.flat .atmo { display: none; }
#globe .sphere { stroke: rgba(120, 170, 255, .25); stroke-width: .8; }
#globe .grat { fill: none; stroke: rgba(160, 200, 255, .09); stroke-width: .5; }
#globe .shade, #globe .light, #globe .atmo, #globe .arcs, #globe .sel-label, #globe .stars { pointer-events: none; }
#globe .land { fill: #2a3657; stroke: #0a1430; stroke-width: .45; stroke-linejoin: round; transition: fill .25s; }
#globe .land.np { fill: #233050; }
#globe .land.pl { cursor: pointer; }
#globe .land.pl:hover { filter: brightness(1.3) saturate(1.15); }
#globe .st-locked { fill: #34436a; }
#globe .st-soon { fill: #3d5b96; }
#globe .st-avail { fill: #3f8ae6; }
#globe .st-open { fill: #20b383; }
#globe .st-home { fill: #f2c14e; }
#globe .land.sel { stroke: #fff; stroke-width: 1.6; }
#globe .arcs path { fill: none; stroke: var(--gold2); stroke-width: 1.4; stroke-dasharray: 5 5; opacity: .9; animation: dash 1.6s linear infinite; }
#globe .arcs path.glow { stroke: var(--gold); stroke-width: 5; stroke-dasharray: none; opacity: .16; animation: none; }
#globe .mk { cursor: pointer; }
#globe .mk-dot { fill: #cfe0ff; stroke: #07112a; stroke-width: .8; }
#globe .mk.st-open .mk-dot, #globe .mk.st-home .mk-dot { fill: #fff3c4; stroke: #8a5b00; }
#globe .mk-pulse { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: 0; }
#globe .mk.st-open .mk-pulse, #globe .mk.st-home .mk-pulse { animation: pulse 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
#globe .mk.sel .mk-dot { fill: #fff; stroke: var(--gold); stroke-width: 1.6; }
#globe .sel-label rect { fill: rgba(8, 13, 25, .88); stroke: rgba(242, 193, 78, .55); }
#globe .sel-label text { fill: #fff; font-size: 12px; font-weight: 700; font-family: var(--font); }
@keyframes dash { to { stroke-dashoffset: -20; } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3); opacity: 0; } }

.globe-hud { position: absolute; display: flex; gap: 8px; }
.globe-hud.tl { top: 16px; left: 18px; flex-direction: column; gap: 2px; background: rgba(8, 13, 25, .6); border: 1px solid var(--line); border-radius: 13px; padding: 10px 14px; backdrop-filter: blur(8px); max-width: 46%; }
.globe-hud.tl b { font-size: 15px; }
.globe-hud.tl small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.globe-hud.tr { top: 16px; right: 16px; flex-direction: column; align-items: flex-end; }
.globe-hud.tr .seg { background: rgba(8, 13, 25, .6); border: 1px solid var(--line); border-radius: 12px; padding: 3px; backdrop-filter: blur(8px); }
.globe-hud.bl { bottom: 56px; left: 18px; }
.globe-hud.bc { bottom: 14px; left: 0; right: 0; justify-content: center; flex-wrap: wrap; padding: 0 12px; }
.legend-col { flex-direction: column; gap: 3px !important; font-size: 11.5px; color: var(--text2); background: rgba(8, 13, 25, .55); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; backdrop-filter: blur(8px); }
.legend-col i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.lg-home { background: #f2c14e; } .lg-open { background: #20b383; } .lg-avail { background: #3f8ae6; }
.lg-soon { background: #3d5b96; } .lg-locked { background: #34436a; } .lg-np { background: #233050; border: 1px solid var(--line2); }
.globe-tip { position: absolute; z-index: 3; pointer-events: none; width: 240px; background: rgba(8, 13, 25, .94); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.globe-tip[hidden] { display: none; }
.globe-tip b { font-size: 14px; }
.globe-tip .state-pill { margin-left: 0; align-self: flex-start; }
.globe-tip small { color: var(--text2); }
.globe-help { margin: 0; padding: 10px 18px 14px; border-top: 1px solid var(--line); }

.country-card h4 { margin: 16px 0 8px; font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .7px; }
.cp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.cp-head h3 { margin: 0; font-size: 19px; }
.cp-law { color: var(--text2); margin: 8px 0 0; padding: 10px 13px; border-left: 3px solid var(--gold); background: rgba(242, 193, 78, .06); border-radius: 0 10px 10px 0; font-size: 13px; }
.cp-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; }
.laws { display: flex; flex-direction: column; gap: 6px; }
.law { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: rgba(11, 18, 32, .6); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.law span { color: var(--muted); white-space: nowrap; }
.law b { text-align: right; font-weight: 650; }
.law-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.law-grid > div { background: rgba(11, 18, 32, .6); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.law-grid span { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.law-grid b { font-size: 14px; }
.state-pill { margin-left: auto; font-size: 11.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line2); white-space: nowrap; color: var(--muted); font-weight: 650; }
.state-pill.st-home { color: var(--gold); border-color: rgba(242, 193, 78, .5); background: rgba(242, 193, 78, .08); }
.state-pill.st-open { color: var(--green); border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .08); }
.state-pill.st-avail { color: var(--blue); border-color: rgba(96, 165, 250, .5); background: rgba(96, 165, 250, .08); }
.shares { display: flex; flex-direction: column; gap: 8px; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12.5px; color: var(--text2); }
.share-row .bar { grid-column: span 2; margin-top: 0; }
.share-row .bar i { background: var(--s1); }
.share-row.me { color: var(--gold2); }
.share-row.me .bar i { background: var(--gold); }

/* ─── Cartera, clientes, junta y ciberataque ─────────────────────────────── */
.dpd { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.dpd.d30 { background: rgba(251, 176, 77, .12); color: var(--orange); }
.dpd.d60 { background: rgba(251, 146, 60, .16); color: #fb923c; }
.dpd.d90 { background: rgba(251, 113, 133, .16); color: var(--red); }
.dpd.court { background: rgba(167, 139, 250, .16); color: var(--purple); }
.mora-list { display: flex; flex-direction: column; gap: 8px; }
.mora-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 8px 16px; align-items: center;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(11, 18, 32, .55); }
.mora-main { display: flex; flex-direction: column; min-width: 0; }
.mora-main b, .mora-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mora-num span { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.mora-num b { white-space: nowrap; }
.mora-acts { grid-column: 1 / -1; }
@media (max-width: 1000px) { .mora-row { grid-template-columns: 1fr auto; } }
.tbl td.acts { white-space: nowrap; }
.tbl td.acts .btn { margin-left: 4px; }
.story-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text2); }
.story-hist small { color: var(--muted); margin-right: 6px; font-weight: 600; }
.unit.story.st-paid, .unit.story.st-returning { border-color: rgba(52, 211, 153, .4); }
.unit.story.st-lost, .unit.story.st-defaulted, .unit.story.st-closed { opacity: .65; }
.unit.member .unit-icon { font-size: 28px; width: 52px; height: 52px; }
#boardList { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.consp { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.consp span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.consp .bar { flex: 1; margin: 0; }
.consp .bar i { background: linear-gradient(90deg, var(--orange), var(--red)); }
.votes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.vote { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(11, 18, 32, .6); }
.vote.yes { border-color: rgba(52, 211, 153, .4); }
.vote.no { border-color: rgba(251, 113, 133, .4); }
.vote .v-ico { font-size: 24px; }
.vote small { display: block; color: var(--muted); }
.vote .v-res { margin-left: auto; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.vote.yes .v-res { color: var(--green); }
.vote.no .v-res { color: var(--red); }
.btn.red:hover:not(:disabled) { background: rgba(251, 113, 133, .16); }

.cy-top { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.cy-top span { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 38px; color: var(--red); }
.cy-timer { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.cy-timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--orange)); transition: width .25s linear; }
.cy-grid { display: flex; flex-direction: column; gap: 8px; }
.cy-sys { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(11, 18, 32, .6); transition: border-color .15s, box-shadow .15s; }
.cy-sys { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: center; padding: 9px 12px; }
.cy-sys .cy-head { grid-column: 1 / -1; }
.cy-sys .btn-row { margin-top: 6px; flex-wrap: nowrap; }
.cy-sys.hit { border-color: rgba(251, 113, 133, .7); box-shadow: 0 0 0 1px rgba(251, 113, 133, .3), 0 0 18px rgba(251, 113, 133, .15); }
.cy-sys.guarded { background: rgba(52, 211, 153, .07); }
.cy-sys.off { opacity: .5; }
.cy-head { display: flex; align-items: center; gap: 10px; }
.cy-ico { font-size: 20px; }
.cy-head small { display: block; color: var(--muted); font-size: 11.5px; }
.cy-pct { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.cy-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; margin: 6px 0 0; }
.cy-bar i { display: block; height: 100%; transition: width .2s; }

/* ─── Capas del globo, eventos y divisas ─────────────────────────────────── */
#globe .cev-icons text { font-size: 15px; pointer-events: none; paint-order: stroke; stroke: rgba(7, 12, 26, .85); stroke-width: 3px; }
.globe-hud .tension { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.globe-hud .tension .bar { width: 80px; margin: 0; }
.globe-hud .tension b { font-size: 11px; }
.legend-col .lg-title { font-size: 11.5px; color: var(--text); margin-bottom: 4px; max-width: 210px; }
.heat-bar { width: 200px; height: 10px; border-radius: 4px; }
.heat-scale { display: flex; justify-content: space-between; width: 200px; font-size: 10.5px; color: var(--text2); margin-bottom: 4px; }
.cp-alerts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cp-alerts .alert { font-size: 12.5px; padding: 8px 12px; }

/* ─── Microcréditos, banca digital, fondos y banca de inversión ─────────── */
.desk-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mini-row > span:nth-child(2) { flex: 1; min-width: 0; }
.mini-row:last-child { border-bottom: 0; }
.vs-row { display: grid; grid-template-columns: minmax(52px, auto) 1fr 30px; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); }
.vs-row .satbar { margin: 0; height: 8px; }
.vs-row b { text-align: right; }
.fund-spark { width: 100%; height: 56px; display: block; }
.spark-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text2); }
.spark-legend span::before { content: ''; display: inline-block; width: 14px; height: 0; margin-right: 6px; vertical-align: middle; }
.spark-legend .lg-f::before { border-top: 2px solid var(--s1); }
.spark-legend .lg-b::before { border-top: 1.5px dashed var(--muted); }
.unit.fund .tbl td, .unit.deal .tbl td { padding: 5px 2px; font-size: 12.5px; }
.unit.deal .warnbox { margin: 0; }
#ibLeague { display: flex; flex-direction: column; gap: 8px; }

/* ─── Modos, fundadores, récords, sonido, periódico y sede ─────────────── */
.modal-card.wide { width: min(980px, 100%); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form select:disabled { opacity: .6; }
.hidden { display: none !important; }
.founders { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.founder { display: flex; flex-direction: column; justify-content: flex-start; text-align: left; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 11px; color: var(--text); cursor: pointer; font: inherit; }
.founder:hover { border-color: rgba(242, 193, 78, .4); }
.founder.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(242, 193, 78, .14), rgba(242, 193, 78, .03)); box-shadow: 0 0 0 1px var(--gold) inset; }
.founder b { font-size: 13px; }
.founder ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 3px; }
.founder li { font-size: 11.5px; color: var(--text2); padding-left: 14px; position: relative; line-height: 1.35; }
.founder li::before { position: absolute; left: 0; font-weight: 800; }
.founder li.pro::before { content: '+'; color: var(--green); }
.founder li.con::before { content: '−'; color: var(--red); }
.rec-mini { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text2); background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rec-tbl td, .rec-tbl th { text-align: left; vertical-align: top; }
.rec-tbl tr.me td { background: rgba(242, 193, 78, .07); }
.mode-box { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: rgba(96, 165, 250, .08); border: 1px solid rgba(96, 165, 250, .3); }
.mode-box.bad { background: rgba(251, 113, 133, .08); border-color: rgba(251, 113, 133, .3); }
.mode-box small { color: var(--text2); }
.goodbox { margin: 12px 0 0; padding: 10px 13px; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35); border-radius: var(--radius-sm); color: #c9f5e2; }
.audio-btns { display: flex; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.audio-btns button { background: none; border: 0; padding: 4px 8px; border-radius: 9px; cursor: pointer; font-size: 14px; opacity: .5; }
.audio-btns button.on { opacity: 1; background: var(--card2); }
.nav-foot { display: grid; grid-template-columns: 1fr 1fr; }
.hq-card { padding-bottom: 0; overflow: hidden; }
.hq-wrap { margin: 0 -22px; }
.hq-svg { display: block; width: 100%; height: 250px; }
.hq-card { display: flex; flex-direction: column; }
.hq-card .hq-wrap { flex: 1; margin-bottom: 0; }
.hq-card .hq-svg { height: 100%; min-height: 230px; }
/* Periódico */
.paper-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.paper-bar .field { flex-direction: row; align-items: center; gap: 10px; }
.paper { background: #f3ecd9; color: #1f1b16; border-radius: 6px; padding: 22px 26px 26px; font-family: Georgia, 'Times New Roman', serif; box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  background-image: radial-gradient(rgba(60, 45, 20, .06) 1px, transparent 1px); background-size: 4px 4px; }
.modal-card .paper { margin: -6px; }
.paper-top { display: flex; justify-content: space-between; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #1f1b16; padding-bottom: 6px; }
.paper-mast { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: clamp(30px, 5vw, 54px); text-align: center; margin: 8px 0 2px; letter-spacing: -.5px; color: #1f1b16; }
.paper-rule { border-top: 3px double #1f1b16; border-bottom: 1px solid #1f1b16; text-align: center; font-style: italic; font-size: 12px; padding: 3px 0; margin-bottom: 14px; }
.paper-lead h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.08; margin: 0; text-align: center; color: #1f1b16; }
.paper-lead .deck { text-align: center; font-style: italic; font-size: 15px; margin: 8px auto 14px; max-width: 720px; color: #3b352b; }
.paper-cols { display: grid; grid-template-columns: 1.35fr 1fr 1fr; border-top: 1px solid #1f1b16; }
.pcol { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.pcol + .pcol { border-left: 1px solid #1f1b16; }
.pcol:first-child { padding-left: 0; }
.pcol:last-child { padding-right: 0; }
.paper article h3 { font-family: 'Playfair Display', Georgia, serif; font-size: 16px; line-height: 1.2; margin: 0 0 4px; color: #1f1b16; }
.paper article.big h3 { font-size: 19px; }
.paper article p, .paper .paper-box p, .paper-ads p { margin: 0; font-size: 13px; line-height: 1.45; color: #2e2922; }
.paper article + article { border-top: 1px solid rgba(31, 27, 22, .3); padding-top: 10px; }
.paper figure { margin: 0; }
.paper figcaption { font-size: 11.5px; font-style: italic; color: #3b352b; margin-top: 4px; }
.paper-photo .hq-svg { height: 150px; filter: grayscale(1) contrast(1.1) brightness(1.15); border: 1px solid #1f1b16; }
.paper-cartoon .cartoon { width: 100%; height: auto; border: 1px solid #1f1b16; display: block; }
.paper-box { border: 1px solid #1f1b16; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.paper h4 { font-family: 'Playfair Display', Georgia, serif; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; margin: 0 0 4px; color: #1f1b16; }
.paper-ads { border-top: 3px double #1f1b16; padding-top: 6px; }
.paper-ads p { font-size: 11.5px; margin-bottom: 4px; }
@media (max-width: 900px) {
  .founders { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .paper-cols { grid-template-columns: 1fr; }
  .pcol, .pcol:first-child, .pcol:last-child { padding: 12px 0; }
  .pcol + .pcol { border-left: 0; border-top: 1px solid #1f1b16; }
}

/* ─── Tutorial y menú gradual ──────────────────────────────────────────── */
.coach { position: fixed; left: 252px; bottom: 16px; width: 360px; z-index: 40; background: linear-gradient(180deg, rgba(30, 44, 76, .98), rgba(16, 24, 44, .98));
  border: 1px solid rgba(242, 193, 78, .45); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow), 0 0 0 4px rgba(242, 193, 78, .06); display: flex; flex-direction: column; gap: 6px; }
.coach.min { width: auto; padding: 0; border: 0; background: none; box-shadow: none; }
.coach-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .8px; }
.coach-x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 4px; }
.coach b { font-size: 15px; }
.coach p { margin: 0; color: var(--text2); font-size: 13px; line-height: 1.45; }
.coach-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 4px 0; }
.coach-bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.coach-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coach-foot .ghost { margin-left: auto; }
.coach-pill { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); border: 0; border-radius: 99px; padding: 8px 14px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); font: inherit; font-weight: 800; }
@keyframes tutPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 193, 78, .7); } 50% { box-shadow: 0 0 0 6px rgba(242, 193, 78, 0); } }
.tut-glow { animation: tutPulse 1.4s ease-in-out infinite; outline: 2px solid var(--gold); outline-offset: 2px; }
.nav .badge.new { background: var(--green); color: #052b1d; }
.nav-next { margin: 10px 4px 0; padding: 9px 10px; border: 1px dashed var(--line2); border-radius: 11px; font-size: 11.5px; color: var(--muted); line-height: 1.4; white-space: normal; }

/* ─── Tarjetas, grandes clientes y equipo directivo ─────────────────────── */
.cc-grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
.card-unit .unit-name { margin-top: 4px; }
.ccard { position: relative; aspect-ratio: 1.586; border-radius: 13px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .25); font-size: 12px; }
.ccard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 38%); pointer-events: none; }
.unit.locked .ccard { filter: grayscale(.8) brightness(.7); }
.cc-top, .cc-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cc-bank { font-weight: 800; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-cat { font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; font-size: 10.5px; opacity: .9; }
.cc-chip { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #f6dd9a, #c9a24a); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
  background-image: linear-gradient(90deg, transparent 45%, rgba(0, 0, 0, .25) 45% 55%, transparent 55%), linear-gradient(0deg, transparent 45%, rgba(0, 0, 0, .25) 45% 55%, transparent 55%), linear-gradient(135deg, #f6dd9a, #c9a24a); }
.cc-num { font-family: 'Courier New', monospace; font-size: 15px; letter-spacing: 1.5px; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.cc-bottom span:first-child { font-size: 10.5px; letter-spacing: 1px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-net, .net-badge { font-weight: 900; font-style: italic; letter-spacing: .5px; white-space: nowrap; }
.net-badge { display: grid; place-items: center; min-width: 74px; height: 42px; padding: 0 8px; border-radius: 10px; font-size: 12px; color: #fff; background: #26365a; }
.net-badge.net-local { background: #3a4a6e; } .net-badge.net-orbe { background: #1f4f9a; } .net-badge.net-mundo { background: #9a3d1f; }
.net-badge.net-ambar { background: linear-gradient(135deg, #b98a2e, #6e4a12); } .net-badge.net-austral { background: #8e1f2c; font-style: normal; }
.cc-net.net-orbe { font-size: 16px; } .cc-net.net-mundo { font-size: 15px; text-transform: lowercase; }
.cc-net.net-ambar { color: #ffe6a8; font-size: 13px; } .cc-net.net-local { font-size: 10px; font-style: normal; opacity: .85; }
.cc-clasica { background: linear-gradient(135deg, #2b5fae, #163563); }
.cc-joven { background: linear-gradient(135deg, #8a3ff0, #e0408f); }
.cc-oro { background: linear-gradient(135deg, #d9a93b, #8a6110); color: #2a1d02; }
.cc-empresarial { background: linear-gradient(135deg, #1d7a72, #0d3b3c); }
.cc-platino { background: linear-gradient(135deg, #cfd6df, #7d8896); color: #1d232c; }
.cc-millas { background: linear-gradient(135deg, #3aa3e3, #145a96); }
.cc-black { background: linear-gradient(135deg, #2b2b2e, #070708); color: #e8e2d0; }
.cc-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text2); }
.tag.bad { color: var(--red); border-color: rgba(251, 113, 133, .45); }
.unit.exec.vacant { border-style: dashed; }
.exec-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stars { color: var(--gold); letter-spacing: 1px; }
.exec-log { margin-top: 14px; }
.cand-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cand { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card2); }
.cand-acts { display: flex; flex-direction: column; gap: 6px; flex: none; }
@media (max-width: 760px) { .cand { flex-direction: column; align-items: stretch; } .cand-acts { flex-direction: row; } }

/* ─── Gráficos de estadísticas y rival en el mapa ─────────────────────── */
.chart-host { min-height: 120px; }
.chart-legend { margin: 2px 0 8px; flex-wrap: wrap; gap: 6px 14px; }
.chart-svg { position: relative; }
.schart { display: block; width: 100%; height: auto; overflow: visible; }
.schart .grid line { stroke: var(--line); stroke-width: 1; }
.schart .grid line.zero { stroke: var(--muted); stroke-opacity: .6; }
.schart text { fill: var(--muted); font-size: 10.5px; font-family: Inter, sans-serif; font-variant-numeric: tabular-nums; }
.schart .xh { stroke: var(--text2); stroke-opacity: .45; stroke-width: 1; stroke-dasharray: 3 3; }
.ctip { position: absolute; z-index: 5; min-width: 170px; pointer-events: none; background: rgba(10, 16, 30, .96); border: 1px solid var(--line2); border-radius: 10px;
  padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.ctip[hidden] { display: none; }
.ct-h { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ct-r, .ct-tot { display: grid; grid-template-columns: 10px 1fr auto; gap: 7px; align-items: center; color: var(--text2); }
.ct-r i { width: 10px; height: 10px; border-radius: 3px; }
.ct-r b, .ct-tot b { color: var(--text); font-variant-numeric: tabular-nums; }
.ct-tot { grid-template-columns: 1fr auto; border-top: 1px solid var(--line); padding-top: 3px; margin-top: 2px; }
.rival-box { margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(217, 89, 38, .45); background: rgba(217, 89, 38, .07); display: flex; flex-direction: column; gap: 8px; }
.rb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rb-bars { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--text2); }
.rb-bars .bar { margin: 0; }

/* ─── Accesibilidad y espacios de guardado ──────────────────────────────── */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
#globe:focus-visible { outline-offset: -3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--gold-ink); padding: 10px 16px; border-radius: 10px; font-weight: 800; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gsel select { margin-top: 8px; width: 100%; font-size: 12.5px; padding: 6px 8px; }
.chart-table { margin-top: 8px; font-size: 12.5px; }
.chart-table summary { cursor: pointer; color: var(--text2); font-weight: 600; width: max-content; padding: 2px 4px; }
.chart-table .tbl-wrap { max-height: 280px; overflow: auto; margin-top: 6px; }
.chart-table td, .chart-table th { padding: 4px 8px; font-size: 12px; }
.opts { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 16px; }
.switch.opt { align-items: flex-start; }
.keys { padding-left: 18px; color: var(--text2); font-size: 13px; line-height: 1.9; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line2); border-bottom-width: 2px; background: var(--card2); font: 600 11.5px var(--font); text-align: center; color: var(--text); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; background: var(--card2); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.slot:hover { border-color: rgba(242, 193, 78, .45); }
.slot.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.slot.empty { border-style: dashed; }
.slot-n { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--gold); }
.slot-bank { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .btn-row { margin-top: 6px; }
@media (max-width: 760px) { .slots { grid-template-columns: 1fr; } }
/* Texto más grande */
html.big body { zoom: 1.15; }
/* Reducir animaciones */
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.calm .tut-glow { outline: 3px solid var(--gold); }
@media (prefers-reduced-motion: reduce) { html:not(.calm-off) .tut-glow { animation: none; } }
/* Alto contraste */
html.hc { --muted: #b9c4dc; --text2: #e4eaf6; --line: rgba(170, 190, 230, .38); --line2: rgba(190, 205, 240, .6); --card: #0f1729; --card2: #182339; }
html.hc .card, html.hc .unit, html.hc .stat, html.hc .modal-card, html.hc .globe-hud.tl, html.hc .coach { backdrop-filter: none; background: var(--card); }
html.hc .btn { border-width: 1.5px; }
html.hc .btn:disabled { opacity: .7; }
html.hc .unit.locked { opacity: 1; }
html.hc .nav button { color: var(--text2); }
html.hc .ccard::after, html.hc .kpi::after { display: none; }
html.hc :focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--gold); }

.lang-sel { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 10px; }
.lang-sel select { padding: 5px 10px; font-size: 13px; width: auto; }
/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1500px) {
  .stat { min-width: 0; }
  .stat > i, .stat em { display: none; }
}
@media (max-width: 1360px) {
  .layout { grid-template-columns: 226px 1fr; }
  .feed { display: none; }
  .stat:nth-child(5) { display: none; }
}
@media (max-width: 1100px) {
  .stat { min-width: 0; }
  .stat > i { display: none; }
  .law-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-body { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .brand { min-width: 0; }
  .stats { margin-left: 0; width: 100%; overflow-x: auto; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 16px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav-group { display: none; }
  .nav button { white-space: nowrap; }
  .nav button.on::before { display: none; }
  .nav-foot { flex-direction: row; }
  main { padding: 16px; overflow: visible; }
  .feed { display: block; border-left: 0; border-top: 1px solid var(--line); }
  .grid, .inv-grid, .policy, .auto, .kpis { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero { grid-template-columns: 1fr; }
  .req { grid-template-columns: 1fr; }
  .req-nums { grid-template-columns: repeat(3, 1fr); }
  .rates { gap: 4px; }
  .rate-chip small { font-size: 10px; }
  .neg-sum { grid-template-columns: 1fr 1fr; }
  .globe-hud.bl { display: none; }
  .globe-hud.tl { max-width: 60%; }
}

@media (max-width: 1360px) { .coach { left: 252px; } }
@media (max-width: 1000px) {
  .coach { left: 16px; }
  .nav-next { display: none; }
  .sidebar { position: sticky; top: 0; z-index: 30; background: var(--bg); }
  .feed ul { max-height: 360px; overflow-y: auto; }
  .tbl-wrap { overflow-x: auto; }
}
/* Celular */
@media (max-width: 760px) {
  .topbar { padding: 8px 10px; gap: 8px; }
  .brand { flex: 1; }
  .clock { width: 100%; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
  .date { min-width: 0; font-size: 13px; justify-content: flex-start; flex: 1 0 100%; }   /* la fecha en su propia fila */
  .rate-chip { min-width: 0; padding: 8px 2px; }
  .rate-chip b { font-size: 12.5px; }
  .speed button { padding: 7px 9px; min-width: 34px; }
  .stats { gap: 6px; }
  .stat { padding: 6px 10px; flex: none; }
  .stat b { font-size: 15px; }
  .stat:nth-child(5) { display: flex; }
  .sidebar { padding: 6px 10px; gap: 6px; }
  .nav button { padding: 9px 11px; }
  .nav-foot { display: flex; overflow-x: auto; gap: 6px; }
  .nav-foot .btn { flex: none; }
  main { padding: 10px; }
  .card { padding: 15px; border-radius: 16px; }
  .grid { gap: 12px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi b { font-size: 19px; }
  .hero-icon { display: none; }
  .ladder-mini { flex-wrap: wrap; }
  .req-nums { grid-template-columns: repeat(2, 1fr); }
  .req-actions .btn { padding: 9px 14px; }
  .mora-row { grid-template-columns: 1fr; }
  .modal { padding: 6px; align-items: end; }
  .modal-card { padding: 18px 16px; border-radius: 18px; max-height: calc(100vh - 12px); }
  .modal-card .btn-row { justify-content: stretch; }
  .modal-card .btn-row .btn { flex: 1 1 auto; }
  .founders { grid-template-columns: 1fr; }
  .title-logo { font-size: 42px; }
  .title-name { font-size: 26px; }
  #toasts { left: 8px; right: 8px; top: 8px; bottom: auto; width: auto; }
  .toast { max-width: none; }
  .coach { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .coach.min { right: auto; }
  .coach-pill { max-width: calc(100vw - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .toast { font-size: 12.5px; padding: 9px 12px; }
  .coach:not(.min) ~ #toasts, body:has(.coach:not(.min):not(.hidden)) #toasts { display: none; }
  .paper { padding: 14px; }
  .paper-top { flex-wrap: wrap; gap: 4px; font-size: 10px; }
  .hq-svg { height: 190px; }
  .desk-row { flex-direction: column; align-items: stretch; }
  .clock { flex-wrap: wrap; row-gap: 6px; }
  .date span { white-space: nowrap; }
  .speed button { padding: 6px 7px; min-width: 30px; }
  .audio-btns button { padding: 4px 6px; }
  .globe-wrap { display: flex; flex-direction: column; gap: 8px; }
  .globe-hud { position: static !important; max-width: 100% !important; }
  .globe-hud.tr { order: -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .globe-hud.tl { order: 1; }
  .globe-hud.bc { order: 2; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 0 0 4px; }
  .globe-hud.bc .chip { flex: none; }
  .globe-hud.bl { display: flex; order: 3; }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr; }
  .speed button { padding: 6px 7px; min-width: 30px; }
}

/* Centro de alertas y asesor */
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.alert-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .03); border-left: 3px solid var(--s1, #64748b); }
.alert-list li.al-crit { border-left-color: var(--red); background: rgba(251, 113, 133, .08); }
.alert-list li.al-warn { border-left-color: var(--orange); }
.alert-list li.al-info { border-left-color: var(--blue, #60a5fa); }
.alert-list li.al-tip { border-left-color: var(--gold); }
.alert-list li .btn { flex: none; }
.alert-btn { position: relative; }
.alert-btn span { position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--orange); color: #111; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.alert-btn span.crit { background: var(--red); color: #fff; }

/* Calificación crediticia */
.rating-row { display: flex; gap: 16px; align-items: center; }
.rating-big { font-size: 34px; font-weight: 800; padding: 10px 18px; border-radius: 14px; background: rgba(52, 211, 153, .12); color: var(--green); min-width: 96px; text-align: center; }
.rating-big.junk { background: rgba(251, 113, 133, .12); color: var(--red); }

/* Puntaje del buró en cada solicitud */
.score-txt { display: block; font-size: 10.5px; line-height: 1.2; margin: 1px 0 2px; white-space: nowrap; }
