/* ============================================================
   InmoRadar · UI "tech" — oscuro por defecto, claro opcional
   ============================================================ */
:root {
  --bg: #06080d;
  --bg-2: #0b0f18;
  --surface: rgba(16, 21, 33, .72);
  --surface-2: rgba(24, 31, 47, .78);
  --surface-solid: #111726;
  --line: rgba(148, 163, 184, .12);
  --line-2: rgba(148, 163, 184, .22);
  --ink: #e7ecf6;
  --ink-2: #b9c2d4;
  --muted: #7d889d;
  --a1: #22d3ee;
  --a2: #6366f1;
  --a3: #a855f7;
  --accent: #38bdf8;
  --grad: linear-gradient(135deg, var(--a1) 0%, var(--a2) 60%, var(--a3) 100%);
  --ok: #34d399; --ok-bg: rgba(52, 211, 153, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --bad: #f87171; --bad-bg: rgba(248, 113, 113, .12);
  --info-bg: rgba(56, 189, 248, .12);
  --glow: 0 0 0 1px rgba(56, 189, 248, .25), 0 8px 30px -8px rgba(56, 189, 248, .35);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5fa; --bg-2: #e9edf5;
  --surface: rgba(255, 255, 255, .82); --surface-2: rgba(255, 255, 255, .95); --surface-solid: #fff;
  --line: rgba(15, 23, 42, .08); --line-2: rgba(15, 23, 42, .16);
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --accent: #0284c7;
  --ok: #059669; --ok-bg: rgba(5, 150, 105, .1);
  --warn: #b45309; --warn-bg: rgba(217, 119, 6, .12);
  --bad: #dc2626; --bad-bg: rgba(220, 38, 38, .09);
  --info-bg: rgba(2, 132, 199, .09);
  --glow: 0 0 0 1px rgba(2, 132, 199, .25), 0 8px 24px -10px rgba(2, 132, 199, .35);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -14px rgba(15, 23, 42, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
/* fondo: rejilla sutil + halos de color */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(34, 211, 238, .10), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 85%);
}
:root[data-theme="light"] body::before { opacity: .7; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--a1); }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 0; letter-spacing: -.025em; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .7rem; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: .95rem; margin: 1rem 0 .55rem; font-weight: 650; letter-spacing: -.01em; }
small, .muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; letter-spacing: -.01em; }
.ico { flex: none; vertical-align: -3px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: rgba(99, 102, 241, .35); }

