/* Panel LPS — hoja única, sin frameworks. Sobria y legible: esto lo mira
   una persona con prisa, no un jurado de diseño. */

:root {
  --verde: #2f5d3f;
  --verde-claro: #4c7a5d;
  --fondo: #f6f7f5;
  --tinta: #1f2a22;
  --tinta-suave: #5b6a5c;
  --borde: #dde3da;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  line-height: 1.45;
}

/* ---------- Cabecera / navegación ---------- */

header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  background: var(--verde);
  color: #fff;
  padding: 0.55rem 1rem;
}

.marca { font-weight: 700; letter-spacing: 0.02em; }

nav { display: flex; gap: 0.15rem; flex-wrap: wrap; }

nav a {
  color: #dfe9df;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
}

nav a:hover, nav a.activo { background: rgba(255, 255, 255, 0.16); color: #fff; }

.usuario {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

button.enlace {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

button.enlace:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- Contenido ---------- */

main { max-width: 1080px; margin: 1.2rem auto 3rem; padding: 0 1rem; }

h1 { font-size: 1.45rem; margin: 0.4rem 0 0.2rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }

.rango { color: var(--tinta-suave); margin-top: 0; }

/* ---------- Tarjetas del dashboard ---------- */

.tarjetas { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }

.tarjeta {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 0.9rem 1.4rem;
  min-width: 130px;
  display: flex;
  flex-direction: column;
}

.tarjeta-valor { font-size: 1.7rem; font-weight: 700; color: var(--verde); }

.tarjeta-titulo {
  color: var(--tinta-suave);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Tablas ---------- */

.tabla-scroll { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  border: 1px solid var(--borde);
  font-size: 0.92rem;
}

th, td {
  border-bottom: 1px solid #e6ebe3;
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

thead th { background: #eef2ec; font-weight: 600; white-space: nowrap; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

tfoot td { font-weight: 700; background: #f4f7f2; }

tbody tr:hover { background: #f7faf6; }

a { color: #2c5aa0; }

.sin-dato { color: #9aa79b; }

/* ---------- Filtros y paginación ---------- */

.filtros {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 0.8rem 0 1.2rem;
}

.filtros label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--tinta-suave); }

.filtros input[type="date"] {
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--borde);
  border-radius: 4px;
  font: inherit;
  background: #fff;
  color: var(--tinta);
}

.filtros button {
  padding: 0.38rem 1rem;
  border: none;
  border-radius: 4px;
  background: var(--verde);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.filtros button:hover { background: var(--verde-claro); }

.paginacion {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0.8rem 0;
  font-size: 0.9rem;
  color: var(--tinta-suave);
}

/* ---------- Avisos y chips de estado ---------- */

.aviso {
  background: #fff8e6;
  border: 1px solid #e8d9a0;
  padding: 0.7rem 1rem;
  border-radius: 6px;
}

.estados { list-style: none; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }

.chip {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e6ebe3;
  color: var(--tinta);
}

.chip-ok { background: #dcefdc; color: #1e5c2a; }
.chip-pendiente { background: #e7ecf7; color: #2c4a86; }
.chip-procesando { background: #fdf3d8; color: #7a5b12; }
.chip-error { background: #f8dede; color: #8a1f1f; }
.chip-no_procesable { background: #efe3f5; color: #5d2f7a; }

/* ---------- Gráficas SVG ---------- */

.grafica { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 0.8rem 1rem 0.4rem; margin: 1.2rem 0; }
.grafica h2 { margin-top: 0; }

.grafica-barras .barra { fill: var(--verde-claro); }
.grafica-barras .barra:hover { fill: var(--verde); }
.grafica-barras .eje { stroke: #9aa79b; stroke-width: 1; }
.grafica-barras .eje-texto { font-size: 10px; fill: var(--tinta-suave); }
.grafica-barras .sin-datos { font-size: 14px; fill: var(--tinta-suave); }

/* ---------- Login y páginas sueltas ---------- */

.pagina-simple { display: block; }

.caja-login {
  max-width: 420px;
  margin: 14vh auto;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
}

.caja-login .g_id_signin { display: flex; justify-content: center; margin-top: 1rem; }
