/* ============================================
   RESET BASE
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* ============================================
   BODY
============================================ */
body {
    background: #7A8E27;
    padding: 30px 0;
}

/* ============================================
   CONTENEDOR PRINCIPAL
============================================ */
.contenedor-premium {
    background: white;
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 24px;
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(0,0,0,0.25);
}

/* ============================================
   HEADER
============================================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.logo {
    height: 120px;
}

.tarifas-img {
    height: 150px;
    object-fit: contain;
}

/* ============================================
   TÍTULO
============================================ */
.titulo-centrado {
    text-align: center;
    margin-bottom: 30px;
    font-size: 36px;
    font-weight: bold;
}

/* ============================================
   SISTEMAS
============================================ */
#categorias {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

#categorias .categoria {
    padding: 12px 28px;
    font-size: 18px;
    background: #e8e8e8;
    border-radius: 10px;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: 0.2s;
}

#categorias .categoria.activa {
    background: #B8C320;
    border-color: #B8C320;
    color: white;
}

/* ============================================
   SUBCATEGORÍAS
============================================ */
#subcategorias {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

#subcategorias button {
    padding: 8px 20px;
    background: #f4f4f4;
    border: 1px solid #888;
    border-radius: 8px;
    cursor: pointer;
}

#subcategorias button.activa {
    background: #007bff;
    color: white;
    border-color: #0056c7;
}

/* ============================================
   BUSCADOR (BLINDADO)
============================================ */
.buscador {
    display: grid;
    grid-template-columns:
        2fr
        0.6fr
        0.6fr
        0.6fr
        0.8fr
        auto
        auto
        auto;
    gap: 8px;
    align-items: center;
}

.buscador input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.buscador input[type="number"],
#dtoTotal {
    max-width: 90px;
    text-align: center;
}

/* Botones buscador */
.buscador button {
    background: #B8C320;
    border: none;
    color: white;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.buscador button:hover {
    filter: brightness(1.1);
}

/* ============================================
   TABLAS BASE
============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

/* ============================================
   TABLA TARIFA
============================================ */
#tabla-tarifa {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
}

#tabla-tarifa th {
    background: #B8C320;
    color: white;
    font-weight: bold;
    padding: 10px 5px;
    position: sticky;
    top: 0;
    z-index: 5;
    text-align: center;
}

#tabla-tarifa td {
    padding: 12px 5px;
    font-size: 15px;
    border-bottom: 1px solid #e5e5e5;
}

#tabla-tarifa tr:hover {
    background: #fafafa;
}

/* Columnas */
#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;
    padding-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#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;
}

#tabla-tarifa th:nth-child(5),
#tabla-tarifa td:nth-child(5) {
    width: 12%;
    text-align: center;
}

/* Botón añadir */
.btnAdd {
    background: #B8C320;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

/* ============================================
   PRESUPUESTO
============================================ */
#presupuesto-container {
    max-height: 450px;
    overflow: auto;
    padding-right: 8px;
    margin-top: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
}

#presupuesto-container table {
    min-width: 1100px;
}

#presupuesto-container th,
#presupuesto-container td {
    white-space: nowrap;
}

/* Botones presupuesto */
#volverPresupuesto,
#portesBtn,
#observacionesBtn,
#lineaManualBtn {
    background: #B8C320;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

#borrarPresupuesto {
    background: #d40000;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================
   FOOTER
============================================ */
footer {
    margin-top: 25px;
    text-align: left;
    color: #333;
    font-size: 14px;
}

/* ============================================
   TOAST
============================================ */
#toastOferta {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f1f1f;
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    display: none;
    z-index: 9999;
}
/* ============================================
   BOTÓN ELIMINAR LÍNEA (ROJO + CENTRADO)
============================================ */
#presupuesto-container td:last-child {
    text-align: center;
}

.btnDelete {
    background-color: #d40000;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btnDelete:hover {
    background-color: #a00000;
}
/* ============================================
   RESALTADO BÚSQUEDA
============================================ */
.resaltadoABN {
    background: #B8C320;
    color: white;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: bold;
}
