:root {
  --azul: #0a7fb0; --azul-claro: #e6f4fa; --texto: #1d2733; --gris: #6b7785; --borde: #dde3e8;
  --fondo: #f5f7f9; --ok: #1e7d4f; --aviso: #a86200; --error: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto); background: var(--fondo); }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
main { max-width: 1250px; margin: 0 auto; padding: 1.4rem; }

.barra { display: flex; align-items: center; gap: 1.5rem; background: #fff; border-bottom: 1px solid var(--borde); padding: .6rem 1.4rem; flex-wrap: wrap; }
.barra .marca { font-weight: 700; color: var(--texto); font-size: 1.05rem; }
.barra nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.barra nav a { padding: .35rem .7rem; border-radius: 6px; color: var(--texto); }
.barra nav a.on, .barra nav a:hover { background: var(--azul-claro); color: var(--azul); text-decoration: none; }
.barra .usuario { margin-left: auto; color: var(--gris); font-size: .9rem; }
.enlinea { display: inline; }
button.link { background: none; border: 0; color: var(--azul); cursor: pointer; padding: 0; font: inherit; }

.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 1rem 1.2rem; }
.tarjeta .etq { color: var(--gris); font-size: .85rem; }
.tarjeta .cifra { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.tarjeta .sub { color: var(--gris); font-size: .9rem; font-variant-numeric: tabular-nums; }

.panel { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; background: #fff; }
.tabla { border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; }
th, td { padding: .45rem .7rem; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
th { background: #fafbfc; font-weight: 600; font-size: .85rem; color: var(--gris); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfd; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.excluida td { color: #aab2bb; text-decoration: line-through; }
tfoot td { font-weight: 650; background: #fafbfc; }

.filtros { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filtros label { font-size: .8rem; color: var(--gris); display: flex; flex-direction: column; gap: .15rem; }
input, select, textarea { font: inherit; padding: .4rem .55rem; border: 1px solid var(--borde); border-radius: 6px; background: #fff; }
input[type=checkbox] { width: auto; }
.btn { display: inline-block; background: var(--azul); color: #fff; border: 0; border-radius: 6px; padding: .45rem .9rem; font: inherit; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.sec { background: #fff; color: var(--azul); border: 1px solid var(--azul); }
.btn.peq { padding: .2rem .55rem; font-size: .85rem; }
.btn.peligro { background: var(--error); }

.etiqueta { display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: 99px; background: #eef1f4; color: var(--gris); }
.etiqueta.manual { background: #fff3e0; color: var(--aviso); }
.etiqueta.ok { background: #e6f4ec; color: var(--ok); }
.etiqueta.aviso { background: #fff3e0; color: var(--aviso); }
.etiqueta.error { background: #fdecea; color: var(--error); }

.mensajes { margin-bottom: 1rem; }
.msg { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .4rem; background: var(--azul-claro); white-space: pre-line; }
.msg.success { background: #e6f4ec; }
.msg.warning { background: #fff3e0; }
.msg.error { background: #fdecea; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem 1.2rem; }
.form-grid p { margin: 0; display: flex; flex-direction: column; gap: .2rem; }
.form-grid label { font-size: .85rem; color: var(--gris); }
.helptext { font-size: .8rem; color: var(--gris); }
.errorlist { color: var(--error); margin: 0; padding-left: 1rem; font-size: .9rem; }

.paginacion { margin: 1rem 0; display: flex; gap: .6rem; align-items: center; color: var(--gris); }
.gris { color: var(--gris); }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .dos-col { grid-template-columns: 1fr; } }
.login { max-width: 360px; margin: 8vh auto; }
.login input { width: 100%; }
iframe.pdf { width: 100%; height: 80vh; border: 1px solid var(--borde); border-radius: 10px; background: #fff; }
.tabla td input:not([type=checkbox]) { width: 100%; min-width: 90px; }
