:root{
  --abn-green:#B8C320;
  --abn-green-dark:#9aa31a;
  --abn-olive-bg:#788b2a;
  --abn-text:#111;
  --abn-muted:rgba(0,0,0,.70);
  --abn-border:rgba(0,0,0,.14);
  --abn-soft:rgba(0,0,0,.06);
  --abn-shadow:0 18px 40px rgba(0,0,0,.18);
  --abn-radius:18px;
  --abn-radius-sm:12px;
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  padding:24px 0;
  background:var(--abn-olive-bg);
  color:var(--abn-text);
  font-family:Arial, Helvetica, sans-serif;
}

.contenedor-premium{
  width:min(1180px,94%);
  margin:0 auto;
  background:#fff;
  border-radius:var(--abn-radius);
  box-shadow:var(--abn-shadow);
  padding:28px 34px 18px;
}

.header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:10px;
}

.logo{ display:block; height:120px; width:auto; }
.tarifas-img{ display:block; height:130px; width:auto; }

.titulo-centrado{
  text-align:center;
  margin:8px 0 16px;
  font-size:44px;
  font-weight:800;
  letter-spacing:.2px;
}

/* =========================
   CATEGORÍAS / SUBCATS
========================= */
#categorias, #subcategorias{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:14px;
}

#categorias{ margin:10px 0 10px; }
#subcategorias{ margin:10px 0 18px; gap:12px; }

.categoria, .subcat{
  border:1px solid rgba(0,0,0,.22);
  background:#efefef;
  color:#111;
  padding:12px 26px;
  border-radius:var(--abn-radius-sm);
  cursor:pointer;
  font-weight:800;
  letter-spacing:.35px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 6px 14px rgba(0,0,0,.12);
}

.subcat{
  padding:10px 18px;
  min-width:140px;
}

.categoria:hover, .subcat:hover{ filter:brightness(1.01); }

.categoria.activa, .subcat.activa{
  background:var(--abn-green);
  border-color:rgba(0,0,0,.30);
  color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.4), 0 10px 18px rgba(0,0,0,.14);
}

.subcat-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}

.subcat-ficha-slot{
  min-height:34px;
  display:flex;
  justify-content:center;
  align-items:center;
}

.abn-ficha-btn{
  border:1px solid rgba(0,0,0,.20);
  background:#efefef;
  color:#111;
  padding:4px 10px;
  border-radius:10px;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.2px;
  font-size:11px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65), 0 3px 8px rgba(0,0,0,.10);
}
.abn-ficha-btn:hover{ filter:brightness(1.01); }

/* =========================
   BUSCADOR
========================= */
.buscador{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:10px 10px;
  margin:8px 0 14px;
  padding:0 18px;
}

#buscar{
  flex:0 1 340px;
  max-width:340px;
  min-width:240px;
  height:44px;
  border-radius:10px;
  border:1px solid var(--abn-border);
  padding:0 14px;
  font-size:15px;
  outline:none;
  box-shadow:0 1px 0 var(--abn-soft);
}

#dto1,#dto2,#dto3{
  width:76px;
  height:44px;
  border-radius:10px;
  border:1px solid var(--abn-border);
  padding:0 10px;
  text-align:center;
  font-size:14px;
  font-weight:700;
  outline:none;
  box-shadow:0 1px 0 var(--abn-soft);
}

#dtoTotal{
  width:110px;
  height:44px;
  border-radius:10px;
  border:1px solid var(--abn-border);
  padding:0 10px;
  text-align:center;
  font-size:14px;
  font-weight:700;
  outline:none;
  box-shadow:0 1px 0 var(--abn-soft);
}

.buscador button{
  height:44px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.20);
  background:#efefef;
  padding:0 12px;
  font-weight:800;
  cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 6px 14px rgba(0,0,0,.12);
  white-space:nowrap;
}

#modificarDtoGlobal,
#verPresupuesto{
  background:var(--abn-green);
  border-color:rgba(0,0,0,.25);
  color:#fff;
}
#modificarDtoGlobal:hover,
#verPresupuesto:hover{ filter:brightness(1.02); }

