/* FinanPlantillas · visor de plantillas (preview.html) */
:root {
  --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --green: #0e9f6e; --green-l: #ecfdf5;
  --blue: #1d4ed8; --blue-2: #2563eb; --blue-l: #eff6ff; --red: #dc2626; --red-l: #fee2e2; --amber: #b45309; --amber-l: #fef3c7;
  --xl: #107c41;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: #fff; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.pv { display: flex; flex-direction: column; height: 100%; min-height: 420px; }
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .8rem; background: var(--xl); color: #fff; font-size: .8rem; flex-wrap: wrap; }
.pv-file { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.pv-xl { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: #fff; color: var(--xl); font-style: normal; font-weight: 800; font-size: .72rem; }
.pv-hint { opacity: .85; }
.pv-body { flex: 1; overflow: auto; padding: 14px; background: #f8fafc; }
.pv-tabs { display: flex; gap: 2px; padding: 0 8px; background: #e9eef4; border-top: 1px solid var(--line); overflow-x: auto; }
.pv-tab { border: 0; background: transparent; padding: .55rem .9rem; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; border-bottom: 3px solid transparent; }
.pv-tab.is-on { background: #fff; color: var(--xl); border-bottom-color: var(--xl); }
.pv-tab b { font-size: .62rem; background: var(--blue-l); color: var(--blue); padding: .05rem .35rem; border-radius: 99px; }
.pv-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.pv-kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; border-left: 4px solid #cbd5e1; min-width: 0; }
.pv-kpi span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pv-kpi strong { display: block; font-size: 1.15rem; font-weight: 700; margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-kpi small { display: block; font-size: .72rem; color: var(--muted); }
.pv-kpi.is-good { border-left-color: var(--green); }
.pv-kpi.is-good strong { color: #047857; }
.pv-kpi.is-bad { border-left-color: var(--red); }
.pv-kpi.is-bad strong { color: var(--red); }
.pv-kpi.is-warn { border-left-color: #f59e0b; }
.pv-chart { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; margin-bottom: 12px; }
.pv-chart-h { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .85rem; margin-bottom: .3rem; }
.pv-legend { display: flex; gap: .8rem; font-size: .72rem; color: var(--muted); }
.pv-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.pv-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pv-chart svg { width: 100%; height: auto; }
.pv-chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.pv-grid line { stroke: #eef2f7; }
.pv-s0, i.pv-s0 { fill: #c7d2fe; background: #c7d2fe; }
.pv-s1, i.pv-s1 { fill: var(--green); background: var(--green); }
.pv-s2 { fill: var(--red); }
.pv-scroll { overflow-x: auto; border-radius: 8px; }
.pv-sheet { border-collapse: collapse; background: #fff; width: 100%; font-size: .82rem; margin-bottom: 12px; }
.pv-sheet th, .pv-sheet td { border: 1px solid #dfe5ec; padding: 0; height: 30px; white-space: nowrap; }
.pv-sheet thead th { background: #f1f5f9; color: var(--muted); font-weight: 600; font-size: .72rem; text-align: center; padding: 0 .4rem; }
.pv-sheet .pv-head th { background: #0f2a4a; color: #fff; font-size: .76rem; padding: .3rem .5rem; }
.pv-rn { background: #f1f5f9 !important; color: var(--muted) !important; width: 30px; font-size: .7rem !important; font-weight: 600; text-align: center; }
.pv-sheet td { padding: 0 .5rem; }
.pv-sheet td.pv-in { padding: 0; background: var(--blue-l); }
.pv-sheet td.pv-calc { color: #334155; background: #fff; text-align: right; font-variant-numeric: tabular-nums; }
.pv-sheet input, .pv-sheet select { width: 100%; min-width: 80px; height: 29px; border: 0; background: transparent; padding: 0 .5rem; font-size: .82rem; }
.pv-sheet input[type=number] { text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.pv-sheet input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pv-sheet input:focus, .pv-sheet select:focus { outline: 2px solid var(--xl); outline-offset: -2px; background: #fff; }
.pv-params td:nth-child(2) { color: #334155; min-width: 180px; }
.pv-params td.pv-in { width: 40%; }
.pv-ck { width: 30px; }
.pv-check { width: 100%; height: 29px; border: 0; background: transparent; cursor: pointer; font-weight: 700; color: #065f46; min-width: 26px; }
.pv-check.is-on { background: #a7f3d0; }
.pv-barcell { display: inline-block; vertical-align: middle; width: 70px; height: 8px; background: #e2e8f0; border-radius: 9px; overflow: hidden; margin-right: .4rem; }
.pv-barcell i { display: block; height: 100%; background: var(--green); }
.pv-locked { position: relative; min-height: 320px; }
.pv-blur { filter: blur(4px); opacity: .6; pointer-events: none; user-select: none; }
.pv-lock-card { position: absolute; inset: 0; margin: auto; width: min(92%, 340px); height: fit-content; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 50px -20px rgba(15, 42, 74, .45); padding: 1.2rem; text-align: center; display: grid; gap: .5rem; justify-items: center; }
.pv-lock-card strong { font-size: 1.05rem; }
.pv-lock-card p { color: var(--muted); font-size: .85rem; }
.pv-pro-badge { font-size: .7rem; font-weight: 800; color: var(--blue); background: var(--blue-l); padding: .2rem .6rem; border-radius: 99px; }
.pv-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .5rem 1rem; border-radius: 10px; background: linear-gradient(135deg, #1d4ed8, #3b5bdb); color: #fff; text-decoration: none; font-weight: 600; font-size: .88rem; }
.pv-empty { padding: 1.5rem; color: var(--muted); text-align: center; }
@media (min-width: 560px) {
  .pv-kpis { grid-template-columns: repeat(4, 1fr); }
  .pv-body { padding: 18px; }
}
