/* ==========================================================================
   ESTRUCTURA GENERAL Y IDENTIDAD CORPORATIVA NEXGUARD INDUSTRIAL SAFETY
   ========================================================================== */
.cib2b-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    color: #1e293b;
    padding-bottom: 80px;
}

.cib2b-brand-header {
    display: flex;
    align-items: center;
    gap: 22px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-top: 5px solid #042f62;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(4, 47, 98, 0.06);
    flex-wrap: wrap;
}

.cib2b-brand-logo-wrap {
    flex-shrink: 0;
}

.cib2b-header-logo {
    max-height: 72px;
    width: auto;
    display: block;
}

.cib2b-brand-info {
    flex: 1;
    min-width: 260px;
}

.cib2b-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #042f62;
}

.cib2b-legal-line {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #334155;
}

.cib2b-address-line {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

.cib2b-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.cib2b-card h2 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #489f19;
    color: #042f62;
}

/* ==========================================================================
   FORMULARIOS Y CUADRÍCULAS (GRIDS)
   ========================================================================== */
.cib2b-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cib2b-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.cib2b-col-span-2 { grid-column: span 2; }

.cib2b-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    position: relative;
}

.cib2b-form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    color: #1e293b;
}

.cib2b-form-group .req { color: #dc2626; }

.cib2b-form-control {
    width: 100% !important;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid #94a3b8;
    border-radius: 5px;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    min-height: 40px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cib2b-form-control:focus {
    border-color: #042f62;
    outline: none;
    box-shadow: 0 0 0 2px rgba(4, 47, 98, 0.15);
}

.cib2b-radio-group {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    margin-bottom: 20px;
}

.cib2b-radio-label {
    margin-right: 22px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #042f62;
}

/* ==========================================================================
   BARRA DE BÚSQUEDA Y CARGA MASIVA
   ========================================================================== */
.cib2b-search-toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cib2b-search-box { flex: 2; min-width: 250px; position: relative; }
.cib2b-massive-box { flex: 1; display: flex; gap: 10px; min-width: 300px; }

.cib2b-btn-action {
    background: #042f62;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.cib2b-btn-action:hover { background: #489f19; }

.cib2b-dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(4, 47, 98, 0.12);
    display: none;
    margin-top: 4px;
}

.cib2b-dropdown-results ul { list-style: none; margin: 0; padding: 0; }
.cib2b-dropdown-results li { padding: 10px 15px; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 13px; }
.cib2b-dropdown-results li:hover { background: #f0fdf4; color: #042f62; }

/* ==========================================================================
   TABLA Y TOTALES
   ========================================================================== */
.cib2b-table-container { overflow-x: auto; margin-bottom: 20px; border: 1px solid #cbd5e1; border-radius: 6px; }
.cib2b-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.cib2b-table th { background: #042f62; color: #ffffff; padding: 12px; text-align: left; font-weight: 600; font-size: 13px; }
.cib2b-table td { padding: 12px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }

.btn-eliminar-item {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 4px 9px;
    font-weight: 700;
    cursor: pointer;
}
.btn-eliminar-item:hover { background: #dc2626; color: #ffffff; }

.cib2b-totals-wrapper { display: flex; justify-content: flex-end; }
.cib2b-totals-box { background: #f8fafc; padding: 20px; border-radius: 8px; width: 100%; max-width: 360px; border: 1px solid #cbd5e1; }
.cib2b-total-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.cib2b-grand-total { font-size: 18px; font-weight: 700; color: #042f62; border-top: 2px solid #489f19; padding-top: 10px; margin-top: 10px; }

.cib2b-submit-area { text-align: center; margin-top: 24px; }
.cib2b-btn-primary {
    background: #489f19;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(72, 159, 25, 0.25);
    transition: background 0.2s, transform 0.15s;
}
.cib2b-btn-primary:hover { background: #042f62; transform: translateY(-1px); }

@media (max-width: 768px) {
    .cib2b-grid-2, .cib2b-grid-4 { grid-template-columns: 1fr; }
    .cib2b-col-span-2 { grid-column: span 1; }
}
