*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

table {
  border-collapse: collapse;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: #1e2d3d;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

code, pre {
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 12px;
}

p {
  line-height: 1.6;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f4f6f9;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #1a4a6b;
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: 3px 0 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.28s ease;
}
.sidebar__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar__logo {
  flex-shrink: 0;
}
.sidebar__logo-img {
  width: 110px;
  height: auto;
  display: block;
}
.sidebar__cerrar {
  margin-left: auto;
  color: #cdd8e8;
  font-size: 1.2rem;
  display: none;
}
.sidebar__cerrar:hover {
  color: #fff;
}
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}
.sidebar__footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item > a, .nav-item > .nav-grupo__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #cdd8e8;
  font-size: 14px;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item > a i, .nav-item > .nav-grupo__btn i {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.nav-item > a:hover, .nav-item > .nav-grupo__btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-item.activo > a, .nav-item.activo > .nav-grupo__btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-left: 3px solid #e8a020;
}

.nav-grupo__flecha {
  margin-left: auto;
  transition: transform 0.2s;
}

.nav-item--grupo.abierto .nav-grupo__flecha {
  transform: rotate(180deg);
}

.nav-grupo__hijos {
  display: none;
  background: rgba(0, 0, 0, 0.15);
}
.nav-grupo__hijos li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 42px;
  color: #cdd8e8;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}
