/* Panel de administración de InvenTia: mismo lenguaje que el sitio (papel, tinta, esquinas rectas), con menú lateral. */
:root { --tinta: #1b1814; --texto: #4a443c; --suave: #5f574d; --fondo: #f4efe5; --linea: #d9cfba; --coral: #b83c24; --acento: #e0563b; --ok: #2f7d5d; --mono: ui-monospace, Menlo, Consolas, monospace; --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; --lateral: 248px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
.salto { position: absolute; left: -999px; top: 0; background: #fff; padding: .6rem 1rem; z-index: 100; } .salto:focus { left: 0; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

/* Estructura */
.marco { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); min-height: 100vh; }
.lateral { background: var(--tinta); color: #f4efe5; padding: 1.2rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; border-right: 3px solid var(--acento); }
.logo { display: flex; align-items: center; gap: .55rem; text-decoration: none; font: 700 1.35rem var(--serif); color: #f4efe5; flex-wrap: wrap; }
.logo i { width: 20px; height: 20px; background: var(--acento); display: inline-block; }
.logo small { flex-basis: 100%; font: 600 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #d9d2c4; padding-left: 1.6rem; }
.lateral nav { margin-top: 1.4rem; display: grid; gap: .15rem; }
.grupo { font: 700 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #a89f92; margin: 1rem 0 .3rem .6rem; }
.lateral nav a { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: #f4efe5; font-weight: 600; padding: .5rem .6rem; border-left: 3px solid transparent; }
.lateral nav a:hover { background: #2a241d; }
.lateral nav a[aria-current] { background: #2a241d; border-left-color: var(--acento); }
.cuenta { background: var(--acento); color: #1b1814; font: 800 .7rem var(--mono); padding: .05rem .45rem; min-width: 1.4rem; text-align: center; }
.usuario { margin-top: auto; padding-top: 1rem; border-top: 1px solid #4a4137; display: grid; gap: .1rem; font-size: .85rem; }
.usuario small { color: #d9d2c4; word-break: break-all; } .usuario .rol { font: 700 .66rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #7ed0a8; }
.usuario form { margin-top: .6rem; } .usuario button { background: transparent; color: #f4efe5; border-color: #f4efe5; width: 100%; }
main { padding: 1.6rem 2rem 4rem; min-width: 0; }
h1 { font: 700 2rem var(--serif); color: var(--tinta); margin: 0 0 1.2rem; letter-spacing: -.02em; }
h2 { font: 700 1.3rem var(--serif); color: var(--tinta); margin: 2rem 0 .8rem; padding-top: .7rem; border-top: 2px solid var(--tinta); }
h3 { font: 700 1rem var(--serif); color: var(--tinta); margin: 0 0 .5rem; }
.migas { margin: -.6rem 0 1rem; color: var(--suave); } .migas a { font-weight: 600; }

/* Tarjetas de cifras */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.kpi { background: #fff; border: 2px solid var(--tinta); padding: .9rem 1.1rem; box-shadow: 5px 5px 0 var(--linea); }
.kpi strong { display: block; font: 700 1.7rem/1.1 var(--mono); color: var(--tinta); letter-spacing: -.04em; } .kpi.mal strong { color: var(--coral); }
.kpi span { color: var(--suave); font-size: .85rem; display: block; margin-top: .15rem; } .kpi small { color: var(--suave); font-size: .75rem; }
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; } .dos > section { min-width: 0; }

/* Tablas */
table { width: 100%; border-collapse: collapse; background: #fff; border: 2px solid var(--tinta); }
th { text-align: left; font: 700 .68rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--suave); padding: .5rem .8rem; border-bottom: 2px solid var(--tinta); background: #faf6ec; white-space: nowrap; }
td { padding: .6rem .8rem; border-bottom: 1px dashed var(--linea); vertical-align: top; } tr:last-child td { border-bottom: 0; }
.der { text-align: right; } .mono { font-family: var(--mono); } small { color: var(--suave); }
.emp { text-decoration: none; } .emp:hover strong { text-decoration: underline; }
.cod { font-weight: 700; letter-spacing: .04em; user-select: all; color: var(--tinta); } .err { max-width: 26rem; color: #8a2a1a; font-size: .85rem; } .neg { color: var(--coral); font-weight: 700; }
.vacio { padding: 1rem; background: #fff; border: 1px dashed var(--linea); color: var(--suave); margin: 0; } .nota { color: var(--suave); font-size: .88rem; }
.ins { display: inline-block; font: 700 .66rem var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: .15rem .5rem; border: 1.5px solid currentColor; white-space: nowrap; }
.e-ok { color: var(--ok); } .e-error { color: var(--coral); } .e-pendiente { color: #7a5410; } .e-curso { color: #3b5b8a; } .e-pausa { color: #6b4a8a; }
.prog { display: inline-flex; gap: 3px; } .prog i { width: 13px; height: 13px; border: 1.5px solid #8f8576; display: block; }
.prog .p-hecho { background: var(--ok); border-color: var(--ok); } .prog .p-en_curso { background: #fbe9a8; border-color: #c9922e; } .prog .p-detenido { background: var(--coral); border-color: var(--coral); }
.datos { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .4rem 1rem; margin: 0; background: #fff; border: 2px solid var(--tinta); padding: 1rem 1.2rem; } .datos dt { color: var(--suave); font-size: .85rem; } .datos dd { margin: 0; word-break: break-word; }

/* Formularios y botones */
button, .boton-enlace { font: 700 .8rem system-ui; padding: .45rem .8rem; border: 2px solid var(--tinta); background: #fff; color: var(--tinta); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .boton-enlace:hover { box-shadow: 3px 3px 0 var(--tinta); transform: translate(-1px, -1px); }
.b-ok { background: var(--ok); color: #fff; border-color: var(--ok); } .b-mal { color: var(--coral); border-color: var(--coral); }
input, select { font: inherit; padding: .42rem .6rem; border: 2px solid #8f8576; background: #fff; color: var(--tinta); max-width: 100%; }
.acc { white-space: nowrap; } .acc form, .en-linea { display: inline-flex; gap: .4rem; margin: 0 .4rem .3rem 0; align-items: center; flex-wrap: wrap; }
.caja { background: #fff; border: 2px solid var(--tinta); padding: 1rem 1.2rem; } .acciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-top: .5rem; } .rejilla label, .filtros label { display: grid; gap: .25rem; font-weight: 700; color: var(--tinta); font-size: .82rem; }
.rejilla .ancho, .rejilla fieldset, .rejilla button { grid-column: 1 / -1; } .rejilla button { justify-self: start; } .rejilla fieldset { border: 1px dashed var(--linea); display: flex; gap: 1.2rem; flex-wrap: wrap; } .rejilla .chk { display: inline-flex; flex-direction: row; align-items: center; gap: .4rem; font-weight: 400; }
.filtros { display: flex; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; } .filtros input { flex: 1; min-width: 220px; }
.aviso { padding: .8rem 1rem; margin: 0 0 1rem; border-left: 4px solid; font-weight: 600; } .aviso.ok { background: #e3f3ea; border-color: var(--ok); color: #1f6a4c; } .aviso.mal { background: #fbeae7; border-color: var(--coral); color: #8a2a1a; }

/* Gráficos (SVG con atributos: la política de seguridad no admite estilos en línea) */
.grafico { width: 100%; max-width: 720px; background: #fff; border: 2px solid var(--tinta); padding: .5rem; display: block; }
.b-ing { fill: var(--ok); background: var(--ok); } .b-gas { fill: var(--acento); background: var(--acento); } .eje { stroke: var(--tinta); stroke-width: 2; } .et { font: 11px var(--mono); fill: #5f574d; }
.leyenda { font-size: .82rem; color: var(--suave); } .leyenda i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin: 0 .3rem 0 .8rem; }
.barras { list-style: none; margin: 0; padding: 1rem; background: #fff; border: 2px solid var(--tinta); display: grid; gap: .6rem; } .barras li { display: grid; grid-template-columns: 6.5rem 1fr 2rem; gap: .6rem; align-items: center; } .barras svg { width: 100%; height: 14px; background: #f4efe5; } .barras b { font-family: var(--mono); text-align: right; }
.actividad { list-style: none; margin: 0 0 .6rem; padding: 0; background: #fff; border: 2px solid var(--tinta); } .actividad li { padding: .55rem .9rem; border-bottom: 1px dashed var(--linea); } .actividad li:last-child { border-bottom: 0; } .actividad small { display: block; }

/* Entrada */
.entrada { display: grid; place-items: center; min-height: 100vh; background: var(--fondo); }
.acceso { width: min(100% - 2rem, 420px); background: #fff; border: 2px solid var(--tinta); box-shadow: 8px 8px 0 var(--linea); padding: 2rem; } .acceso .logo { color: var(--tinta); } .acceso .logo small { color: var(--suave); } .acceso h1 { margin-top: 1.4rem; }
.boton-google { display: block; text-align: center; text-decoration: none; background: var(--tinta); color: #fff; font-weight: 700; padding: .9rem 1rem; border: 2px solid var(--tinta); margin: 1rem 0 .6rem; } .boton-google:hover { box-shadow: 4px 4px 0 var(--acento); transform: translate(-2px, -2px); }

@media (max-width: 900px) {
  .marco { grid-template-columns: 1fr; } .lateral { position: static; height: auto; flex-direction: column; border-right: 0; border-bottom: 3px solid var(--acento); }
  .lateral nav { grid-template-columns: repeat(2, 1fr); } .grupo { grid-column: 1 / -1; } main { padding: 1.2rem 1rem 3rem; } .dos { grid-template-columns: 1fr; } table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { button, .boton-enlace, .boton-google { transition: none; } button:hover, .boton-enlace:hover, .boton-google:hover { transform: none; } }
