:root {
  --azul: #0f3554; --azul-osc: #0a2740; --teal: #0e8f8a; --teal-osc: #0b6f6b;
  --fondo: #f4f6f8; --panel: #ffffff; --borde: #dfe5ea; --texto: #22313e;
  --gris: #6b7a88; --rojo: #b3372f; --verde: #1e7d3c; --ambar: #a06a00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fondo); color: var(--texto); }
a { color: var(--teal-osc); }

.topbar { background: var(--azul); color: #fff; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); display: inline-block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: #dce7ef; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.nav a:hover { background: var(--azul-osc); color: #fff; }
.nav-salir { opacity: .8; }

.container { max-width: 1100px; margin: 24px auto 60px; padding: 0 16px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
.sub { color: var(--gris); margin: 0 0 18px; }

.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--borde); border-radius: 10px; padding: 14px 16px; }
.card .cifra { font-size: 24px; font-weight: 700; margin-top: 2px; }
.card .etiq { color: var(--gris); font-size: 13px; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--borde); font-size: 14px; }
th { background: #eef2f5; font-weight: 600; color: #3c4c5a; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tabla-scroll { overflow-x: auto; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-gris { background: #e8ecef; color: #55636f; }
.chip-azul { background: #dcebfa; color: #175a94; }
.chip-verde { background: #dcf2e2; color: var(--verde); }
.chip-rojo { background: #f7dedc; color: var(--rojo); }
.chip-morado { background: #e8e0f5; color: #5b3f9e; }
.chip-ambar { background: #f7ecd4; color: var(--ambar); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash-ok { background: #dcf2e2; color: var(--verde); border: 1px solid #b8e2c4; }
.flash-error { background: #f7dedc; color: var(--rojo); border: 1px solid #ecc3bf; }

form.inline { display: inline; }
label { display: block; font-size: 13px; color: #3c4c5a; margin: 10px 0 3px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid var(--borde);
  border-radius: 7px; font: inherit; background: #fff; }
textarea { max-width: 560px; }
input.mini { max-width: 90px; padding: 4px 6px; }
.btn { display: inline-block; background: var(--teal); color: #fff; border: none; cursor: pointer;
  padding: 8px 16px; border-radius: 7px; font: inherit; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--teal-osc); }
.btn-sec { background: #eef2f5; color: var(--texto); border: 1px solid var(--borde); }
.btn-sec:hover { background: #e2e8ed; }
.btn-peligro { background: var(--rojo); }
.btn-mini { padding: 4px 10px; font-size: 13px; }
.acciones { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filtros > div { min-width: 160px; }
.aviso { background: #f7ecd4; border: 1px solid #ecd9a8; color: var(--ambar);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }

.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-wrap .panel { padding: 26px; }
.login-logo { text-align: center; font-size: 20px; font-weight: 700; color: var(--azul); margin-bottom: 14px; }
.pie { text-align: center; color: var(--gris); font-size: 12px; padding: 20px; }
.muted { color: var(--gris); font-size: 13px; }
.derecha { text-align: right; }
