/* bizm-pricing demo viz — minimal editorial */

:root {
    --bg: #fafbfc;
    --white: #ffffff;
    --border: #e4e9f0;
    --accent: #09b899;
    --accent-faint: rgba(9, 184, 153, 0.08);
    --accent2: #0f52d4;
    --text: #111827;
    --muted: #6b7280;
    --soft: #9ca3af;
    --navy: #0a1628;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 6px;
    --radius-md: 8px;
    --font-base: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-base);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: grid;
    grid-template-rows: 48px 1fr auto;
    grid-template-columns: 210px 1fr;
    font-size: 0.875rem;
    line-height: 1.55;
}

/* header */
header {
    grid-column: 1 / -1;
    background: var(--navy);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 14px;
}
.h-logo { display: flex; align-items: center; }
.h-logo img { height: 22px; width: auto; display: block; }
.h-title { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.h-sub { font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, 0.45); }
.h-right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.h-pill {
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(9, 184, 153, 0.15);
    color: var(--accent);
    border: 1px solid rgba(9, 184, 153, 0.3);
    font-weight: 600;
}

/* sidebar */
aside {
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--soft);
    padding: 0 8px 4px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
}
.nav-link:hover { background: var(--accent-faint); color: var(--text); }
.nav-link.active { background: var(--accent-faint); color: var(--accent); font-weight: 600; }
.nav-ico { width: 18px; text-align: center; }
.nav-foot {
    margin-top: auto;
    font-size: 11px;
    color: var(--soft);
    padding: 10px 8px 0;
    border-top: 1px solid var(--border);
}

/* main */
main { padding: 26px 30px 40px; overflow-x: hidden; min-width: 0; }
h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
h2 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 22px 0 8px; }
.lead { color: var(--muted); max-width: 62ch; margin-bottom: 18px; }
code { font-family: var(--mono); font-size: 0.8em; background: var(--accent-faint); padding: 1px 5px; border-radius: 4px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.card .k { font-size: 11px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.card .k .tag { font-family: var(--mono); font-size: 10px; color: var(--soft); font-weight: 400; }
.card .v { font-family: var(--mono); font-size: 1.35rem; font-weight: 500; margin: 4px 0 2px; }
.card .s { font-size: 11px; color: var(--soft); }

/* search bar */
.searchbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.searchbar input[type="search"] {
    flex: 1 1 260px;
    max-width: 420px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--white);
}
.searchbar input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.searchbar input[type="number"] { width: 58px; padding: 7px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; }
.searchbar select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--white); }
.searchbar label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.searchbar button {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.searchbar button:hover { filter: brightness(0.95); }

/* results */
.results { display: flex; flex-direction: column; gap: 6px; }
.note { font-size: 12px; color: var(--muted); background: var(--white); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.note.warn { color: var(--warning); border-color: var(--warning); }
.note.err { color: var(--danger); border-color: var(--danger); }

.tablewrap {
    overflow: auto;
    max-height: 72vh; /* el scroll vertical vive en el contenedor: así el thead sticky funciona */
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
th {
    text-align: left;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--bg);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
th.sortable[data-dir="asc"]::after { content: " ▲"; color: var(--accent); }
th.sortable[data-dir="desc"]::after { content: " ▼"; color: var(--accent); }
td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--accent-faint); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td .pos { color: var(--danger); }
td .neg { color: var(--accent); }

/* índice drill-down */
.crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 12.5px; flex-wrap: wrap; }
.crumbs a { color: var(--accent2); cursor: pointer; text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--muted); font-weight: 600; }
.crumbs .sep { color: var(--soft); font-weight: 400; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--accent-faint); }
.spark { display: block; }
.range { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.spark-empty { font-family: var(--mono); font-size: 10px; color: var(--soft); }

footer {
    grid-column: 1 / -1;
    padding: 9px 24px;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--soft);
    border-top: 1px solid var(--border);
    background: var(--white);
}

@media (max-width: 760px) {
    body { grid-template-columns: 1fr; }
    aside { display: none; }
}

/* econo additions */
.cardlink { cursor: pointer; }
.cardlink:hover { border-color: var(--accent); }
.card .spark { margin-top: 8px; }
.series-out { margin: 10px 0 6px; }
