/* Frontend - Listado de Precios Interdiagnóstico */
.idp-frontend-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 1100px; margin: 20px auto; padding: 0 15px; }
.idp-frontend-wrap h3 { font-size: 16px; margin: 0 0 10px; color: #333; }

.idp-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; border-bottom: 2px solid #e1e1e1; padding-bottom: 10px; }

/* Pestañas normales: gris/neutro */
.idp-tab-btn:not(.idp-tab-proforma) {
    background: transparent;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}
.idp-tab-btn:not(.idp-tab-proforma):hover { background: #f5f5f5; color: #333; }
.idp-tab-btn:not(.idp-tab-proforma).active {
    background: #e1e1e1;
    border-color: #bbb;
    color: #333;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

/* Pestaña PROFORMA: azul */
.idp-tab-proforma {
    background: #0073aa;
    border: 1px solid #0073aa;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s;
}
.idp-tab-proforma:hover { background: #005f8d; border-color: #005f8d; }
.idp-tab-proforma.active {
    background: #005f8d;
    border-color: #005f8d;
    color: #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

.idp-tab-content { display: none; animation: fadeIn 0.3s; }
.idp-tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.idp-tab-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.idp-tab-header input.idp-filtro {
    padding: 8px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    font-size: 14px;
    min-width: 260px;
    outline: none;
}
.idp-tab-header input.idp-filtro:focus { border-color: #0073aa; }

.idp-frontend-tabla { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.idp-frontend-tabla th, .idp-frontend-tabla td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
.idp-frontend-tabla th { background: #f8f9fa; font-weight: 700; color: #444; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
.idp-frontend-tabla tr:nth-child(even) { background: #fbfcfd; }
.idp-frontend-tabla tr:hover { background: #f1f7fb; }
.idp-frontend-tabla td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
    .idp-frontend-tabla, .idp-frontend-tabla thead, .idp-frontend-tabla tbody, .idp-frontend-tabla tr, .idp-frontend-tabla td { display: block; }
    .idp-frontend-tabla thead tr { position: absolute; top: -9999px; left: -9999px; }
    .idp-frontend-tabla tr { margin-bottom: 12px; border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
    .idp-frontend-tabla td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50%; }
    .idp-frontend-tabla td:before {
        content: attr(data-label);
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-weight: 700;
        font-size: 12px;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        width: 45%;
        text-align: left;
    }
    .idp-frontend-tabla td:last-child { border-bottom: 0; text-align: left; }
}

/* Botón Agregar */
.idp-btn-agregar {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}
.idp-btn-agregar:hover { background: #005f8d; }
.idp-btn-agregar:active { transform: scale(0.96); }

/* Botón Quitar en proforma */
.idp-btn-quitar {
    background: #d63636;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}
.idp-btn-quitar:hover { background: #b32828; }

/* Pestaña PROFORMA (azul como las demás) */
.idp-tab-proforma {
    background: transparent;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}
.idp-tab-proforma:hover {
    background: #f5f5f5;
    color: #333;
}
.idp-tab-proforma.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    border-bottom: 2px solid #0073aa;
    margin-bottom: -2px;
}

/* Notificación de producto agregado */
.idp-proforma-notificacion {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Tabla Proforma */
.idp-tabla-proforma tfoot td {
    font-weight: 700;
    background: #f1f7fb;
    border-top: 2px solid #0073aa;
}

.idp-btn-limpiar-proforma {
    background: #d63636;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
}
.idp-btn-limpiar-proforma:hover { background: #b32828; }

.idp-btn-enviar-proforma {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.idp-btn-enviar-proforma:hover { background: #005f8d; }
.idp-btn-enviar-proforma:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
}

.idp-proforma-acciones button {
    margin-left: 5px;
}
