/* PowderSys — base: fuentes, variables de diseño, tipografía, botones y campos.
   Dirección visual: docs/DISENO.md (colores planos, radio 6 px, sin sombras salvo menús, transiciones <= 150 ms). */

@font-face {
  font-family: "Instrument Sans";
  src: url("/fuentes/instrument-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: "Instrument Sans";
  src: url("/fuentes/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  /* colores (DISENO §6) */
  --fondo: #F5F5F2;
  --superficie: #FFFFFF;
  --texto: #17191C;
  --texto-2: #62666C;
  --linea: #E3E1DC;
  --linea-fuerte: #CFCCC5;
  --acento: #E0531F;          /* marcas: "hoy", puntos, foco */
  --acento-boton: #C9460F;    /* fondo de botón y texto de acento: contraste AA con blanco */
  --acento-boton-hover: #B33C0A;
  --acento-suave: #FBEDE6;
  --en-curso: #2D63B8;
  --reservado: #9A6B00;
  --libre: #2E7D4A;
  --problema: #B42318;
  --problema-suave: #FBECEA;
  --libre-suave: #E9F3EC;
  --aviso-suave: #F8F1DE;
  /* categorías: baja saturación, texto blanco legible */
  --cat-1: #3E5F6B;
  --cat-2: #62753F;
  --cat-3: #8A5E45;
  --cat-4: #7A6A2F;
  --cat-5: #4F6F52;
  --cat-6: #8C5A66;
  /* forma y movimiento (DISENO §7) */
  --radio: 6px;
  --t: 120ms;
  /* tipografía */
  --fuente: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --fuente-numeros: "Instrument Sans", "Segoe UI", system-ui, sans-serif; /* cambiar a una monoespaciada si faltan cifras tabulares */
  /* espaciado */
  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 24px; --e6: 32px; --e7: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font-family: var(--fuente); font-size: 1rem; line-height: 1.45; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
h2 { font-size: 1.1rem; line-height: 1.25; font-weight: 600; }
h3 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-2); }
a { color: inherit; text-decoration-color: var(--linea-fuerte); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
.enlace { color: var(--acento-boton); text-decoration: none; font-weight: 500; background: none; border: 0; padding: 0; font: inherit; font-weight: 500; cursor: pointer; }
.enlace:hover { text-decoration: underline; }
.muted { color: var(--texto-2); }
.chico { font-size: 0.867rem; }
.fuerte { font-weight: 600; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* cifras: alineadas a la derecha y tabulares */
.num, .plata { font-family: var(--fuente-numeros); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cod { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; white-space: nowrap; }

:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 3px; }

/* ── botones ── */
.boton {
  font: inherit; font-weight: 500; line-height: 1; padding: 0 var(--e4); height: 36px;
  border-radius: var(--radio); border: 1px solid var(--linea-fuerte); background: var(--superficie); color: var(--texto);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--e2); white-space: nowrap;
  transition: background var(--t), border-color var(--t), color var(--t); text-decoration: none;
}
.boton:hover { background: var(--fondo); border-color: var(--texto-2); }
.boton:disabled, .boton[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.boton.primario { background: var(--acento-boton); border-color: var(--acento-boton); color: #fff; }
.boton.primario:hover:not(:disabled) { background: var(--acento-boton-hover); border-color: var(--acento-boton-hover); }
.boton.grande { height: 42px; padding: 0 var(--e5); font-size: 1rem; }
.boton.chico { height: 30px; padding: 0 var(--e3); font-size: 0.867rem; }
.boton.texto { border-color: transparent; background: transparent; color: var(--texto-2); padding: 0 var(--e3); }
.boton.texto:hover { color: var(--texto); background: var(--fondo); }
.boton.peligro { color: var(--problema); border-color: var(--problema); }
.boton.peligro:hover { background: var(--problema-suave); }
.boton.cargando::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: giro 700ms linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ── campos ── */
.campo { display: flex; flex-direction: column; gap: var(--e1); min-width: 0; }
.campo > label, .campo > .etiqueta { font-size: 0.8rem; font-weight: 500; color: var(--texto-2); }
.campo .ayuda { font-size: 0.8rem; color: var(--texto-2); }
.campo .error-campo { font-size: 0.8rem; color: var(--problema); }
input, select, textarea {
  font: inherit; color: var(--texto); background: var(--superficie);
  border: 1px solid var(--linea-fuerte); border-radius: var(--radio); height: 36px; padding: 0 var(--e3); width: 100%; min-width: 0;
  transition: border-color var(--t);
}
textarea { height: auto; padding: var(--e2) var(--e3); resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--texto-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--acento); outline-offset: 0; border-color: var(--acento); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; padding: 0; accent-color: var(--acento-boton); }
input.num, input[type="number"] { font-variant-numeric: tabular-nums; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--problema); }
.check { display: inline-flex; align-items: center; gap: var(--e2); cursor: pointer; }

/* ── estado: texto con punto de color ── */
.estado { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--texto-2); flex: none; }
.estado.pendiente::before { background: transparent; border: 2px solid var(--reservado); }
.estado.pendiente { color: var(--reservado); }
.estado.confirmada::before { background: var(--reservado); }
.estado.confirmada { color: var(--reservado); }
.estado.en_curso::before { background: var(--en-curso); }
.estado.en_curso { color: var(--en-curso); }
.estado.finalizada::before { background: var(--libre); }
.estado.finalizada { color: var(--libre); }
.estado.cancelada::before { background: var(--texto-2); }
.estado.cancelada { color: var(--texto-2); }
.estado.operativo::before, .estado.disponible::before { background: var(--libre); }
.estado.operativo, .estado.disponible { color: var(--libre); }
.estado.alquilada::before { background: var(--en-curso); }
.estado.alquilada { color: var(--en-curso); }
.estado.en_reparacion::before { background: var(--reservado); }
.estado.en_reparacion { color: var(--reservado); }
.estado.fuera_de_servicio::before, .estado.baja::before { background: var(--problema); }
.estado.fuera_de_servicio, .estado.baja { color: var(--problema); }

.positivo { color: var(--libre); }
.negativo { color: var(--problema); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

[hidden] { display: none !important; }
