/* COTA v0.1, maqueta F0. Editorial, no SaaS. Tokens documentados en REF_COTA.md. */

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexSans-Regular.otf") format("opentype"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexSans-Italic.otf") format("opentype"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexSans-Medium.otf") format("opentype"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/IBMPlexSans-SemiBold.otf") format("opentype"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexMono-Regular.otf") format("opentype"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexMono-Medium.otf") format("opentype"); }

:root {
  --papel: #F7F4EC;
  --papel-hondo: #EFEBE0;
  --grafito: #23262B;
  --secundario: #5E6168;
  --linea: #D8D2C4;
  --linea-fuerte: #23262B;
  --acento: #1F4D4A;
  --rojo: #9E2B1E;
  --serif: "Source Serif 4", "IBM Plex Serif", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --lectura: 72ch;
  --ancho: 1240px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papel); color: var(--grafito);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
}
a { color: var(--acento); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--acento) 35%, transparent); }
a:hover { border-bottom-color: var(--acento); }

.marco { max-width: var(--ancho); margin: 0 auto; padding: 0 var(--gutter); }
.lectura { max-width: var(--lectura); }

/* Cabecera: wordmark y navegación de texto */
.cabecera { border-bottom: 1px solid var(--linea-fuerte); }
.cabecera .marco { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; padding-top: 18px; padding-bottom: 12px; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 26px; font-variant-caps: all-small-caps; letter-spacing: .14em; color: var(--grafito); border: 0; line-height: 1; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; }
.nav a { color: var(--secundario); border: 0; }
.nav a[aria-current="page"] { color: var(--grafito); border-bottom: 2px solid var(--acento); }
.quien { margin-left: auto; font-size: 13px; color: var(--secundario); }

main { padding: 36px 0 56px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 34px; letter-spacing: -.005em; }
h2 { font-size: 22px; margin-top: 56px; padding-bottom: 8px; border-bottom: 1px solid var(--linea); }
h3 { font-size: 17px; margin-top: 28px; }
p { margin: 10px 0; }
.antetitulo { font-size: 13px; color: var(--secundario); letter-spacing: .02em; margin-bottom: 8px; }
.bajada { font-size: 16px; color: var(--secundario); margin-top: 10px; }
.meta { font-size: 14px; color: var(--secundario); margin-top: 14px; }
.meta span + span::before { content: "  /  "; color: var(--linea); }
.nota { font-size: 13px; color: var(--secundario); }
.mono, code { font-family: var(--mono); font-size: .92em; }

/* Cifras grandes del tablero: tipografía, no tarjetas */
.cifras { display: flex; flex-wrap: wrap; gap: 28px 56px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--linea); }
.cifra .valor { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1; }
.cifra .rotulo { font-size: 13px; color: var(--secundario); margin-top: 6px; }
.cifra .origen { font-size: 12px; }

/* Estados en versalitas: texto, nunca pastillas */
.estado { font-variant-caps: all-small-caps; letter-spacing: .07em; font-weight: 500; white-space: nowrap; }
.estado.vencido, .rojo { color: var(--rojo); }
.estado.aprobado { color: var(--acento); }
.estado.en-curso { color: var(--grafito); }
.estado.pendiente, .estado.sin-dueno { color: var(--secundario); }
/* REF_COTA 7: ÁMBAR y ROJO en grafito 600; el rojo de color solo si la causa es un vencido. */
.semaforo { font-variant-caps: all-small-caps; letter-spacing: .08em; font-weight: 600; color: var(--grafito); }
.semaforo.rojo { color: var(--rojo); }
.semaforo.verde { color: var(--acento); }

/* Tablas a ancho completo, líneas finas, densidad alta */
.tabla-envoltorio { width: 100%; overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--secundario); letter-spacing: .03em;
  padding: 8px 10px 6px; border-bottom: 1px solid var(--linea-fuerte); vertical-align: bottom; }
