/* ============================================
   RESET
============================================ */
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Courier New", Courier, monospace;
}

/* ============================================
   ALTURAS BASE (CLAVE PARA QUE EL CONTENEDOR LLENE)
============================================ */
html, body{
  height: 100%;
  font-size: 16px;
}

/* ============================================
   BODY
============================================ */
body{
  background: #7A8E27;     /* fondo verde */
  padding: 30px 0;
}

/* ============================================
   CONTENEDOR PRINCIPAL (TARJETA BLANCA)
   ✅ Ajuste: misma presencia visual pero MÁS COMPACTO
============================================ */
.contenedor-premium{
  background: #fff;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 22px;              /* ↓ antes 20px 24px */
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(0,0,0,0.25);

  /* Mantiene footer abajo, pero sin “inflar” tanto la pantalla */
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);  /* igual que asistente (30+30) */
}

/* ============================================
   HEADER
   ✅ Compacto (menos aire y logos algo más pequeños)
============================================ */
header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;   /* ↓ antes 22px */
}

.logo{
  height: 92px;          /* ↓ antes 95px */
  width: auto;
}

.tarifas-img{
  height: 110px;         /* ↓ antes 120px */
  width: auto;
  object-fit: contain;
}

/* ============================================
   TÍTULO
   ✅ Compacto (tamaño/aire como en Asistente)
============================================ */
.titulo-centrado{
  text-align: center;
  margin-bottom: 16px;   /* ↓ antes 22px */
  font-size: 30px;       /* ↓ antes 34px */
  font-weight: 700;
  font-family: "Courier New", Courier, monospace;
}

/* ============================================
   SISTEMAS
   ✅ Menos separación + botones más compactos
============================================ */
#categorias{
  display: flex;
  justify-content: center;
  gap: 16px;            /* ↓ antes 18px */
  margin-bottom: 14px;  /* ↓ antes 16px */
}

#categorias .categoria{
  padding: 10px 20px;   /* ↓ antes 10px 22px */
  font-size: 16px;
  background: #e8e8e8;
  border-radius: 10px;
  border: 2px solid #ccc;
  cursor: pointer;
  transition: 0.2s;
}

#categorias .categoria.activa{
  background: #B8C320;
  border-color: #B8C320;
  color: #fff;
}

/* ============================================
   SUBCATEGORÍAS
   ✅ Menos “aire” y botones un pelín más pequeños
============================================ */
#subcategorias{
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;  /* ↓ antes 18px */
}

#subcategorias button{
  padding: 7px 14px;    /* ↓ antes 7px 16px */
  font-size: 13px;      /* ↓ antes 14px */
  background: #f4f4f4;
  border: 1px solid #888;
  border-radius: 8px;
  cursor: pointer;
}

#subcategorias button.activa{
  background: #007bff;
  color: #fff;
  border-color: #0056c7;
}

/* ============================================
   BOTÓN FICHA TÉCNICA (slot bajo subsistema)
============================================ */
#subcategorias{
  display: flex;
  justify-content: center;
  gap: 18px;
}

#subcategorias .subcat-item{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

#subcategorias .subcat-ficha-slot{
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 4px; /* ↓ antes 6px */
}

/* Botón Ficha técnica - pequeño */
#subcategorias .abn-ficha-btn{
  height: 16px;
  min-width: 58px;
  padding: 0 6px;

  border-radius: 7px;
  border-width: 1px;

  font-size: 8px;
  letter-spacing: .15px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 2px 0 rgba(0,0,0,0.12),
    0 4px 8px rgba(0,0,0,0.12);
}

#subcategorias .abn-ficha-btn:hover{ filter: brightness(1.05); }
#subcategorias .abn-ficha-btn:active{
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 1px 0 rgba(0,0,0,0.12),
    0 3px 7px rgba(0,0,0,0.12);
}

/* =========================================================
   FIX BOTÓN "FICHA TÉCNICA" (al final)
========================================================= */
#subcategorias button.abn-ficha-btn{
  background: linear-gradient(180deg,#3a8cff 0%,#1d6df2 60%,#0d49b8 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(0,0,0,0.28) !important;

  height: 16px !important;
  padding: 0 6px !important;
  border-radius: 7px !important;

  font-size: 8px !important;
  font-weight: 800 !important;
  letter-spacing: .1px !important;
  text-transform: uppercase !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  white-space: nowrap !important;

  width: fit-content !important;
  min-width: 0 !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 2px 6px rgba(0,0,0,.18) !important;
}

#subcategorias button.abn-ficha-btn span{
  color: inherit !important;
  font: inherit !important;
  line-height: 1 !important;
}

