/* tokens de diseño. Identidad "Cuaderno de jornal": papel cálido, tinta, un único acento bermellón.
   Claro por defecto; oscuro con prefers-color-scheme o [data-theme="dark"]; [data-theme="light"] fuerza claro. */
/* Fuentes locales (SIL OFL 1.1): Fraunces (titulares) e Inter (interfaz). Ver assets/fonts/LICENCIAS.txt */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/fraunces-latin-wght.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, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/fraunces-latinext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/inter-latin-wght.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, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/inter-latinext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;

  /* Papel y tinta */
  --paper: #f4efe4;          /* fondo de página */
  --surface: #fbf8f0;        /* tarjetas */
  --surface-2: #ece5d5;      /* hundido: inputs, cabeceras de tabla */
  --raised: #fffdf7;         /* elementos elevados: modales, menús */
  --line: #ddd3bf;
  --line-strong: #bfb39a;    /* filete decorativo (cabeceras, separadores) */
  --control-line: #8a7f6b;   /* borde de controles (input, check, switch): >= 3:1 (WCAG 1.4.11) */
  --ink: #1c1a15;
  --ink-2: #4b463a;
  --ink-3: #6b6454;          /* texto apagado (AA sobre --paper) */
  --ink-inv: #fbf8f0;        /* texto sobre tinta */

  /* Acento y semánticos */
  --accent: #b53a08;         /* bermellón */
  --accent-ink: #ffffff;
  --accent-soft: #f8e2d4;
  --accent-strong: #9a3412;
  --ok: #22664a;   --ok-soft: #d6ebdf;
  --warn: #855008; --warn-soft: #f4e3bf;   /* texto sobre su -soft >= 4.5:1 */
  --ok-ink: #ffffff; --err-ink: #ffffff; --cat-ink: #ffffff;   /* texto sobre relleno ok / err / categorías */
  --err: #b3261e;  --err-soft: #f5d6d2;
  --info: #35588a; --info-soft: #d9e3f2;
  --focus: #1c1a15;

  /* Paleta de categorías (ausencias, zonas, jornadas): c1..c8 */
  --abs-c1: #2b7a58; --abs-c2: #35588a; --abs-c3: #a34a7c; --abs-c4: #6e5a8f;
  --abs-c5: #955a0a; --abs-c6: #1f7a85; --abs-c7: #b53a08; --abs-c8: #8a2a2a;

  /* Tipografía: pilas del sistema (sin descargas). Titulares serif editorial, UI sans, cifras monoespaciadas */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Bitstream Charter", Georgia, "Noto Serif", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;

  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-base: .9375rem; --fs-md: 1.0625rem;
  --fs-lg: 1.25rem; --fs-xl: 1.625rem; --fs-2xl: 2.25rem; --fs-3xl: 3.5rem;
  --lh-tight: 1.15; --lh-base: 1.5;

  /* Espaciado (base 4) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;
  --gutter: 1rem;

  /* Radios: ligeramente "troquelados", nunca píldora salvo badges */
  --r-xs: 3px; --r-sm: 5px; --r-md: 9px; --r-lg: 14px; --r-pill: 999px;

  /* Sombras de papel apilado */
  --shadow-1: 0 1px 0 rgba(28, 26, 21, .06), 0 1px 2px rgba(28, 26, 21, .06);
  --shadow-2: 0 2px 0 rgba(28, 26, 21, .05), 0 8px 24px -8px rgba(28, 26, 21, .22);
  --shadow-3: 0 2px 0 rgba(28, 26, 21, .06), 0 24px 56px -12px rgba(28, 26, 21, .38);
  --scrim: rgba(28, 22, 12, .45);

  /* Movimiento */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --t-fast: 120ms; --t-base: 200ms; --t-slow: 360ms;

  /* Layout */
  --sidebar-w: 248px; --topbar-h: 56px; --bottombar-h: 60px; --content-max: 1180px;
  --z-sidebar: 20; --z-topbar: 30; --z-drawer: 60; --z-modal: 80; --z-toast: 100; --z-tip: 110;

  /* Textura de papel (SVG inline, sin red) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .08 0 0 0 0 .05 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  --grain-opacity: .05;
}

/* Oscuro: "cuaderno a la luz de una lámpara" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #16140f; --surface: #1e1b14; --surface-2: #2a261c; --raised: #26221a;
    --line: #38332a; --line-strong: #544d3e; --control-line: #8d8470;
    --ink: #f2ecdd; --ink-2: #cfc7b3; --ink-3: #a29a85; --ink-inv: #16140f;
    --accent: #f2763d; --accent-ink: #1a0d05; --accent-soft: #3d2415; --accent-strong: #ff9a6b;
    --ok: #62c79d; --ok-soft: #1c3a2e; --warn: #e5b04e; --warn-soft: #3b2e12;
    --err: #f28b82; --err-soft: #442422; --info: #93b4e8; --info-soft: #1f2e48;
    --focus: #f2ecdd; --ok-ink: #0d1f17; --err-ink: #2b0a08; --cat-ink: #16140f;
    --abs-c1: #62c79d; --abs-c2: #93b4e8; --abs-c3: #e58cbd; --abs-c4: #b6a2e0;
    --abs-c5: #e5b04e; --abs-c6: #5fcad6; --abs-c7: #f2763d; --abs-c8: #e88a8a;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, .4); --shadow-2: 0 10px 30px -8px rgba(0, 0, 0, .7); --shadow-3: 0 28px 60px -12px rgba(0, 0, 0, .85);
    --scrim: rgba(0, 0, 0, .62); --grain-opacity: .07;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16140f; --surface: #1e1b14; --surface-2: #2a261c; --raised: #26221a;
  --line: #38332a; --line-strong: #544d3e; --control-line: #8d8470;
  --ink: #f2ecdd; --ink-2: #cfc7b3; --ink-3: #a29a85; --ink-inv: #16140f;
  --accent: #f2763d; --accent-ink: #1a0d05; --accent-soft: #3d2415; --accent-strong: #ff9a6b;
  --ok: #62c79d; --ok-soft: #1c3a2e; --warn: #e5b04e; --warn-soft: #3b2e12;
  --err: #f28b82; --err-soft: #442422; --info: #93b4e8; --info-soft: #1f2e48;
  --focus: #f2ecdd; --ok-ink: #0d1f17; --err-ink: #2b0a08; --cat-ink: #16140f;
  --abs-c1: #62c79d; --abs-c2: #93b4e8; --abs-c3: #e58cbd; --abs-c4: #b6a2e0;
  --abs-c5: #e5b04e; --abs-c6: #5fcad6; --abs-c7: #f2763d; --abs-c8: #e88a8a;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .4); --shadow-2: 0 10px 30px -8px rgba(0, 0, 0, .7); --shadow-3: 0 28px 60px -12px rgba(0, 0, 0, .85);
  --scrim: rgba(0, 0, 0, .62); --grain-opacity: .07;
}

@media (min-width: 768px) { :root { --gutter: 1.5rem; } }
@media (min-width: 1200px) { :root { --gutter: 2rem; } }

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-base: 0ms; --t-slow: 0ms; }
}
