/* =========================================================================
   Parachilna - Portal de consulta Business Central
   Estetica: minimalista clara. Blancos calidos, lineas de un pixel, mucho
   aire y un unico acento en laton (la luz de una lampara sobre papel).
   Autor: Claude Code - 30-07-2026
   ========================================================================= */

:root {
    --bg:            #F7F6F3;
    --surface:       #FFFFFF;
    --surface-2:     #FBFAF7;
    --ink:           #1A1A18;
    --ink-2:         #56534C;
    --muted:         #8C8880;
    --line:          #E7E4DC;
    --line-soft:     #F0EDE6;
    --accent:        #B08D57;
    --accent-dark:   #8F6F3E;
    --accent-soft:   #F4EDE1;
    --pos:           #1F7A44;
    --neg:           #B4462F;
    --radius:        3px;
    --shadow:        0 1px 2px rgba(26, 26, 24, .04), 0 8px 24px rgba(26, 26, 24, .04);
    --sans:          system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -.01em; }

/* ------------------------------------------------------------- landing --- */

.landing {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    background: var(--surface);
}

.landing-art {
    position: relative;
    background: #14130F;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 64px;
    color: #fff;
}

/* Halo de luz: la unica licencia decorativa de toda la interfaz. */
.landing-art::before {
    content: "";
    position: absolute;
    width: 900px; height: 900px;
    top: -320px; right: -300px;
    background: radial-gradient(circle at center,
                rgba(224, 194, 140, .30) 0%,
                rgba(176, 141, 87, .14) 34%,
                rgba(20, 19, 15, 0) 68%);
    pointer-events: none;
}

.landing-art .lamp {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 1px;
    height: 190px;
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(224,194,140,.55));
}

.landing-art .bulb {
    position: absolute;
    left: 50%;
    top: 186px;
    transform: translateX(-50%);
    width: 118px; height: 118px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 42%,
                #FDF3DF 0%, #EBCF9B 38%, rgba(176,141,87,.22) 62%, rgba(20,19,15,0) 74%);
    filter: blur(.3px);
}

.landing-logo { position: relative; z-index: 2; color: #F6F2EA; }
.landing-logo svg { width: 260px; height: auto; display: block; }

.landing-claim {
    position: relative;
    z-index: 2;
    max-width: 460px;
}

.landing-claim h2 {
    font-size: 30px;
    font-weight: 400;
    line-height: 1.28;
    letter-spacing: -.015em;
    color: #F6F2EA;
    margin-bottom: 18px;
}

.landing-claim p {
    color: rgba(246, 242, 234, .62);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

.landing-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
}

.login-card { width: 100%; max-width: 340px; }

.login-card .eyebrow {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 6px;
}

.login-card .sub {
    color: var(--ink-2);
    margin: 0 0 32px;
    font-size: 13px;
}

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}

.field input {
    width: 100%;
    padding: 11px 2px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-size: 15px;
    font-family: var(--sans);
    color: var(--ink);
    transition: border-color .18s;
}

.field input:focus {
    outline: 0;
    border-bottom-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    margin-top: 14px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
}

.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
    width: auto;
    padding: 9px 16px;
    margin: 0;
}

.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

.alert {
    padding: 10px 12px;
    border-left: 2px solid var(--neg);
    background: #FCF3F0;
    color: var(--neg);
    font-size: 13px;
    margin-bottom: 20px;
}

.alert.info { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

/* ---------------------------------------------------------------- shell --- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 26px 0 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar .brand { padding: 0 24px 26px; }
.sidebar .brand a { display: block; color: var(--ink); }
.sidebar .brand svg { width: 160px; height: auto; display: block; }

.sidebar nav { flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 24px;
    color: var(--ink-2);
    font-size: 13.5px;
    border-left: 2px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.nav-item:hover { background: var(--surface-2); color: var(--ink); }

.nav-item.active {
    border-left-color: var(--accent);
    background: var(--accent-soft);
    color: var(--ink);
    font-weight: 500;
}

.nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.4; opacity: .8; }

.sidebar-foot {
    padding: 18px 24px 0;
    border-top: 1px solid var(--line-soft);
    font-size: 11px;
    color: var(--muted);
    line-height: 1.7;
}

.sidebar-foot b { color: var(--ink-2); font-weight: 500; }

.main { flex: 1; min-width: 0; }

.topbar {
    height: 62px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar .crumb {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.topbar .right { display: flex; align-items: center; gap: 18px; }

.chip-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-2);
    border: 1px solid var(--line);
    padding: 5px 11px;
    border-radius: 999px;
}

.chip-live i {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--pos);
    display: inline-block;
}

.user { font-size: 12.5px; color: var(--ink-2); }
.user a { color: var(--muted); margin-left: 12px; font-size: 12px; }
.user a:hover { color: var(--neg); }

.content { padding: 30px 32px 56px; max-width: 1420px; }

.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 25px; font-weight: 500; letter-spacing: -.02em; }
.page-head p { color: var(--ink-2); margin: 7px 0 0; font-size: 13.5px; max-width: 760px; }

.source-note {
    display: inline-block;
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--muted);
    border-left: 2px solid var(--accent);
    padding: 2px 0 2px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ----------------------------------------------------------------- kpis --- */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-bottom: 28px;
}

