/* ============================================================================
   Accounting Control Tower — sistema visual
   ----------------------------------------------------------------------------
   CLARO, NO OSCURO, y es una decisión, no un gusto. El otro tablero del
   portafolio (el centro de operación de telecom) es oscuro porque un NOC se
   mira en una pared a media luz. Este lo abre un controller junto a un estado
   financiero, y lo imprime. El azul es el mismo #1F4E79 del CV: el anexo y el
   documento tienen que leerse como una sola mano.

   Sin dependencias, sin build. Las gráficas son SVG dibujado a mano — una
   librería de charts para seis visualizaciones es peso muerto, y el objetivo
   del proyecto es demostrar control sobre el dato, no sobre npm.
   ========================================================================== */

:root {
	--paper:  #F7F8FA;
	--card:   #FFFFFF;
	--brand:  #1F4E79;
	--brand-2:#2E6DA4;
	--ink:    #10151C;
	--muted:  #5B6572;
	--line:   #E4E7EC;
	--soft:   #EEF3F8;

	--ok:   #0F766E;
	--warn: #B45309;
	--bad:  #B42318;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
	font-size: 14px; line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; }
.num  { font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }

/* ------------------------------------------------------------------ top -- */

.top {
	background: var(--brand); color: #fff;
	padding: 1.15rem 1.6rem 0;
}

.top__row {
	display: flex; align-items: flex-start; justify-content: space-between;
	gap: 1.5rem; flex-wrap: wrap; margin-bottom: .95rem;
}

.top h1 { font-size: 1.14rem; font-weight: 700; letter-spacing: -.015em; margin: 0 0 .18rem; }
.top__sub { font-size: .74rem; opacity: .82; margin: 0; }
.top__meta { font-size: .68rem; opacity: .82; text-align: right; line-height: 1.7; }

/* pestañas */
.tabs { display: flex; gap: .1rem; flex-wrap: wrap; }

.tab {
	appearance: none; border: 0; cursor: pointer;
	background: transparent; color: rgba(255,255,255,.72);
	font: inherit; font-size: .78rem; font-weight: 500;
	padding: .5rem .85rem; border-radius: 6px 6px 0 0;
	border-bottom: 2.5px solid transparent;
	white-space: nowrap;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab[aria-selected="true"] {
	color: #fff; background: var(--paper); color: var(--brand);
	font-weight: 700; border-bottom-color: var(--paper);
}

/* ----------------------------------------------------------------- layout -- */

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.6rem 3.5rem; }
.view[hidden] { display: none; }

.lede { font-size: .92rem; color: var(--muted); max-width: 78ch; margin: 0 0 1.3rem; }
.lede strong { color: var(--ink); font-weight: 600; }

h2.sec {
	font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
	color: var(--brand); margin: 2rem 0 .7rem;
	padding-bottom: .35rem; border-bottom: 1px solid var(--line);
}
h2.sec:first-child { margin-top: 0; }

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

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: .75rem; }

.kpi {
	background: var(--card); border: 1px solid var(--line); border-radius: 9px;
	padding: .8rem .9rem;
}
.kpi__k { font-size: .64rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.kpi__v { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi__d { font-size: .68rem; color: var(--muted); margin-top: .22rem; }
.kpi--ok   .kpi__v { color: var(--ok); }
.kpi--bad  .kpi__v { color: var(--bad); }
.kpi--warn .kpi__v { color: var(--warn); }

/* -------------------------------------------------------------- hallazgos -- */

.find {
	background: var(--card); border: 1px solid var(--line);
	border-left: 3px solid var(--warn); border-radius: 9px;
	padding: 1rem 1.15rem; margin-bottom: .8rem;
}
.find--high { border-left-color: var(--bad); }

.find__top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .45rem; }
.find__t { font-size: .97rem; font-weight: 700; letter-spacing: -.01em; }
.find__amt { font-size: .84rem; font-weight: 700; color: var(--bad); white-space: nowrap; }
.find--medium .find__amt { color: var(--warn); }
.find__pct { font-size: .66rem; color: var(--muted); display: block; text-align: right; font-weight: 400; }
.find p { margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); }
.find__act { font-size: .8rem; background: var(--soft); border-radius: 6px; padding: .55rem .7rem; color: var(--ink); }
.find__act b { color: var(--brand); font-weight: 700; }

/* ----------------------------------------------------------------- tablas -- */

.tw { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 9px; }

table { border-collapse: collapse; width: 100%; font-size: .81rem; }
th, td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th {
	font-size: .63rem; letter-spacing: .07em; text-transform: uppercase;
	color: var(--muted); font-weight: 700; background: var(--soft);
	position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FBFCFD; }