.nav-grupo__hijos li a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-grupo__hijos li.activo a {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item--grupo.abierto .nav-grupo__hijos {
  display: block;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cdd8e8;
  font-size: 12px;
  padding: 8px 16px;
  width: 100%;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.btn-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.contenido-principal {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid #dde3ec;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar__hamburguesa {
  display: none;
  color: #1e2d3d;
  font-size: 1.2rem;
  padding: 4px;
}
.topbar__hamburguesa:hover {
  color: #1a4a6b;
}
.topbar__titulo {
  font-size: 1rem;
  font-weight: 600;
  color: #1e2d3d;
}
.topbar__usuario {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #6b7a8d;
  font-size: 12px;
}
.topbar__usuario i {
  font-size: 1.2rem;
}

.contenido {
  padding: 24px;
  flex: 1;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
}
.overlay--visible {
  display: block;
}

.alerta {
  padding: 8px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alerta--error {
  background: #f4d1cd;
  color: #c0392b;
  border-left: 4px solid #c0392b;
}
.alerta--success {
  background: #c9ebd9;
  color: #2e7d52;
  border-left: 4px solid #2e7d52;
}
.alerta--warning {
  background: #fae0b8;
  color: #d68910;
  border-left: 4px solid #d68910;
}
.alerta--info {
  background: #d0e4fa;
  color: #1565c0;
  border-left: 4px solid #1565c0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
}
.btn--primario {
  background: #1a4a6b;
  color: #fff;
}
.btn--primario:hover {
  background: #22618c;
}
.btn--primario:active {
  transform: scale(0.98);
}
.btn--bloque {
  width: 100%;
  justify-content: center;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.campo__etiqueta {
  font-size: 12px;
  font-weight: 600;
  color: #6b7a8d;
}
.campo__input, .campo__select {
  border: 1px solid #dde3ec;
  border-radius: 4px;
  padding: 8px 16px;
  background: #ffffff;
  color: #1e2d3d;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.campo__input:focus, .campo__select:focus {
  outline: none;
  border-color: #2563a8;
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.15);
}
.campo__input-archivo {
  font-size: 14px;
  padding: 4px 0;
}
.campo__ayuda {
  font-size: 12px;
  color: #6b7a8d;
}

.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a4a6b 0%, #2975a9 100%);
}

.login-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-card__logo {
  width: 180px;
}
.login-card__logo-img {
  width: 180px;
  height: auto;
  display: block;
}
.login-card__subtitulo {
  font-size: 12px;
  color: #6b7a8d;
  margin-bottom: 16px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portada__saludo {
  margin-bottom: 24px;
}
.portada__saludo h2 {
  font-size: 1.4rem;
}
.portada__saludo p {
  color: #6b7a8d;
  margin-top: 4px;
}

.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.tarjeta {
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tarjeta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border-color: #2563a8;
}
.tarjeta__icono {
  font-size: 2rem;
  color: #1a4a6b;
}
.tarjeta__titulo {
  font-size: 1rem;
  font-weight: 700;
  color: #1e2d3d;
}
.tarjeta__desc {
  font-size: 12px;
  color: #6b7a8d;
  line-height: 1.6;
  flex: 1;
}
.tarjeta__accion {
  font-size: 12px;
  color: #2563a8;
  font-weight: 600;
  margin-top: 8px;
}

.panel {
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.panel__titulo {
  font-size: 1rem;
  font-weight: 700;
  color: #1e2d3d;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dde3ec;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.panel__subtitulo {
  font-size: 12px;
  font-weight: 400;
  color: #6b7a8d;
}

.formulario-carga__campos {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}
.formulario-carga__campos .campo--archivo {
  flex: 1;
  min-width: 250px;
}
.formulario-carga__campos .campo--encoding {
  min-width: 200px;
}

.resumen-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.resumen-datos__item {
  background: #f4f6f9;
  border: 1px solid #dde3ec;
  border-radius: 4px;
  padding: 8px 16px;
  min-width: 140px;
}
.resumen-datos__item dt {
  font-size: 12px;
  color: #6b7a8d;
  font-weight: 500;
}
.resumen-datos__item dd {
  font-size: 14px;
  font-weight: 700;
  color: #1e2d3d;
  margin-top: 2px;
}
.resumen-datos--mini {
  gap: 8px;
}
.resumen-datos--mini .resumen-datos__item {
  min-width: 100px;
  padding: 4px 8px;
}

.tabla-scroll {
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid #dde3ec;
}

.tabla {
  width: 100%;
  font-size: 12px;
}
.tabla th {
  background: #f4f6f9;
  padding: 8px 16px;
  text-align: left;
  font-weight: 600;
  color: #1e2d3d;
  border-bottom: 2px solid #dde3ec;
  white-space: nowrap;
  user-select: none;
}
.tabla th.th-activo {
  color: #1a4a6b;
}
.tabla th:hover {
  background: #eaeef4;
}
.tabla td {
  padding: 4px 16px;
  border-bottom: 1px solid #dde3ec;
  color: #1e2d3d;
  vertical-align: top;
}
.tabla td code {
  background: #f4f6f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.tabla tbody tr:last-child td {
  border-bottom: none;
}
.tabla tbody tr:hover td {
  background: #f1f3f7;
}
.tabla--compacta td, .tabla--compacta th {
  padding: 6px 16px;
}
.tabla--mini {
  font-size: 12px;
}

.ejemplos-celda {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6b7a8d;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge--numerico {
  background: #dbeafe;
  color: #1d4ed8;
}
.badge--texto {
  background: #d1fae5;
  color: #065f46;
}
.badge--fecha {
  background: #fef3c7;
  color: #92400e;
}

.estadistica-bloque {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dde3ec;
}
.estadistica-bloque:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.estadistica-bloque__titulo {
  font-size: 12px;
  font-weight: 700;
  color: #6b7a8d;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-controles {
  margin-bottom: 16px;
}
.preview-controles .campo__input {
  max-width: 400px;
}

.preview-conteo {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7a8d;
}

.tabla--preview td {
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn--secundario {
  background: #f4f6f9;
  color: #1e2d3d;
  border: 1px solid #dde3ec;
}
.btn--secundario:hover {
  background: #e7ebf2;
}

.panel--accion-reporte {
  border: 2px solid #2563a8;
  background: #bedbef;
}

.accion-reporte {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.accion-reporte__titulo {
  font-size: 1rem;
  font-weight: 700;
  color: #1a4a6b;
  margin-bottom: 4px;
}
.accion-reporte__titulo i {
  margin-right: 4px;
}
.accion-reporte__desc {
  font-size: 12px;
  color: #6b7a8d;
  max-width: 540px;
}

.btn--reporte {
  padding: 16px 40px;
  font-size: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

.reporte-reservas {
  max-width: 1200px;
}

.reporte-encabezado {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.reporte-encabezado__titulo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e2d3d;
}
.reporte-encabezado__sub {
  font-size: 12px;
  color: #6b7a8d;
  margin-top: 4px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.kpi__etiqueta {
  font-size: 12px;
  color: #6b7a8d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi__valor {
  font-size: 2rem;
  font-weight: 700;
  color: #1a4a6b;
  margin-top: 4px;
  line-height: 1.1;
}
.kpi__sub {
  font-size: 12px;
  color: #6b7a8d;
  margin-top: 2px;
}
.kpi--acento .kpi__valor {
  color: #e8a020;
}
.kpi--exito .kpi__valor {
  color: #2e7d52;
}
.kpi--error {
  border-left: 3px solid #c0392b;
}
.kpi--error .kpi__valor {
  color: #c0392b;
}

.graficos-grilla {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.graficos-grilla--asimetrico {
  grid-template-columns: 1fr 1.4fr;
  align-items: start;
}

.grafico-contenedor {
  position: relative;
  height: 280px;
}
.grafico-contenedor--ancho {
  height: 240px;
}

.estado-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.estado-badge--o {
  background: #c9ebd9;
  color: #2e7d52;
}
.estado-badge--r {
  background: #cee0f4;
  color: #2563a8;
}
.estado-badge--c {
  background: #f4d1cd;
  color: #c0392b;
}
.estado-badge--n {
  background: #fae0b8;
  color: #d68910;
}
.estado-badge--t {
  background: #f3e8ff;
  color: #7b3f9e;
}

.barra-porcentaje {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.barra-porcentaje__fill {
  height: 6px;
  border-radius: 3px;
  background: #2563a8;
  flex-shrink: 0;
  max-width: 80px;
}
.barra-porcentaje__fill--acento {
  background: #e8a020;
}
.barra-porcentaje__fill--exito {
  background: #2e7d52;
}
.barra-porcentaje span {
  font-size: 12px;
  color: #6b7a8d;
  white-space: nowrap;
}

.panel--info-deteccion {
  border-color: #7db3f1;
  background: #e2eefc;
}
.panel--info-deteccion .panel__titulo {
  color: #1565c0;
}

.texto-suave {
  font-size: 12px;
  color: #6b7a8d;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar--abierto {
    transform: translateX(0);
  }
  .sidebar__cerrar {
    display: block;
  }
  .contenido-principal {
    margin-left: 0;
  }
  .topbar__hamburguesa {
    display: block;
  }
  .contenido {
    padding: 16px;
  }
  .formulario-carga__campos {
    flex-direction: column;
  }
  .formulario-carga__campos .campo--archivo, .formulario-carga__campos .campo--encoding {
    width: 100%;
  }
  .graficos-grilla {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
  .accion-reporte {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn--reporte {
    width: 100%;
    justify-content: center;
  }
}
