/* Ojo de Dios — web. Estilo analitico tipo Revert Finance: oscuro, tarjetas limpias, numeros tabulares.
   Responsive: PC (sidebar), iPad (sidebar compacta), celular (nav superior deslizable). */
:root {
  --bg: #070709;
  --panel: #0e0e12;
  --panel-2: #15151b;
  --line: #23232b;
  --line-2: #30303a;
  --text: #ecebe8;
  --muted: #9a978f;
  --faint: #5f5c56;
  --accent: #d97757;
  --accent-2: #c4643f;
  --green: #22d39a;
  --red: #f0506e;
  --amber: #f5b544;
  --btc: #f7931a;
  --cyan: #4cc9f0;
  --mine: #22d39a;
  --src: #f5c542;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--cyan); text-decoration: none; }

/* ---------- navegacion ---------- */
.side { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; }
.logo { width: 64px; height: auto; image-rendering: pixelated; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
nav button { text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 12px; font: 500 13px var(--font); color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
nav button:hover { background: var(--panel-2); color: var(--text); }
nav button.on { background: rgba(34, 211, 154, .10); color: var(--accent); }
nav button .off { font-size: 10px; color: var(--amber); border: 1px solid rgba(245,181,68,.35); border-radius: 6px; padding: 1px 5px; }
.health { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.health.ok .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(34,211,154,.18); }
.health.bad .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(240,80,110,.18); }

/* ---------- contenido ---------- */
main { padding: 24px 28px 48px; display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-content: start; max-width: 1560px; width: 100%; }
h1 { grid-column: span 12; margin: 0 0 4px; font: 600 22px var(--font); letter-spacing: -.01em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.w12 { grid-column: span 12; } .w8 { grid-column: span 8; } .w6 { grid-column: span 6; } .w4 { grid-column: span 4; } .w3 { grid-column: span 3; }
.h { font: 500 12px var(--font); color: var(--muted); margin: 0 0 12px; letter-spacing: .02em; text-transform: uppercase; }
.big { font: 600 32px/1.1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi { font: 600 18px var(--font); font-variant-numeric: tabular-nums; margin: 4px 0; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--amber); } .mut { color: var(--muted); }
.mine { color: var(--mine); } .src { color: var(--src); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { font: 500 11px var(--font); color: var(--muted); text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td:first-child { white-space: nowrap; }
.card { overflow-x: auto; }

.bits { display: flex; height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bits i { flex: 1; } .bits i.on { background: linear-gradient(90deg, var(--btc), #ffb347); }

.btn { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px; font: 500 13px var(--font); }
.btn:hover { border-color: var(--faint); }
.btn.green { background: rgba(34,211,154,.12); border-color: rgba(34,211,154,.45); color: var(--accent); }
.btn.red { background: rgba(240,80,110,.10); border-color: rgba(240,80,110,.45); color: var(--red); }
.btn.arm { background: var(--red); color: #fff; }
input, select { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); padding: 9px 11px; font: 13px var(--font); width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; margin: 8px 0; }
label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }

.pill { font: 600 10.5px var(--font); padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line-2); letter-spacing: .03em; }
.pill.ok { color: var(--green); border-color: rgba(34,211,154,.45); background: rgba(34,211,154,.08); }
.pill.degraded { color: var(--amber); border-color: rgba(245,181,68,.45); }
.pill.down { color: var(--red); border-color: rgba(240,80,110,.45); }
.pill.unverified { color: var(--muted); }

.range { position: relative; height: 10px; background: var(--panel-2); border-radius: 99px; min-width: 150px; }
.range .band { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: rgba(34,211,154,.35); }
.range .band.out { background: rgba(240,80,110,.35); }
.range .band.mine { background: rgba(34,211,154,.45); }
.range .band.src { background: rgba(245,197,66,.55); top: 2px; bottom: 2px; }
.range .now { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: #fff; }
svg text { fill: var(--muted); font: 11px var(--font); }

.seg { display: inline-flex; gap: 4px; grid-column: span 12; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: fit-content; }
.seg button { background: none; border: 0; border-radius: 9px; padding: 7px 14px; font: 500 13px var(--font); color: var(--muted); }
.seg button.on { background: var(--panel-2); color: var(--text); }

.off-box { text-align: center; padding: 36px; color: var(--muted); }
.off-box b { display: block; font: 600 13px var(--font); color: var(--amber); margin-bottom: 8px; letter-spacing: .06em; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; z-index: 9; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.login { grid-column: span 12; display: grid; place-items: center; min-height: 70vh; gap: 20px; text-align: center; }
.login .logo { width: 120px; }
.loginform { display: grid; gap: 10px; width: min(320px, 90vw); }
.loginform button { padding: 11px; }
.err { color: var(--red); font-size: 12.5px; min-height: 16px; }
.news ul { padding: 0; margin: 0; } .news li { list-style: none; margin: 0 0 12px; line-height: 1.35; }
.news .t { color: var(--faint); font-size: 11.5px; margin-top: 2px; }

/* ---------- pantalla fija (TV) ---------- */
body.screen { grid-template-columns: 1fr; }
body.screen .side { display: none; }
body.screen main { max-width: none; padding: 18px; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-height: 150px; min-width: 0; }
.tile .xl { font: 600 46px/1.05 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .lg { font: 600 28px/1.15 var(--font); font-variant-numeric: tabular-nums; }
.tile.span2 { grid-column: span 2; } .tile.rows2 { grid-row: span 2; }
.bigbar { height: 14px; background: var(--panel-2); border-radius: 99px; margin: 14px 0 6px; position: relative; overflow: hidden; }
.bigbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--btc), #ffb347); }
.ticker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.ticker .sym { font: 500 11px var(--font); color: var(--muted); letter-spacing: .04em; }
.ticker .px { font: 600 22px var(--font); font-variant-numeric: tabular-nums; }
.fng { font: 700 58px var(--font); }
.clock { position: fixed; right: 18px; bottom: 12px; font: 12px var(--mono); color: var(--faint); }

/* ---------- iPad ---------- */
@media (max-width: 1180px) {
  body { grid-template-columns: 196px 1fr; }
  main { padding: 20px; gap: 14px; }
  .w8, .w6 { grid-column: span 12; }
  .w4, .w3 { grid-column: span 6; }
  body.screen main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- celular ---------- */
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo { width: 40px; }
  nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav button { white-space: nowrap; padding: 8px 10px; font-size: 12.5px; }
  .health { display: none; }
  main { padding: 14px 12px 40px; gap: 12px; }
  .w4, .w3 { grid-column: span 12; }
  .card { padding: 14px; }
  .big { font-size: 26px; }
  h1 { font-size: 19px; }
  body.screen main { grid-template-columns: 1fr; }
  .tile.span2 { grid-column: span 1; }
}

/* ---- Arkham / Claude Code ---- */
:root { --claude: #d97757; }
.h, h1, .section-title { font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .06em; }
.h::before { content: '▸ '; color: var(--claude); }
h1::before { content: '> '; color: var(--claude); }
.card, .tile { background: linear-gradient(180deg, rgba(255,255,255,.012), transparent 40%), var(--panel); }
.waffle { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin: 10px 0; }
.waffle i { aspect-ratio: 1; border-radius: 2px; background: var(--panel-2); }
.wlegend { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; font-size: 12.5px; }
.wlegend span { display: flex; align-items: center; gap: 8px; }
.wlegend i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.wlegend b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.cal .dow { font: 500 10.5px var(--mono, monospace); color: var(--faint); text-align: center; padding: 4px 0; }
.cal .day { min-height: 74px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font-size: 11px; overflow: hidden; }
.cal .day.today { border-color: var(--claude); }
.cal .day.out { opacity: .35; }
.cal .num { color: var(--muted); font-size: 11px; }
.cal .ev { display: block; margin-top: 3px; padding: 1px 5px; border-radius: 4px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.AERO { background: rgba(45,108,223,.25); color: #8fb3ff; } .ev.MACRO { background: rgba(217,119,87,.22); color: #f2a585; }
.ev.EARNINGS { background: rgba(245,197,66,.18); color: #f5c542; } .ev.DIVIDEND_EX, .ev.DIVIDEND_PAY, .ev.FIBRA { background: rgba(34,211,154,.16); color: #5fe0b4; }
.evrow { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.evrow:last-child { border-bottom: 0; }
.evrow .d { font: 12px 'JetBrains Mono', monospace; color: var(--muted); }
.tag { font: 600 10px 'JetBrains Mono', monospace; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.hidebtn { background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px 8px; font-size: 11.5px; color: var(--muted); }
.screenbar { position: fixed; bottom: 10px; left: 14px; display: flex; gap: 8px; z-index: 30; }