/* ---------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(10, 13, 22, .55) 100%);
  border-right: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
:root[data-theme="light"] .side { background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; position: relative; overflow: hidden;
  background: radial-gradient(circle at center, rgba(34, 211, 238, .25), rgba(99, 102, 241, .15) 60%, transparent 61%), var(--surface-solid);
  border: 1px solid var(--line-2); box-shadow: var(--glow); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid rgba(34, 211, 238, .35); }
.brand-mark::after { inset: 11px; }
.brand-mark .sweep { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(34, 211, 238, .55), transparent 25%);
  border-radius: 50%; animation: sweep 3.2s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.brand-name { font-weight: 800; font-size: 1.12rem; letter-spacing: -.03em; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-family: var(--mono); font-size: .64rem; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.nav-label { font-family: var(--mono); font-size: .64rem; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; padding: 12px 10px 6px; }
.nav a { display: flex; gap: 11px; align-items: center; padding: 9px 11px; border-radius: 10px; color: var(--ink-2); font-weight: 520; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { color: var(--ink); background: linear-gradient(90deg, rgba(56, 189, 248, .16), rgba(99, 102, 241, .06)); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .18); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav a.on .ico { color: var(--a1); }
.nav .kbd { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-foot a { color: var(--muted); display: flex; gap: 10px; align-items: center; padding: 8px 11px; border-radius: 10px; }
.side-foot a:hover { color: var(--ink); background: var(--surface-2); }

.shell { min-width: 0; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: linear-gradient(180deg, var(--bg) 30%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cmd { flex: 1; max-width: 520px; position: relative; }
.cmd .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cmd input { padding-left: 38px; padding-right: 60px; background: var(--surface); height: 40px; }
.cmd .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.kbd { font-family: var(--mono); font-size: .68rem; color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .72rem; color: var(--ink-2);
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: ping 2s infinite; }
.live.off .dot { background: var(--bad); animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.main { padding: 8px 28px 96px; max-width: 1480px; width: 100%; min-width: 0; }
.page-head { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin: 6px 0 20px; }
.eyebrow { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.eyebrow::before { content: ""; width: 14px; height: 1px; background: var(--grad); }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------- superficies */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: relative; }
.panel-title { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: .92rem; margin: 0 0 14px; }
.panel-title .ico { color: var(--a1); }
.panel-title .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.kpi { display: block; color: inherit; overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; }
.kpi:hover { color: inherit; border-color: rgba(56, 189, 248, .35); transform: translateY(-2px); box-shadow: var(--glow); }
.kpi .l { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.kpi .l .ico { color: var(--a1); }
.kpi .n { font-family: var(--mono); font-size: 2.3rem; font-weight: 600; letter-spacing: -.04em; margin-top: 10px; line-height: 1; }
.kpi .d { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.kpi.hero { background: linear-gradient(135deg, rgba(34, 211, 238, .14), rgba(99, 102, 241, .10) 55%, var(--surface)); border-color: rgba(56, 189, 248, .28); }
.kpi.hero .n { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .spark { position: absolute; right: 14px; bottom: 14px; opacity: .9; }

/* ---------------------------------------------------- botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  height: 38px; padding: 0 14px; border-radius: 10px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; white-space: nowrap; transition: all .15s; }
.btn:hover { color: var(--ink); border-color: rgba(56, 189, 248, .5); box-shadow: 0 0 0 3px rgba(56, 189, 248, .10); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -8px rgba(99, 102, 241, .7); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 8px 26px -8px rgba(99, 102, 241, .9); }
.btn.ok { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: .8rem; border-radius: 8px; }
.btn.xs { height: 26px; width: 26px; padding: 0; border-radius: 7px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
form.inline { display: inline; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 11px; width: 100%; transition: border-color .15s, box-shadow .15s; min-height: 38px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, .18); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d889d' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
textarea { min-height: 88px; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: var(--a2); padding: 0; }
input[type=file] { padding: 6px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: .8rem; color: var(--ink); background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 10px; margin-right: 10px; cursor: pointer; }
label { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 18px; }
.filters > div { flex: 1 1 140px; }
.filters .btn { flex: 0 0 auto; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.checks label { display: inline-flex; gap: 7px; align-items: center; color: var(--ink-2); font: 500 .85rem var(--font); letter-spacing: 0; text-transform: none; margin: 0;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px 5px 9px; background: var(--surface-2); cursor: pointer; transition: all .15s; }
.checks label:hover { border-color: var(--line-2); color: var(--ink); }
.checks label:has(input:checked) { border-color: rgba(56, 189, 248, .5); background: var(--info-bg); color: var(--ink); }
.switch-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------- chips y estados */
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font: 600 .7rem var(--mono); letter-spacing: .02em; margin: 0 4px 4px 0; white-space: nowrap; }
.chip.today { background: linear-gradient(135deg, rgba(34, 211, 238, .95), rgba(99, 102, 241, .95)); color: #fff; border-color: transparent; box-shadow: 0 0 16px -2px rgba(34, 211, 238, .6); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.info { background: var(--info-bg); color: var(--accent); border-color: transparent; }
.chip.glass { background: rgba(6, 8, 13, .55); color: #e7ecf6; border-color: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.score { display: inline-flex; align-items: center; gap: 6px; font: 600 .72rem var(--mono); }
.score .bar { width: 38px; height: 5px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.score .bar i { display: block; height: 100%; border-radius: 99px; }
.score.hi .bar i { background: var(--ok); } .score.hi { color: var(--ok); }
.score.mid .bar i { background: var(--warn); } .score.mid { color: var(--warn); }
.score.lo .bar i { background: var(--bad); } .score.lo { color: var(--bad); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); margin-right: 6px; flex: none; }
.status-dot.off { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

/* colores por estado del embudo */
.st-nuevo { --st: #22d3ee; } .st-por_contactar { --st: #38bdf8; } .st-contactado { --st: #818cf8; } .st-visita { --st: #a78bfa; }
.st-estudio { --st: #fbbf24; } .st-negociacion { --st: #fb923c; } .st-captado { --st: #34d399; } .st-descartado { --st: #64748b; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font: 600 .72rem var(--mono); color: var(--st); background: color-mix(in srgb, var(--st) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--st) 30%, transparent); border-radius: 999px; padding: 2px 9px; }
.stage-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--st); box-shadow: 0 0 8px var(--st); }

/* ---------------------------------------------------- tarjetas de anuncio */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, .35); box-shadow: var(--glow); }
.card.is-today { border-color: rgba(34, 211, 238, .45); }
.card .ph { aspect-ratio: 16 / 10; background: var(--bg-2) center / cover no-repeat; position: relative; display: block; }
.card .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 8, 13, .35) 0%, transparent 35%, transparent 55%, rgba(6, 8, 13, .88) 100%); }
.card .ph.noimg { background-image: radial-gradient(circle at 50% 40%, rgba(99, 102, 241, .22), transparent 60%); display: grid; place-items: center; color: var(--muted); }
.card .badges { position: absolute; left: 10px; top: 10px; right: 10px; z-index: 1; display: flex; flex-wrap: wrap; }
.card .ph-price { position: absolute; left: 14px; bottom: 10px; z-index: 1; color: #fff; }
.card .ph-price b { font: 650 1.35rem var(--mono); letter-spacing: -.04em; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.card .ph-score { position: absolute; right: 12px; bottom: 14px; z-index: 1; background: rgba(6, 8, 13, .6); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 3px 9px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card .ph-price small { color: rgba(255, 255, 255, .72); font-family: var(--mono); margin-left: 6px; font-size: .75rem; }
.card .body { padding: 13px 15px 15px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.specs { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 .8rem var(--mono); color: var(--ink-2); }
.specs span { display: inline-flex; gap: 5px; align-items: center; }
.specs span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--a1); opacity: .7; }
.loc { color: var(--ink); font-weight: 520; display: flex; gap: 6px; align-items: flex-start; }
.loc .ico { color: var(--muted); margin-top: 2px; }
.meta { font: .72rem var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.price { font: 650 1.2rem var(--mono); letter-spacing: -.03em; }

/* ---------------------------------------------------- tablas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th, table.t td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font: 500 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
table.t tbody tr { transition: background .15s; }
table.t tbody tr:hover { background: var(--surface-2); }

/* ---------------------------------------------------- kanban */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; scroll-snap-type: x proximity; }
.col { flex: 0 0 290px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 220px;
  scroll-snap-align: start; position: relative; overflow: hidden; }
.col::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--st); box-shadow: 0 0 14px var(--st); }
.col h3 { margin: 4px 4px 12px; display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 650; }
.col h3 .count { margin-left: auto; font: 600 .72rem var(--mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 1px 7px; }
.col .drop { min-height: 140px; display: flex; flex-direction: column; gap: 9px; }
.col.over { border-color: var(--st); box-shadow: 0 0 0 1px var(--st), 0 0 30px -8px var(--st); }
.lead { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: grab; font-size: .86rem; transition: border-color .15s, transform .15s; position: relative; }
.lead:hover { border-color: var(--line-2); }
.lead.dragging { opacity: .45; transform: rotate(1.5deg); }
.lead .p { font: 650 1rem var(--mono); letter-spacing: -.03em; color: var(--ink); }
.lead .row { gap: 6px; }
.lead .lead-meta { color: var(--muted); font-size: .8rem; }
.prio { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.prio-alta { background: var(--bad); box-shadow: 0 0 8px var(--bad); } .prio-media { background: var(--warn); } .prio-baja { background: var(--muted); }
.stage-select { width: 100%; height: 30px; min-height: 0; padding: 0 28px 0 9px; font-size: .78rem; margin-top: 8px; background-position: right 9px center; }

/* ---------------------------------------------------- timeline, galería, varios */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 1px solid var(--line-2); padding: 0 0 16px 18px; position: relative; margin-left: 5px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 10px var(--a1); }
.timeline li.k-sistema::before, .timeline li.k-cambio_estado::before { background: var(--muted); box-shadow: none; }
.timeline .when { font: .7rem var(--mono); color: var(--muted); }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.gallery img { height: 240px; border-radius: 10px; scroll-snap-align: start; border: 1px solid var(--line); }
.flash { display: flex; gap: 10px; align-items: center; background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  padding: 11px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.err { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: .9rem; margin: 0; }
.kv dt { font: 500 .68rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.kv dd { margin: 0; }
.desc { white-space: pre-wrap; font-size: .9rem; color: var(--ink-2); }
.pager { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
.list-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.due { font: .72rem var(--mono); color: var(--muted); white-space: nowrap; }
.due.late { color: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
details summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
ol.steps li { counter-increment: s; position: relative; padding: 0 0 12px 36px; color: var(--ink-2); }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font: 600 .75rem var(--mono); color: var(--a1); background: var(--info-bg); border: 1px solid rgba(56, 189, 248, .3); }

/* funnel + gráficos */
.funnel-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 12px; padding: 6px 0; color: inherit; }
.funnel-row:hover { color: inherit; }
.funnel-row .track { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.funnel-row .track i { display: block; height: 100%; border-radius: 99px; background: var(--st); box-shadow: 0 0 12px var(--st); min-width: 2px; }
.funnel-row b { font: 600 .85rem var(--mono); text-align: right; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 38px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--a1), var(--a2)); opacity: .85; min-height: 3px; box-shadow: 0 0 18px -4px rgba(34, 211, 238, .6); }
.bars .b.today i { opacity: 1; background: var(--grad); }
.bars .b span { font: .66rem var(--mono); color: var(--muted); }
.bars .b em { font: 600 .72rem var(--mono); font-style: normal; color: var(--ink-2); }
.src-row { display: grid; grid-template-columns: 110px 1fr 38px; gap: 10px; align-items: center; padding: 5px 0; font-size: .85rem; }
.src-row .track { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.src-row .track i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.src-row b { font: 600 .8rem var(--mono); text-align: right; }
.run { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .84rem; }
.run:last-child { border-bottom: 0; }
.run .mono { color: var(--muted); font-size: .72rem; }

/* ---------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { justify-content: center; padding-bottom: 26px; }
.login-card .brand-mark { width: 44px; height: 44px; }
.login-card .brand-name { font-size: 1.5rem; }

/* ---------------------------------------------------- móvil */
.bottom-nav { display: none; }
@media (max-width: 1100px) { .g-7-5 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .header { padding: 10px 14px; }
  .header .live .txt { display: none; }
  .header > .spacer { display: none; }
  .cmd { max-width: none; }
  .main { padding: 4px 14px 100px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 112px 1fr; }
  .kpi .n { font-size: 1.9rem; }
  .bottom-nav { display: flex; position: fixed; bottom: 10px; left: 10px; right: 10px; z-index: 30; border-radius: 18px; padding: 4px;
    background: color-mix(in srgb, var(--surface-solid) 82%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, .6); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; font: 500 .64rem var(--mono); letter-spacing: .04em; color: var(--muted); border-radius: 14px; }
  .bottom-nav a.on { color: var(--ink); background: linear-gradient(180deg, rgba(56, 189, 248, .16), rgba(99, 102, 241, .08)); }
  .bottom-nav a.on .ico { color: var(--a1); }
  .hide-m { display: none !important; }
  .funnel-row { grid-template-columns: 110px 1fr 32px; }
  .page-head { margin-bottom: 14px; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .cards { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: inline; }