.kpi {
    background: var(--surface);
    padding: 20px 22px;
}

.kpi .label {
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.kpi .value {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.kpi .value small { font-size: 15px; color: var(--ink-2); font-weight: 400; }

.kpi .foot { margin-top: 9px; font-size: 12px; color: var(--muted); }
.kpi .foot .up { color: var(--pos); }
.kpi .foot .down { color: var(--neg); }

/* ----------------------------------------------------------------- card --- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    margin-bottom: 24px;
}

.card-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.card-head h2 { font-size: 14px; font-weight: 600; letter-spacing: .01em; }
.card-head .meta { font-size: 11.5px; color: var(--muted); }
.card-head .meta a { color: var(--accent-dark); }

.card-body { padding: 20px 22px; }
.card-body.tight { padding: 0; }

/* align-items:start keeps every card the height of its own content instead of
   stretching the shorter one to match its neighbour. */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

@media (max-width: 1180px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- table --- */

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.data th {
    text-align: left;
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--surface-2);
}

table.data td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border: 1px solid var(--line);
    font-size: 11px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.rank.top { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border: 1px solid var(--line);
    color: var(--ink-2);
    background: var(--surface-2);
    white-space: nowrap;
}

.chip.in  { border-color: #CBE3D4; background: #F2F8F4; color: var(--pos); }
.chip.out { border-color: #EFD5CD; background: #FCF4F1; color: var(--neg); }
.chip.accent { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-track { flex: 1; height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar-fill  { height: 6px; background: var(--accent); border-radius: 4px; }

.empty { color: var(--muted); font-size: 13px; padding: 26px 0; text-align: center; }

/* --------------------------------------------------------------- filtros --- */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 16px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    margin-bottom: 22px;
}

.filters .f { display: flex; flex-direction: column; gap: 6px; }

.filters label {
    font-size: 10.5px;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--muted);
}

.filters input[type=text],
.filters input[type=date],
.filters select {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 8px 10px;
    font-size: 13px;
    font-family: var(--sans);
    color: var(--ink);
    min-width: 150px;
    border-radius: var(--radius);
}

.filters input:focus, .filters select:focus { outline: 0; border-color: var(--accent); }
.filters .grow input { min-width: 260px; }
.filters .spacer { flex: 1; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-top: 1px solid var(--line-soft);
    font-size: 12.5px;
    color: var(--muted);
}

.pagination .pages { display: flex; gap: 8px; }

.pagination a, .pagination span.cur {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    padding: 5px 8px;
    border: 1px solid var(--line);
    color: var(--ink-2);
}

.pagination a:hover { border-color: var(--accent); background: var(--accent-soft); }
.pagination span.cur { border-color: var(--ink); background: var(--ink); color: #fff; }

/* --------------------------------------------------------------- charts --- */

.chart { width: 100%; height: auto; display: block; overflow: visible; }

.chart .c-label { font-size: 12px; fill: var(--ink-2); font-family: var(--sans); }
.chart .c-value { font-size: 12px; fill: var(--ink); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .c-track { fill: var(--line-soft); }
.chart .c-bar   { fill: var(--accent); transition: fill .15s; }
.chart .c-bar:hover { fill: var(--accent-dark); }
.chart .c-grid  { stroke: var(--line-soft); stroke-width: 1; }
.chart .c-axis  { font-size: 10.5px; fill: var(--muted); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .c-area  { fill: rgba(176, 141, 87, .11); }
.chart .c-line  { fill: none; stroke: var(--accent-dark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .c-dot   { fill: var(--surface); stroke: var(--accent-dark); stroke-width: 2; }
.chart .c-hit   { fill: transparent; cursor: crosshair; }
.chart .c-hit:hover + .c-dot { r: 6; }
.chart .c-last  { font-size: 12px; fill: var(--ink); font-weight: 600; font-family: var(--sans); }

.spark { width: 120px; height: 28px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }

.legend-note {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}

/* -------------------------------------------------------------- product --- */

.product-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.product-title h1 { font-size: 23px; font-weight: 500; }
.product-title .ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
    letter-spacing: .04em;
}

.stat-row { display: flex; gap: 34px; flex-wrap: wrap; }
.stat-row .s .l { font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.stat-row .s .v { font-size: 21px; font-weight: 500; margin-top: 5px; letter-spacing: -.01em; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 22px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
    letter-spacing: .04em;
}

.back-link:hover { color: var(--accent-dark); }

/* ----------------------------------------------------------------- misc --- */

.footer-note {
    padding: 22px 32px 40px;
    font-size: 11.5px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: var(--surface);
    line-height: 1.8;
}

.footer-note b { color: var(--ink-2); font-weight: 500; }

.api-trace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    padding: 9px 12px;
    margin-top: 14px;
    word-break: break-all;
    line-height: 1.7;
}

.api-trace b { color: var(--accent-dark); font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }

.tabs a {
    padding: 9px 16px;
    font-size: 13px;
    color: var(--ink-2);
    border: 1px solid transparent;
    border-bottom: 0;
    margin-bottom: -1px;
}

.tabs a.active {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
    font-weight: 500;
}

@media (max-width: 900px) {
    .landing { grid-template-columns: 1fr; }
    .landing-art { display: none; }
    .shell { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: column; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .content { padding: 20px; }
}
