/* Estilos comunes. Los módulos usan estas clases y, si necesitan algo propio, un <style> en su página. */

/* Fuentes de la web del club (../web): Gemunu Libre para el texto, Quicksand para títulos y botones. */
@font-face { font-family: "Gemunu Libre"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/fonts/gemunu-libre-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Gemunu Libre"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/fonts/gemunu-libre-latin-ext-wght-normal.woff2) format("woff2-variations");
  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: "Quicksand"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/fonts/quicksand-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Quicksand"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/fonts/quicksand-latin-ext-wght-normal.woff2) format("woff2-variations");
  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; }

/* Paleta de ../web/frontend/src/styles/globals.css. Como allí, sin tema oscuro. */
:root {
  color-scheme: light;
  --bg: rgb(243, 243, 243);
  --surface: #ffffff;
  --text: oklch(0.25 0.02 60);
  --muted: oklch(0.5 0.02 60);
  --muted-bg: oklch(0.92 0.015 85);
  --border: oklch(0.88 0.02 85);
  --input: oklch(0.64 0.02 85);     /* borde de controles: ≥3:1 sobre blanco (la web usa 0.7, ~2,7:1) */
  --accent: rgb(0, 76, 72);         /* primary: verde petróleo del club */
  --accent-text: oklch(0.99 0.01 85);
  --secondary: rgb(186, 76, 0);     /* terracota */
  --highlight: rgb(255, 212, 166);  /* melocotón: hover */
  --ring: oklch(0.55 0.15 40);
  --pos: #1f7a3f;
  --neg: oklch(0.52 0.22 27.325);    /* algo más oscuro que el destructive de la web: ≥4,5:1 */
  --warn-bg: #fff4d6;
  --radius: 0.75rem;
  --radius-sm: calc(var(--radius) - 2px);
  --font-display: "Quicksand", sans-serif;
  font-family: "Gemunu Libre", sans-serif;
  font-size: 1.0625rem;  /* Gemunu es estrecha: un punto más para que las tablas se lean igual */
  letter-spacing: .025em;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-text); }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; color: var(--accent); }
h2 { font-size: 1.2rem; margin: 1.75rem 0 .75rem; }
a { color: var(--accent); }

/* Barra superior */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem;
  padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--accent); text-decoration: none; }
.brand .logo { width: 2.25rem; height: 2.25rem; flex-shrink: 0; background: currentColor;
  -webkit-mask: url(/logo.svg) center / contain no-repeat; mask: url(/logo.svg) center / contain no-repeat; }
@media (forced-colors: active) { .brand .logo { forced-color-adjust: none; background: CanvasText; } }
.brand b { display: block; font-family: var(--font-display); font-size: 1rem; line-height: 1.2; letter-spacing: 0; }
.brand small { display: block; color: var(--muted); font-size: .8rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.topbar nav a { padding: .45rem .75rem; border-radius: var(--radius-sm); color: color-mix(in srgb, var(--text) 75%, transparent);
  text-decoration: none; font-size: .95rem; transition: background-color .15s, color .15s; }
.topbar nav a:hover { background: var(--highlight); color: var(--text); }
.topbar nav a[aria-current="page"] { background: var(--accent); color: var(--accent-text);
  font-family: var(--font-display); font-weight: 700; letter-spacing: 0; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.topbar .user { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .9rem; }

/* Tarjetas de cifras */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.card .label { color: var(--muted); font-size: .85rem; }
.card .value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* Tablas */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--muted-bg); font-family: var(--font-display); font-size: .85rem; font-weight: 700; letter-spacing: 0; position: sticky; top: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--highlight) 30%, transparent); }
tfoot td { font-weight: 650; }
/* ponytail: Gemunu y Quicksand no tienen cifras tabulares; los importes en columna usan la del sistema para alinear */
.num { text-align: right; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.voided { text-decoration: line-through; opacity: .55; }
.pending { background: var(--warn-bg); }

/* Formularios */
form.stack { display: grid; gap: .75rem; max-width: 560px; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
label { display: grid; gap: .2rem; font-size: .9rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { min-height: 2.25rem; padding: .25rem .75rem; border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
input[type="checkbox"], input[type="radio"] { min-height: 0; box-shadow: none; accent-color: var(--accent); }
input:not([type="checkbox"], [type="radio"]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
textarea { min-height: 8rem; width: 100%; }
button, .button { min-height: 2.25rem; padding: .25rem 1rem; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: var(--font-display); font-size: .9rem; font-weight: 600; letter-spacing: 0; transition: background-color .15s; }
button:not(:disabled):hover, .button:hover { background: color-mix(in srgb, var(--accent) 90%, transparent); }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--input); }
button.secondary:not(:disabled):hover, .button.secondary:hover { background: var(--highlight); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
button.link { background: none; border: none; color: var(--accent); padding: 0; min-height: 0; text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Avisos */
.notice { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid var(--border); background: var(--surface); }
.notice.error { border-color: var(--neg); color: var(--neg); }
.notice.ok { border-color: var(--pos); color: var(--pos); }

/* Impresión (presupuesto e informes para la directiva) */
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --text: #000; --border: #999; }
  .topbar, .no-print, form:not(.print) { display: none !important; }
  main { max-width: none; padding: 0; }
  .table-wrap { overflow: visible; border: none; }
  th { position: static; }
}