/* ============================================
   BUSCADOR
   ✅ Compacto (altura y gaps)
============================================ */
.buscador{
  display: grid;
  grid-template-columns: 2fr 0.6fr 0.6fr 0.6fr 0.8fr auto auto auto;
  gap: 6px;
  align-items: center;
}

.buscador input{
  padding: 7px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
}

.buscador input[type="number"], #dtoTotal{
  max-width: 90px;
  text-align: center;
}

/* Botones buscador */
.buscador button{
  background: #B8C320;
  border: none;
  color: #fff;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.buscador button:hover{ filter: brightness(1.06); }

/* ============================================
   TABLAS BASE
============================================ */
table{
  width: 100%;
  border-collapse: collapse;
}

/* ============================================
   TABLA TARIFA
   ✅ Compacto (tamaño letra y paddings)
============================================ */
#tabla-tarifa{
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  margin-top: 10px;

  font-size: 14px;
}

/* Cabecera sticky */
#tabla-tarifa th{
  position: sticky;
  top: 0;
  z-index: 5;

  background: #B8C320;
  color: #fff;
  font-weight: 700;
  text-align: center;

  font-size: 13px;
  padding: 6px 6px;
}

/* Celdas */
#tabla-tarifa td{
  font-size: 13px;
  padding: 6px 6px;
  line-height: 1.15;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
}

#tabla-tarifa tr:hover{
  background-color: #e3eaa0;
  color: #000;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

/* Anchos/alineación */
#tabla-tarifa th:nth-child(1), #tabla-tarifa td:nth-child(1){
  width: 18%;
  text-align: left;
  padding-left: 10px;
}

#tabla-tarifa th:nth-child(2), #tabla-tarifa td:nth-child(2){
  width: 50%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 10px;
}

#tabla-tarifa th:nth-child(3), #tabla-tarifa td:nth-child(3),
#tabla-tarifa th:nth-child(4), #tabla-tarifa td:nth-child(4){
  width: 10%;
  text-align: right;
  padding-right: 10px;
}

/* ============================================
   FOOTER
   ✅ Pegado abajo del panel
============================================ */
footer{
  margin-top: auto;
  text-align: center;
  width: 100%;
  color: #333;
  font-size: 14px;
  padding: 10px 0 0; /* ↓ antes 12px */
  font-family: "Courier New", Courier, monospace;
}

/* ============================================
   COMPACTAR FILAS TABLA TARIFA (por si JS inyecta estilos)
============================================ */
html body #tabla-tarifa table th,
html body #tabla-tarifa table td{
  padding: 4px 6px !important;
  line-height: 1.05 !important;
}

html body #tabla-tarifa table tr{
  height: auto !important;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 980px){
  .contenedor-premium{ padding: 16px 16px; }
  .logo{ height: 86px; }
  .tarifas-img{ height: 105px; }
  .titulo-centrado{ font-size: 28px; }
  .buscador{ grid-template-columns: 1fr 90px 90px 90px 110px auto; }
}

@media (max-width: 640px){
  header{ flex-direction: column; gap: 10px; }
  .titulo-centrado{ font-size: 26px; }
  #categorias{ flex-wrap: wrap; }
  #subcategorias{ flex-wrap: wrap; }
  .buscador{ grid-template-columns: 1fr 1fr; }
  .buscador input, .buscador button{ width: 100%; }
}

/* ====== FIX TAMAÑO PANEL (igual que Asistente) ====== */
html, body{
  height: 100% !important;
}

body{
  padding: 30px 0 !important;
  background: #7A8E27 !important;
}

.contenedor-premium{
  max-width: 1180px !important;
  padding: 18px 22px !important;          /* ✅ coherente con el ajuste de arriba */
  display: flex !important;
  flex-direction: column !important;
  min-height: calc(100vh - 60px) !important;
}

/* Footer pegado abajo */
.contenedor-premium footer{
  margin-top: auto !important;
}
/* =========================
   OVERRIDE FINAL COMPACTO
   (pegar al final del style.css)
========================= */

body{
  padding: 16px 0 !important;
}

.contenedor-premium{
  max-width: 1100px !important;
  padding: 14px 18px !important;
}

header{
  margin-bottom: 16px !important;
}

/* ✅ matar el inflado del header */
html body header .logo{
  height: 92px !important;
  width: auto !important;
}
html body header .tarifas-img{
  height: 110px !important;
  width: auto !important;
}

/* título */
.titulo-centrado{
  font-size: 30px !important;
  margin-bottom: 18px !important;
}