td.r, th.r { text-align: right; }
tr.tot td { font-weight: 700; background: var(--soft); border-top: 1.5px solid var(--brand); }

.pill {
	display: inline-block; font-size: .6rem; font-weight: 700;
	letter-spacing: .05em; text-transform: uppercase;
	padding: .12rem .45rem; border-radius: 99px;
}
.pill--ok   { background: #E3F2F0; color: var(--ok); }
.pill--bad  { background: #FDECEA; color: var(--bad); }
.pill--warn { background: #FDF3E7; color: var(--warn); }

.neg { color: var(--bad); }
.pos { color: var(--ok); }

/* --------------------------------------------------------------- gráficas -- */

.chart { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 1rem; }
.chart svg { display: block; width: 100%; height: auto; }
.chart__cap { font-size: .7rem; color: var(--muted); margin-top: .6rem; }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .7rem; color: var(--muted); margin-bottom: .7rem; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .3rem; vertical-align: baseline; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ procedencia -- */

.prov {
	margin-top: 2.2rem; border-top: 1px solid var(--line); padding-top: 1rem;
	font-size: .73rem; color: var(--muted);
}
.prov b { color: var(--ink); }
.prov code {
	font-family: 'JetBrains Mono', monospace; font-size: .92em;
	background: var(--soft); padding: .08rem .3rem; border-radius: 3px; color: var(--brand);
}

/* ============================================================== analista == */
/* Cajón lateral, no burbuja flotante: una burbuja de chat sobre un estado
   financiero lee a soporte tecnico. Esto es un analista al que se le pregunta. */

.ask-btn {
	appearance: none; cursor: pointer;
	background: rgba(255,255,255,.14); color: #fff;
	border: 1px solid rgba(255,255,255,.3); border-radius: 7px;
	font: inherit; font-size: .76rem; font-weight: 600;
	padding: .42rem .85rem; white-space: nowrap;
}
.ask-btn:hover { background: rgba(255,255,255,.24); }

.ask {
	position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw);
	background: var(--card); border-left: 1px solid var(--line);
	box-shadow: -14px 0 40px rgba(16,21,28,.16);
	display: flex; flex-direction: column; z-index: 40;
	transform: translateX(100%); transition: transform .22s ease;
}
.ask[data-open="true"] { transform: none; }

.ask__top {
	background: var(--brand); color: #fff; padding: .85rem 1rem;
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.ask__top h3 { margin: 0; font-size: .9rem; font-weight: 700; }
.ask__top p  { margin: .1rem 0 0; font-size: .68rem; opacity: .82; }
.ask__x {
	appearance: none; background: none; border: 0; cursor: pointer;
	color: #fff; font-size: 1.3rem; line-height: 1; padding: 0 .2rem; opacity: .8;
}
.ask__x:hover { opacity: 1; }

.ask__log { flex: 1; overflow-y: auto; padding: 1rem; }

.msg { margin-bottom: .9rem; font-size: .84rem; }
.msg__who {
	font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
	color: var(--muted); margin-bottom: .25rem; font-weight: 700;
}
.msg--you .msg__b {
	background: var(--soft); border-radius: 8px 8px 8px 2px;
	padding: .55rem .7rem; color: var(--ink);
}
.msg--ctl .msg__b { color: var(--ink); line-height: 1.62; white-space: pre-wrap; }
.msg--err .msg__b { color: var(--bad); font-size: .8rem; }

.ask__seed { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.seed {
	appearance: none; cursor: pointer; text-align: left;
	background: var(--card); border: 1px solid var(--line); border-radius: 7px;
	font: inherit; font-size: .78rem; color: var(--brand);
	padding: .5rem .65rem;
}
.seed:hover { background: var(--soft); border-color: var(--brand-2); }

.ask__form { border-top: 1px solid var(--line); padding: .75rem; display: flex; gap: .5rem; }
.ask__form input {
	flex: 1; font: inherit; font-size: .84rem;
	border: 1px solid var(--line); border-radius: 7px; padding: .5rem .65rem;
	background: var(--paper); color: var(--ink);
}
.ask__form input:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
.ask__form button {
	appearance: none; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600;
	background: var(--brand); color: #fff; border: 0; border-radius: 7px; padding: .5rem .9rem;
}
.ask__form button:disabled { opacity: .5; cursor: default; }

.ask__note { font-size: .64rem; color: var(--muted); padding: 0 .75rem .7rem; }

.scrim {
	position: fixed; inset: 0; background: rgba(16,21,28,.28);
	z-index: 39; opacity: 0; pointer-events: none; transition: opacity .22s;
}
.scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

/* ================================================================ dossier == */
/* La sección que vende el trabajo. Respira más que el resto de la app a
   propósito: un tablero es denso porque se consulta, un dossier es amplio
   porque se lee una vez. */

.dos__hero {
	background: var(--brand); color: #fff;
	border-radius: 12px; padding: 2.1rem 2.2rem; margin-bottom: 1.4rem;
}
.dos__eyebrow { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; opacity: .72; margin-bottom: .7rem; }
.dos__hero h2 { font-size: clamp(1.5rem, 3.4vw, 2.15rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; margin: 0 0 .8rem; max-width: 22ch; }
.dos__hero p { font-size: .96rem; line-height: 1.62; opacity: .9; max-width: 66ch; margin: 0; }
.dos__hero b { font-weight: 700; opacity: 1; }

.dos__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.7rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.22); }
.dos__stat b { display: block; font-size: 1.55rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dos__stat span { display: block; font-size: .68rem; opacity: .78; margin-top: .2rem; }

.dos__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: .9rem; }

.dcard {
	background: var(--card); border: 1px solid var(--line); border-radius: 10px;
	padding: 1.15rem 1.25rem;
}
.dcard__n { font-family: 'JetBrains Mono', monospace; font-size: .68rem; color: var(--brand-2); font-weight: 700; margin-bottom: .5rem; }
.dcard h3 { font-size: .96rem; font-weight: 700; letter-spacing: -.012em; margin: 0 0 .45rem; }
.dcard p  { font-size: .84rem; color: var(--muted); margin: 0; line-height: 1.6; }
.dcard p + p { margin-top: .55rem; }
.dcard b { color: var(--ink); font-weight: 600; }

.pull {
	border-left: 3px solid var(--brand); padding: .3rem 0 .3rem 1.15rem;
	margin: 1.6rem 0; max-width: 68ch;
	font-size: 1.06rem; line-height: 1.52; letter-spacing: -.012em; color: var(--ink);
}

.dos__sig {
	display: flex; gap: 1.4rem; align-items: flex-start; flex-wrap: wrap;
	background: var(--soft); border: 1px solid var(--line); border-radius: 10px;
	padding: 1.3rem 1.5rem; margin-top: 1.2rem;
}
.dos__sig h3 { margin: 0 0 .2rem; font-size: 1rem; font-weight: 700; }
.dos__sig .role { font-size: .78rem; color: var(--brand); font-weight: 600; margin-bottom: .6rem; }
.dos__sig p { font-size: .84rem; color: var(--muted); margin: 0 0 .7rem; max-width: 62ch; line-height: 1.6; }
.dos__sig .links a { font-size: .78rem; color: var(--brand); font-weight: 600; text-decoration: none; margin-right: 1.1rem; }
.dos__sig .links a:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.chip {
	font-family: 'JetBrains Mono', monospace; font-size: .66rem;
	background: var(--soft); color: var(--brand); border: 1px solid var(--line);
	border-radius: 5px; padding: .2rem .5rem;
}
.dcard .chip { background: #fff; }

/* ================================================================ resumen == */
/* Una hoja, sin scroll, que sobrevive a ser capturada en un PDF.
   LA JERARQUIA VA AL REVES DE LO OBVIO: al primer segundo el lector no debe
   ver el titulo — ya sabe donde esta. Debe ver el numero que lo obliga a
   quedarse. El titulo es lo que menos pesa de la pagina. */

.verdict {
	background: var(--brand); color: #fff;
	border-radius: 12px; padding: 1.5rem 1.8rem;
	display: flex; align-items: center; justify-content: space-between;
	gap: 2rem; flex-wrap: wrap; margin-bottom: .85rem;
}
.verdict h2 {
	font-size: clamp(1.3rem, 2.7vw, 1.85rem); line-height: 1.18;
	letter-spacing: -.028em; font-weight: 700; margin: 0; max-width: 30ch;
}
.verdict h2 em { font-style: normal; color: #F0B27A; }
.verdict__r { text-align: right; font-size: .68rem; opacity: .8; line-height: 1.75; white-space: nowrap; }
.verdict__r b { display: block; font-size: 1.5rem; font-weight: 700; opacity: 1; letter-spacing: -.02em; margin-bottom: .1rem; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: .85rem; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

.tile {
	background: var(--card); border: 1px solid var(--line);
	border-top: 3px solid var(--bad); border-radius: 10px;
	padding: .85rem 1rem; display: flex; flex-direction: column;
}
.tile--med { border-top-color: var(--warn); }
.tile__n { font-family: 'JetBrains Mono', monospace; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.tile__v { font-size: 1.42rem; font-weight: 700; letter-spacing: -.028em; line-height: 1.1; color: var(--bad); font-variant-numeric: tabular-nums; }
.tile--med .tile__v { color: var(--warn); }
.tile__t { font-size: .78rem; font-weight: 600; margin: .35rem 0 .2rem; line-height: 1.35; }
.tile__d { font-size: .7rem; color: var(--muted); line-height: 1.45; margin-top: auto; }

.split { display: grid; grid-template-columns: 1.62fr 1fr; gap: .7rem; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.15rem; }
.panel h3 { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); font-weight: 700; margin: 0 0 .6rem; }

.integrity { display: flex; flex-direction: column; gap: .55rem; }
.ii { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; border-bottom: 1px solid var(--line); padding-bottom: .45rem; }
.ii:last-of-type { border-bottom: 0; }
.ii span { font-size: .74rem; color: var(--muted); }
.ii b { font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ii b.ok { color: var(--ok); }
.built { font-size: .72rem; color: var(--muted); line-height: 1.55; margin: .5rem 0 0; padding-top: .65rem; border-top: 1px solid var(--line); }
.built b { color: var(--ink); font-weight: 600; }

.sumfoot { margin-top: .8rem; font-size: .7rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sumfoot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.sumfoot a:hover { text-decoration: underline; }

/* ================================================================= oferta == */
/* Ultima seccion. Cambia de registro a proposito: hasta aqui el sitio reporta
   lo que encontro; aqui propone. Por eso las restricciones van visibles en
   cada oferta — una propuesta que oculta sus dependencias no es una propuesta,
   es publicidad. */

.offer__lead {
	font-size: clamp(1.15rem, 2.4vw, 1.55rem); line-height: 1.32;
	letter-spacing: -.022em; font-weight: 700; color: var(--ink);
	max-width: 30ch; margin: 0 0 .5rem;
}
.offer__sub { font-size: .9rem; color: var(--muted); max-width: 68ch; margin: 0 0 1.6rem; }

.ocard {
	background: var(--card); border: 1px solid var(--line); border-radius: 10px;
	padding: 1.2rem 1.3rem; display: flex; flex-direction: column;
	border-top: 3px solid var(--brand);
}
.ocard__n { font-family: 'JetBrains Mono', monospace; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-2); margin-bottom: .45rem; }
.ocard h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.015em; margin: 0 0 .35rem; }
.ocard__p { font-size: .84rem; color: var(--muted); margin: 0 0 .9rem; line-height: 1.55; }

.dlv { list-style: none; margin: 0 0 .9rem; padding: 0; }
.dlv li { position: relative; padding-left: 15px; font-size: .81rem; margin-bottom: .42rem; line-height: 1.5; }
.dlv li::before { content: ''; position: absolute; left: 0; top: .52em; width: 6px; height: 6px; border-radius: 1px; background: var(--brand-2); }

.constraint {
	margin-top: auto; font-size: .74rem; line-height: 1.5;
	background: #FDF3E7; border-radius: 6px; padding: .55rem .7rem; color: #6B4318;
}
.constraint b { color: var(--warn); font-weight: 700; }

/* fases */
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: .2rem 0 0; }
@media (max-width: 820px) { .phases { grid-template-columns: 1fr; } }

.phase { position: relative; padding: 1.1rem 1.2rem 1.1rem 0; }
.phase + .phase { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.phase__w { font-family: 'JetBrains Mono', monospace; font-size: .62rem; letter-spacing: .09em; text-transform: uppercase; color: var(--accent, #B45309); margin-bottom: .3rem; }
.phase h4 { font-size: .93rem; font-weight: 700; margin: 0 0 .35rem; letter-spacing: -.012em; }
.phase p { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.55; }
.phase p b { color: var(--ink); font-weight: 600; }

.commit {
	margin-top: 1.4rem; background: var(--brand); color: #fff;
	border-radius: 10px; padding: 1.25rem 1.5rem;
	display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.commit p { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -.012em; max-width: 52ch; }
.commit .mono { font-size: .68rem; opacity: .78; white-space: nowrap; }

/* La restriccion baja de jerarquia. Gemini tuvo razon y yo no: al hacerla el
   elemento mas contrastado de la tarjeta, el foco pasaba a ser la dependencia
   y no el entregable — postura de proveedor enumerando razones para no
   entregar, en vez de manager que conoce lo que el trabajo requiere.
   Se queda visible, en su lugar correcto: subordinada, al final. */
.dlv__req {
	padding-left: 15px; font-size: .77rem; line-height: 1.5;
	color: var(--muted); font-style: italic;
	margin-top: .55rem; padding-top: .5rem; border-top: 1px solid var(--line);
}
.dlv__req::before { display: none; }
