/* Manuela — sistema de diseño (ver blueprint sección 7). Tratamiento
   utilitario: jerarquía clara, sin flourishes. */

:root {
  color-scheme: light dark;
  --bg: #f4f8f9;
  --surface: #ffffff;
  --text: #0f1f2b;
  --muted: #5c7484;
  --accent: #1f8f88;
  --accent-ink: #ffffff;
  --exito-bg: #e3f5ec;
  --exito-borde: #1a8f5a;
  --exito-texto: #12633e;
  --error: #c23b3b;
  --borde: #d8e2e6;
  --radio: 8px;
  --radio-tarjeta: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1420;
    --surface: #101c2c;
    --text: #e6edf3;
    --muted: #7d95ab;
    --accent: #3aa6a0;
    --accent-ink: #06201d;
    --exito-bg: #10291f;
    --exito-borde: #2c7a56;
    --exito-texto: #7fd9ab;
    --error: #e57070;
    --borde: #223244;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}

.tabular { font-variant-numeric: tabular-nums; }

a { color: var(--accent); }

header.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--borde);
}
header.app-header .marca { font-weight: 600; font-size: 1.1rem; letter-spacing: 0.01em; }
header.app-header nav { display: flex; gap: 1.25rem; align-items: center; }
header.app-header nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
header.app-header nav a:hover, header.app-header nav a.activo { color: var(--accent); }

main { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
main.ancho { max-width: 1200px; }

.tarjeta {
  background: var(--surface);
  border-radius: var(--radio-tarjeta);
  padding: 1.5rem 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 1.25rem; text-wrap: balance; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.75rem; }

.campo { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.campo label { font-weight: 500; font-size: 0.85rem; }
.campo .req { color: var(--error); }
.campo input, .campo select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}
.campo input:focus, .campo select:focus, button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.fila { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
@media (max-width: 640px) { .fila { grid-template-columns: 1fr; } }

button, .boton {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radio);
  border: 1px solid transparent;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button.primario { background: var(--accent); color: var(--accent-ink); }
button.secundario { background: transparent; color: var(--text); border-color: var(--borde); }
.acciones { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

.caja-exito {
  background: var(--exito-bg);
  border: 1px solid var(--exito-borde);
  color: var(--exito-texto);
  border-radius: var(--radio);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}
.caja-exito b { color: inherit; }

.error-msg { color: var(--error); font-size: 0.85rem; margin-top: 0.4rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--borde); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.pill {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 600;
}

.grafico-barras { display: flex; flex-direction: column; gap: 0.9rem; }
.barra-fila { display: grid; grid-template-columns: 140px 1fr 3rem; align-items: center; gap: 0.75rem; }
.barra-pista { background: var(--bg); border-radius: 4px; height: 22px; overflow: hidden; }
.barra-relleno { height: 100%; border-radius: 4px; background: var(--accent); }
.barra-total { text-align: right; font-weight: 600; }

.buscador { margin-bottom: 1.25rem; }
.buscador input { width: 100%; max-width: 360px; }