#limpiar{
  background:#dc3545 !important;
  color:#fff !important;
  border-color:rgba(0,0,0,.25) !important;
}
#limpiar:hover{ filter:brightness(1.03); }

#descargarPdfBtn{
  order:999;
  flex-basis:100%;
  width:fit-content;
  margin-left:0 !important;
  justify-self:center;
}

/* =========================
   TABLA TARIFA
========================= */
#tabla-tarifa{
  width:100%;
  border:1px solid var(--abn-border);
  border-radius:10px;
  overflow:hidden;
  background:#fff;
}

#tabla-tarifa table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}

#tabla-tarifa thead th{
  background:var(--abn-green);
  color:#fff;
  font-weight:900;
  text-align:center;
  padding:6px 10px;
  font-size:14px;
  white-space:nowrap;
  vertical-align:middle;
}

#tabla-tarifa td{
  padding:4px 10px;
  border-top:1px solid rgba(0,0,0,.08);
  font-size:13px;
  line-height:1.15;
}

#tabla-tarifa tbody tr:nth-child(even){ background:rgba(0,0,0,.02); }

#tabla-tarifa thead th:nth-child(1){ width:15%; }
#tabla-tarifa thead th:nth-child(2){ width:55%; }
#tabla-tarifa thead th:nth-child(3){ width:10%; }
#tabla-tarifa thead th:nth-child(4){ width:10%; }
#tabla-tarifa thead th:nth-child(5){ width:10%; }

.btnAdd{
  width:30px;
  height:30px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.20);
  background:var(--abn-green);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.btnAdd:hover{ filter:brightness(1.02); }

.resaltadoABN{
  background:rgba(184,195,32,.25);
  border-radius:4px;
  padding:0 2px;
}

/* =========================
   PRESUPUESTO
========================= */
#presupuesto-container{ width:100%; }

#presupuesto-container table{
  width:100%;
  border-collapse:collapse;
  border:1px solid var(--abn-border);
  border-radius:10px;
  overflow:hidden;
  table-layout:fixed;
}

#presupuesto-container thead th{
  background:var(--abn-green);
  color:#fff;
  font-weight:900;
  padding:10px 8px;
  font-size:12px;
  white-space:nowrap;
  text-align:center;
  vertical-align:middle;
}

#presupuesto-container td{
  padding:9px 8px;
  border-top:1px solid rgba(0,0,0,.08);
  font-size:11px;
  line-height:1.15;
}

/* descripción compacta (2 líneas) */
#presupuesto-container tbody td:nth-child(2){
  font-size:10.5px;
  line-height:1.05;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}

/* Botonera en presupuesto */
.botonVerde{
  background:var(--abn-green);
  border:1px solid rgba(0,0,0,.20);
  color:#fff;
  border-radius:10px;
  padding:10px 14px;
  font-weight:900;
  cursor:pointer;
  margin:10px 8px 0 0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55), 0 8px 16px rgba(0,0,0,.12);
}

.btn-danger{
  background:#dc3545;
  border:1px solid rgba(0,0,0,.20);
  color:#fff;
  border-radius:10px;
  padding:10px 14px;
  font-weight:900;
  cursor:pointer;
  margin:10px 0 0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 8px 16px rgba(0,0,0,.12);
}

/* =========================
   FOOTER
========================= */
footer{
  text-align:center;
  margin-top:18px;
  padding-top:10px;
  color:rgba(0,0,0,.65);
  font-size:13px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1020px){
  .buscador{ flex-wrap:wrap; }
  #buscar{ flex:1 1 100%; max-width:100%; }
}

@media (max-width: 920px){
  body{ padding:14px 0; }
  .contenedor-premium{ padding:18px 16px 14px; }
  .logo{ height:95px; }
  .tarifas-img{ height:105px; }
  .titulo-centrado{ font-size:34px; }
}