td { padding: 8px 10px; border-bottom: 1px solid var(--linea); vertical-align: top; }
td.num, th.num { text-align: right; }
td.id, .id { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
tr.urgente td { background: color-mix(in srgb, var(--rojo) 5%, transparent); }
caption { text-align: left; font-size: 13px; color: var(--secundario); padding: 0 0 6px; }

/* Listas de tareas (Lo tuyo): filas, no tarjetas */
.lista { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--linea-fuerte); }
.lista li { padding: 14px 0; border-bottom: 1px solid var(--linea); }
.lista .linea1 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.lista .titulo { font-weight: 500; }
.lista .linea2 { font-size: 13px; color: var(--secundario); margin-top: 4px; }

/* Formulario de entrega */
form.entrega { margin-top: 18px; border-top: 1px solid var(--linea-fuerte); padding-top: 10px; }
.campo { padding: 12px 0; border-bottom: 1px solid var(--linea); }
.campo label { display: block; font-size: 13px; color: var(--secundario); margin-bottom: 6px; }
.campo input[type="text"], .campo input[type="date"], .campo textarea {
  width: 100%; font: inherit; color: var(--grafito); background: transparent;
  border: 0; border-bottom: 1px solid var(--grafito); padding: 6px 0; border-radius: 0; }
.campo textarea { min-height: 72px; resize: vertical; }
.campo input[type="file"] { font: inherit; font-size: 14px; }
.botones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
button, .boton {
  font: inherit; font-weight: 500; font-size: 14px; padding: 9px 18px; cursor: pointer;
  background: var(--grafito); color: var(--papel); border: 1px solid var(--grafito); border-radius: 0; }
button.secundario, .boton.secundario { background: transparent; color: var(--grafito); }
button[disabled] { opacity: .45; cursor: not-allowed; }
.chequeo { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.chequeo li { padding: 6px 0; border-bottom: 1px solid var(--linea); display: flex; justify-content: space-between; gap: 12px; }

blockquote { margin: 12px 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--acento); font-size: 14px; color: var(--grafito); }
blockquote.literal { font-family: var(--serif); font-size: 15px; }
.ancla { scroll-margin-top: 24px; }
.ancla:target { background: color-mix(in srgb, var(--acento) 7%, transparent); }
dl.ficha { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 14px 0 0; font-size: 14px; }
dl.ficha dt { color: var(--secundario); }
dl.ficha dd { margin: 0; }
.pendiente-nexus { font-family: var(--mono); font-size: 13px; color: var(--secundario); }

.pie { border-top: 1px solid var(--linea-fuerte); margin-top: 40px; }
.pie .marco { padding-top: 12px; padding-bottom: 28px; font-size: 12px; color: var(--secundario); display: flex; flex-wrap: wrap; gap: 4px 24px; }
.pie .mono { font-size: 12px; }

/* Teléfono: 390 px. Tablas marcadas como .apilable pasan a filas apiladas. */
@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 27px; }
  h2 { font-size: 20px; margin-top: 40px; }
  .quien { margin-left: 0; width: 100%; }
  .cifras { gap: 20px 32px; }
  .cifra .valor { font-size: 34px; }
  table.apilable thead { display: none; }
  table.apilable, table.apilable tbody, table.apilable tr, table.apilable td { display: block; width: 100%; }
  table.apilable tr { padding: 10px 0; border-bottom: 1px solid var(--linea); }
  table.apilable td { border: 0; padding: 2px 0; }
  table.apilable td[data-r]::before { content: attr(data-r) "  "; color: var(--secundario); font-size: 12px; }
  table.apilable td.num { text-align: left; }
  dl.ficha { grid-template-columns: 1fr; gap: 2px 0; }
  dl.ficha dd { margin-bottom: 8px; }
}

@media print {
  .nav, .quien, form.entrega .botones { display: none; }
  body { background: #fff; }
}
