/* Ficha maestra del director — prototipo de prueba. Registrado por: Arqui — 20nov2026 */
:root {
  --bg: #f1ebe0;
  --bg-tint: #e8e0d2;
  --paper: #fffcf7;
  --ink: #1c1814;
  --ink-soft: #5a5349;
  --muted: #8a8276;
  --line: #ddd3c4;
  --line-strong: #cbbfaa;
  --fundetec: #184e40;
  --fundetec-mid: #2a7a64;
  --fundetec-soft: #e6f1ed;
  --ies: #1c3554;
  --ies-mid: #3a5d86;
  --ies-soft: #e7eef6;
  --gold: #7a5c1e;
  --gold-soft: #f4ead0;
  --warn: #7a3328;
  --warn-soft: #f6e6e2;
  --banner-bg: #3a2a12;
  --banner-fg: #f8e7b8;
  --shadow: 0 10px 30px rgba(28, 24, 20, 0.07);
  --radius: 18px;
  --font: "Figtree", "Segoe UI", sans-serif;
  --serif: "Fraunces", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #f7f0df 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e7efe9 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.45;
}

.banner-prueba {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--banner-bg);
  color: var(--banner-fg);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
}

.wrap {
  width: min(1120px, calc(100% - 1.6rem));
  margin: 0 auto;
  padding-bottom: 3rem;
}

header.top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1.6rem 0 1.1rem;
  border-bottom: 1px solid var(--line);
}

.brand .kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.brand h1 {
  font-family: var(--serif);
  font-weight: 520;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.15;
}
.brand .sub {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-end;
}
.hint-demo {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 16rem;
  text-align: right;
}

.seg {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #f8f3ea;
}
.seg.inst button[data-inst="fundetec"][aria-pressed="true"] { background: var(--fundetec); }
.seg.inst button[data-inst="ies"][aria-pressed="true"] { background: var(--ies); }

.panel { margin-top: 1.4rem; }

.kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 800px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem 1.05rem;
}
.kpi {
  min-height: 7.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpi .label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.kpi .value {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 0.55rem;
  font-variant-numeric: tabular-nums;
}
.kpi.money .value { font-size: clamp(1.25rem, 2.8vw, 1.7rem); }
.kpi .foot { margin-top: 0.45rem; font-size: 0.72rem; color: var(--muted); }
.kpi.neto .value { color: var(--fundetec); }
.kpi.gasto .value { color: var(--warn); }
.kpi.ingreso .value { color: var(--gold); }

.grid-2 {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1.15fr 0.85fr; }
}

h2.sec {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 520;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
}
.card h2.sec { margin-bottom: 0.7rem; }

.funnel { display: flex; flex-direction: column; gap: 0.42rem; }
.funnel-row {
  display: grid;
  grid-template-columns: 10.2rem 1fr 2.2rem;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.8rem;
}
.funnel-row .ename { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track {
  height: 10px;
  background: var(--bg-tint);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent, var(--fundetec-mid));
  width: 0;
  transition: width 0.45s ease;
}
.funnel-row.perdido .bar-fill { background: #b46a5c; }
.funnel-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.money-bars { margin-top: 0.4rem; }
.money-line { margin: 0.55rem 0 0.9rem; }
.money-line .caps {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.money-line .bar-track { height: 14px; }
.money-line.ing .bar-fill { background: var(--gold); }
.money-line.gas .bar-fill { background: #b46a5c; }
.neto-box {
  margin-top: 0.6rem;
  background: var(--fundetec-soft);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}
.neto-box .lbl { font-size: 0.75rem; color: var(--fundetec); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.neto-box .val { font-family: var(--serif); font-size: 1.7rem; font-weight: 560; color: var(--fundetec); letter-spacing: -0.03em; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: grid;
  gap: 0.15rem 0.7rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.list li:first-child { border-top: 0; padding-top: 0.15rem; }
.list .who { font-weight: 700; }
.list .meta { font-size: 0.8rem; color: var(--ink-soft); }
.pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--ink-soft);
  margin-right: 0.3rem;
}
.pill.e4, .pill.e5, .pill.e6 { background: var(--gold-soft); color: var(--gold); }
.pill.venc { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--muted); font-size: 0.9rem; padding: 0.3rem 0; }

.comision {
  margin-top: 0.85rem;
  background: linear-gradient(180deg, #fffdf8 0%, #f7efd8 100%);
  border-color: #e4d4a4;
}
.aviso-valor {
  display: inline-block;
  background: #3a2a12;
  color: #f8e7b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
.comision .nota { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 0.8rem; }
.oculto { display: none !important; }

footer.pie {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.inst-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.15rem 0 0.7rem;
}
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink); }
.dot.fundetec { background: var(--fundetec-mid); }
.dot.ies { background: var(--ies-mid); }
.dot.total { background: var(--gold); }

.error {
  margin: 2rem 0;
  padding: 1rem;
  background: var(--warn-soft);
  border-radius: 12px;
  color: var(--warn);
}
