/**
 * Fichier CSS principal du plugin
 *
 * @package Calculateur_Prix_Avance
 */

/* Variables CSS */
:root {
    --bs-primary: #263780; 
    --bs-primary-rgb: 38, 55, 128; 
    --bs-secondary: #f8fafc;
    --bs-success: #10b981; 
    --bs-danger: #ef4444; 
    --bs-warning: #f59e0b;
    --bs-info: #3b82f6; 
    --light-border: #e2e8f0; 
    --text: #1e293b;
    --text-light: #64748b; 
    --bs-body-bg: #f8fafc; 
    --card-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --bs-danger-rgb: 239, 68, 68;
}

/* Style pour l'icône Premium */
.premium-icon {
    margin-right: 6px;
    color: #f59e0b;
    font-size: 0.9em;
}

/* Styles pour les boutons/liens premium désactivés */
.btn-premium-disabled,
.cpa-action-link.disabled {
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    color: #adb5bd !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

.btn-premium-disabled:hover,
.cpa-action-link.disabled:hover {
    background-color: #f8f9fa !important;
    color: #adb5bd !important;
    border-color: #e9ecef !important;
}

.cpa-action-link.disabled i {
    color: #adb5bd !important;
}

.cpa-action-link.disabled .premium-icon {
    color: #f59e0b !important; /* Garde la couleur de la couronne */
}

.cpa-upgrade-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--bs-primary);
}
.cpa-upgrade-link:hover {
    text-decoration: underline;
    color: #1e2a61;
}

.cpa-action-link-upsell {
    background-color: #fffaf0;
    border: 1px solid #fde68a;
}
.cpa-action-link-upsell:hover {
    background-color: #fef3c7 !important;
    border-color: #fcd34d !important;
}
.cpa-action-link-upsell span {
    color: #92400e;
}


/* Styles généraux */
.calculateur-prix-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background-color: var(--bs-body-bg); 
    color: var(--text); 
    line-height: 1.6; 
    padding-bottom: 100px;
}

.calculateur-prix-container .card { 
    border-radius: 12px; 
    box-shadow: var(--shadow); 
    border: none; 
    margin-bottom: 1.5rem; 
    background-color: var(--card-bg);
}

/* Styles pour les infobulles */
.cpa-tooltip-icon {
    margin-left: 8px;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9em;
}

.tooltip-inner {
    background-color: #334155;
    color: #f1f5f9;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    max-width: 300px;
    text-align: left;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #334155;
}


/* Navigation par onglets */
.calculateur-prix-container .nav-tabs { 
    border-bottom: 1px solid var(--light-border);
    flex-wrap: wrap;
}

.calculateur-prix-container .nav-tabs .nav-link { 
    border: none; 
    color: var(--text-light); 
    font-weight: 500; 
    padding: 0.75rem 1.25rem; 
    border-top-left-radius: 0.5rem; 
    border-top-right-radius: 0.5rem;
    margin-bottom: -1px;
    margin-right: 4px;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.calculateur-prix-container .nav-tabs .nav-link:not(.active):hover {
    color: var(--bs-primary);
    background-color: #f8f9fa;
}

.calculateur-prix-container .nav-tabs .nav-link.active { 
    color: var(--bs-primary); 
    background-color: var(--card-bg); 
    border: 1px solid var(--light-border); 
    border-bottom: none; 
    font-weight: 600;
}

.calculateur-prix-container .tab-content { 
    padding: 1.5rem;
}

/* Formulaires */
.calculateur-prix-container .form-label { 
    font-weight: 500; 
    margin-bottom: 0.5rem; 
    color: var(--text); 
    font-size: 0.9rem;
}

.calculateur-prix-container .form-label-sm { 
    font-size: 0.8rem; 
    margin-bottom: 0.25rem;
}

.calculateur-prix-container .form-control, 
.calculateur-prix-container .form-select, 
.calculateur-prix-container .input-group-text { 
    border-radius: 8px; 
    border: 1px solid var(--light-border); 
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.calculateur-prix-container .form-control-sm, 
.calculateur-prix-container .form-select-sm { 
    font-size: 0.875rem; 
    border-radius: 6px;
}

.calculateur-prix-container .input-group .form-control { 
    border-right: 0;
}

.calculateur-prix-container .input-group .form-control:focus { 
    z-index: 3;
}

.calculateur-prix-container .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) { 
    margin-left: -1px; 
    border-top-left-radius: 0; 
    border-bottom-left-radius: 0;
}

.calculateur-prix-container .input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) { 
    border-top-right-radius: 0; 
    border-bottom-right-radius: 0;
}

.calculateur-prix-container .input-group .input-group-text { 
    background-color: var(--bs-body-bg); 
    color: var(--text-light);
    font-weight: 500;
}

.calculateur-prix-container .form-control:focus, 
.calculateur-prix-container .form-select:focus { 
    border-color: var(--bs-primary); 
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25); 
    outline: none;
}

.calculateur-prix-container .form-control:disabled, 
.calculateur-prix-container .form-control[readonly] { 
    background-color: #e9ecef;
    opacity: 1;
}

.calculateur-prix-container .form-text { 
    font-size: 0.8rem; 
    color: var(--text-light);
}

.cpa-form-section {
    background-color: #f7f7f9;
    border: 1px solid var(--light-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.cpa-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--light-border);
    display: flex;
    align-items: center;
}

.cpa-section-title i {
    color: var(--bs-primary);
}

.cpa-switch-box {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid var(--light-border);
    transition: all 0.2s ease;
    cursor: pointer;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    padding-right: 0.75rem;
}
.cpa-switch-box:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}
.cpa-switch-box .form-check-label {
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
}

/* Boutons */
.calculateur-prix-container .btn { 
    border-radius: 8px; 
    font-weight: 500; 
    transition: all 0.2s ease; 
    padding: 0.5rem 1rem;
}

.calculateur-prix-container .btn-sm { 
    padding: 0.3rem 0.75rem; 
    font-size: 0.875rem; 
    border-radius: 6px;
}

.calculateur-prix-container .btn-primary { 
    background-color: var(--bs-primary); 
    border-color: var(--bs-primary); 
    color: white;
}

.calculateur-prix-container .btn-primary:hover { 
    background-color: #1e2a61; 
    border-color: #1e2a61;
}

.calculateur-prix-container .btn-success { 
    background-color: var(--bs-success); 
    border-color: var(--bs-success); 
    color: white;
}

.calculateur-prix-container .btn-success:hover { 
    background-color: #0f9b6b; 
    border-color: #0f9b6b;
}

/* Tableaux */
.calculateur-prix-container .table th { 
    font-weight: 600; 
    background: var(--bs-primary); 
    color: white; 
    font-size: 0.85rem; 
    padding: 0.75rem; 
    text-align: left; 
    vertical-align: middle; 
    white-space: nowrap;
}

.calculateur-prix-container .table td { 
    vertical-align: middle; 
    font-size: 0.9rem; 
    padding: 0.6rem 0.75rem;
}

.calculateur-prix-container .table td.text-end { 
    text-align: right;
}

.calculateur-prix-container .table-hover tbody tr:hover { 
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.calculateur-prix-container .table-striped > tbody > tr:nth-of-type(odd) > * { 
    --bs-table-accent-bg: rgba(var(--bs-primary-rgb), 0.02);
}

/* Éléments spécifiques */
.calculateur-prix-container .profit-positive { 
    color: var(--bs-success); 
    font-weight: 600;
}

.calculateur-prix-container .profit-negative { 
    color: var(--bs-danger); 
    font-weight: 600;
}

.calculateur-prix-container .text-success { 
    color: var(--bs-success) !important;
}

.calculateur-prix-container .text-danger { 
    color: var(--bs-danger) !important;
}

/* Validation */
.calculateur-prix-container .form-control.is-invalid, 
.calculateur-prix-container .form-select.is-invalid { 
    border-color: var(--bs-danger);
}

.calculateur-prix-container .form-control.is-invalid:focus, 
.calculateur-prix-container .form-select.is-invalid:focus { 
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-danger-rgb), 0.25);
}

.calculateur-prix-container .invalid-feedback { 
    color: var(--bs-danger); 
    font-size: 0.8rem; 
    display: none; 
    width: 100%; 
    margin-top: 0.25rem;
}

.calculateur-prix-container .is-invalid ~ .invalid-feedback, 
.calculateur-prix-container .is-invalid + .input-group ~ .invalid-feedback { 
    display: block;
}

/* Style pour l'onglet avec erreur */
.calculateur-prix-container .nav-link.has-error {
    background-color: #f8d7da !important;
    color: #842029 !important;
    border-color: #f5c2c7 !important;
    animation: pulse-error 0.5s ease-in-out;
}

.calculateur-prix-container .nav-link.has-error::after {
    content: ' \f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 5px;
    font-size: 0.8em;
}

@keyframes pulse-error {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* =================================================================== */
/* STYLES POUR LE NOUVEAU TABLEAU DE BORD MACHINES (GRID)           */
/* =================================================================== */

.cpa-machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cpa-machine-card {
    background-color: var(--card-bg, #ffffff);
    border-radius: 12px;
    box-shadow: var(--shadow, 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06));
    border: 1px solid var(--light-border, #e2e8f0);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
}

.cpa-machine-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05));
}

.cpa-machine-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.cpa-machine-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cpa-machine-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    margin: 0;
}

.cpa-machine-card-id {
    font-size: 0.8rem;
    color: var(--text-light, #64748b);
    font-family: monospace;
}

.cpa-machine-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9rem;
    border-top: 1px solid var(--light-border, #e2e8f0);
    padding-top: 1rem;
}

.cpa-machine-data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cpa-machine-data-item span {
    color: var(--text-light, #64748b);
}

.cpa-machine-data-item strong {
    color: var(--text, #1e293b);
    font-weight: 500;
}

.cpa-machine-card-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-border, #e2e8f0);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-light-primary { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--bs-primary); border: none; }
.btn-light-primary:hover { background-color: rgba(var(--bs-primary-rgb), 0.2); color: var(--bs-primary); }
.btn-light-info { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; border: none; }
.btn-light-info:hover { background-color: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.btn-light-danger { background-color: rgba(var(--bs-danger-rgb), 0.1); color: var(--bs-danger); border: none; }
.btn-light-danger:hover { background-color: rgba(var(--bs-danger-rgb), 0.2); color: var(--bs-danger); }

/* Carte "Ajouter une machine" */
.cpa-add-machine-card {
    border: 2px dashed var(--light-border, #e2e8f0);
    background-color: transparent;
    box-shadow: none;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.cpa-add-machine-card:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    transform: translateY(0);
}

.cpa-add-machine-content {
    text-align: center;
}

.cpa-add-machine-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--bs-body-bg);
    border: 2px dashed var(--light-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    font-size: 2rem;
    color: var(--text-light, #64748b);
    transition: all 0.2s ease-in-out;
}

.cpa-add-machine-card:hover .cpa-add-machine-icon {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.cpa-add-machine-content p {
    font-weight: 500;
    color: var(--text-light);
    margin: 0;
}
.cpa-add-machine-card:hover .cpa-add-machine-content p {
    color: var(--bs-primary);
}

/* Carte d'incitation Premium */
.cpa-upgrade-card {
    background-color: #fff8e1;
    border: 2px dashed #f59e0b;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}
.cpa-upgrade-card-icon {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 1rem;
}
.cpa-upgrade-card h6 {
    font-weight: 600;
    color: #b45309;
}
.cpa-upgrade-card p {
    color: #78350f;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* =================================================================== */
/* STYLES POUR LE TABLEAU DE BORD GÉNÉRAL (Version 2)               */
/* =================================================================== */

.cpa-dashboard-main .card {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* Nouvelles cartes de stats horizontales */
.cpa-stat-card-h {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--card-bg, #ffffff);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--light-border);
    height: 100%;
}

.cpa-stat-card-h-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background-color: var(--icon-bg);
    color: var(--icon-color);
}

.cpa-stat-card-h-title {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.1rem;
    font-weight: 500;
}

.cpa-stat-card-h-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

/* Nouvelle liste d'actions rapides */
.cpa-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cpa-action-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border: 1px solid var(--light-border);
    color: var(--text);
    background-color: #fff;
}
.cpa-action-link:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    color: var(--bs-primary);
}

.cpa-action-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.cpa-action-link-primary {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}
.cpa-action-link-primary:hover {
    background-color: #1e2a61;
    color: #fff;
    border-color: #1e2a61;
}

/* Nouvelle liste de produits récents */
.cpa-recent-products-list.list-group {
    margin: -0.75rem;
}

.cpa-recent-products-list .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--light-border) !important;
}
.cpa-recent-products-list .list-group-item:last-child {
    border-bottom: none !important;
}

.cpa-recent-edit-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.cpa-recent-edit-link:hover {
    color: var(--bs-primary);
}

/* =================================================================== */
/* STYLES POUR LE TABLEAU DE BORD DES VENTES                          */
/* =================================================================== */

#salesTable th.sortable {
    cursor: pointer;
    user-select: none;
}
#salesTable th.sortable:hover {
    background-color: #1e2a61;
}
#salesTable th.sortable i {
    margin-left: 5px;
    color: rgba(255,255,255,0.7);
}

.cpa-stat-card-h-value.fs-6 {
    font-size: 1.1rem !important;
}

#salesTable .badge {
    font-size: 0.8em;
    padding: 0.3em 0.5em;
    vertical-align: middle;
}
/* =================================================================== */
/* STYLES POUR LE TABLEAU DE BORD D'AMORTISSEMENT                     */
/* =================================================================== */

.cpa-amortization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.cpa-amortization-card {
    background-color: #fff;
    border: 1px solid var(--light-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.cpa-amortization-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--light-border);
    margin: 0;
}

.cpa-amortization-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.cpa-amortization-data-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.cpa-amortization-data-item span {
    color: var(--text-light);
}

.cpa-amortization-data-item strong {
    font-weight: 500;
}

.cpa-amortization-card-footer {
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-top: 1px solid var(--light-border);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.progress-bar {
    background-color: var(--bs-primary);
    font-weight: 500;
}
/* =================================================================== */
/* STYLES POUR LE TITRE DE PAGE PERSONNALISÉ                          */
/* =================================================================== */

.cpa-page-title-container {
    text-align: center;
    margin-top: 0; /* Supprime la marge du dessus */
    margin-bottom: 2rem; /* Conserve un espacement en dessous */
}

.cpa-page-title-container h2 {
    margin: 0; /* Réinitialise les marges par défaut du titre h2 */
    font-weight: 600;
    color: var(--text);
}


/* =================================================================== */
/* STYLES POUR LA NOUVELLE MODALE DE PRÉVISUALISATION (UX/UI)        */
/* =================================================================== */

.cpa-preview-modal-body .row {
    --bs-gutter-x: 2rem;
}

.cpa-preview-col {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    border-right: 1px solid var(--light-border);
}

.cpa-preview-col:last-child {
    border-right: none;
}

.cpa-preview-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bs-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
}

.cpa-preview-title i {
    margin-right: 0.5rem;
}

.cpa-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.cpa-preview-item span:first-child {
    color: var(--text-light);
}

.cpa-preview-item span:last-child {
    font-weight: 500;
    color: var(--text);
}

.cpa-preview-item.is-plus span:last-child {
    color: var(--bs-success);
}

.cpa-preview-item.is-minus span:last-child {
    color: var(--bs-danger);
}

.cpa-preview-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 0.75rem 0;
    border-top: 2px solid var(--light-border);
    border-bottom: 1px solid #f1f5f9;
    margin-top: 0.5rem;
    font-weight: 600;
}

.cpa-preview-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--light-border);
    color: var(--bs-primary);
}

.cpa-preview-total.final-profit {
    font-size: 1.25rem;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border-top: none;
}

.cpa-preview-total.final-profit.text-success {
    background-color: rgba(16, 185, 129, 0.05);
    color: #065f46;
}
.cpa-preview-total.final-profit.text-danger {
    background-color: rgba(239, 68, 68, 0.05);
    color: #991b1b;
}

@media (max-width: 767.98px) {
    .cpa-preview-col {
        border-right: none;
        border-bottom: 1px solid var(--light-border);
    }
    .cpa-preview-col:last-child {
        border-bottom: none;
    }
}


/* =================================================================== */
/* CORRECTIF AFFICHAGE BOUTONS PREMIUM (VERSION GRATUITE)           */
/* =================================================================== */

/* 1. On prépare le bouton pour positionner l'icône de couronne par-dessus */
.actions-cell .btn-premium-disabled {
    position: relative;
    /* On ajoute un peu d'espace à gauche pour l'icône principale, 
       afin qu'elle ne soit pas cachée par la couronne */
    padding-left: 1.4rem !important;
}

/* 2. On positionne la couronne en absolu pour qu'elle ne prenne plus de place */
.actions-cell .btn-premium-disabled .premium-icon {
    position: absolute;
    left: 0.5rem; /* Position à gauche du bouton */
    top: 50%;
    transform: translateY(-50%); /* Centrage vertical parfait */
    margin-right: 0; /* On annule la marge qui causait le décalage */
    font-size: 0.75em; /* On la rend un peu plus discrète */
}

/* =================================================================== */
/* CORRECTIF AFFICHAGE PRIX SUR DEUX LIGNES                         */
/* =================================================================== */
#productsTable td:nth-child(4),
#productsTable td:nth-child(5),
#productsTable td:nth-child(6),
#productsTable td:nth-child(7) {
    white-space: nowrap;
}


/* =================================================================== */
/* BLOC RESPONSIVE (AFFICHAGE SUR MOBILE)                           */
/* =================================================================== */
@media (max-width: 991.98px) {
    .calculateur-prix-container .table-responsive { 
        overflow-x: hidden;
    }
    
    .calculateur-prix-container .table thead { 
        display: none;
    }
    
    .calculateur-prix-container .table, 
    .calculateur-prix-container .table tbody, 
    .calculateur-prix-container .table tr.product-display-row,
    .calculateur-prix-container .table tr.machine-row,
    .calculateur-prix-container .table td { 
        display: block; 
        width: 100% !important;
    }
    
    .calculateur-prix-container .table tr.product-display-row,
    .calculateur-prix-container .table tr.machine-row {
        margin-bottom: 1.5rem; 
        border: 1px solid var(--light-border); 
        border-radius: 0.75rem; 
        padding: 0;
        background-color: var(--card-bg); 
        box-shadow: var(--shadow);
        overflow: hidden;
    }
    
    #productsTable tr.product-edit-row { 
        display: none;
    }
    
    .calculateur-prix-container .table td { 
        text-align: right; 
        position: relative; 
        border-bottom: 1px dashed var(--light-border); 
        padding: 0.75rem 1rem;
        min-height: 42px;
        display: flex; 
        align-items: center; 
        justify-content: flex-end;
    }
    
    .calculateur-prix-container .table tr > td:last-of-type { 
        border-bottom: none;
    }
    
    .calculateur-prix-container .table td[data-label]::before { 
        content: attr(data-label); 
        position: absolute; 
        left: 1rem;
        width: auto; 
        padding-right: 1rem; 
        white-space: nowrap; 
        text-align: left; 
        font-weight: bold; 
        color: var(--text-light); 
        font-size: 0.85em;
    }
    
    .calculateur-prix-container .table td.product-name-cell,
    .calculateur-prix-container .table td.machine-name-cell {
        padding-top: 1rem;
        padding-bottom: 1rem;
        text-align: left; 
        font-weight: 600; 
        font-size: 1.1em; 
        background-color: rgba(var(--bs-primary-rgb), 0.05);
        border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.1);
        justify-content: flex-start; 
        min-height: 0;
    }
    
    .calculateur-prix-container .table td.product-name-cell::before,
    .calculateur-prix-container .table td.machine-name-cell::before {
        content: none;
    }
    
    .calculateur-prix-container .table td.actions-cell { 
        background-color: #f8f9fa;
        justify-content: center; 
    }
    
    .calculateur-prix-container .table td.actions-cell::before { 
        content: none;
    }
    
    .calculateur-prix-container .table td.actions-cell .btn-group { 
        width: 100%; 
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .calculateur-prix-container .table td.actions-cell .btn-group .btn { 
        flex-grow: 1; 
        font-size: 0.8rem;
        flex-basis: 70px;
    }
    
    .calculateur-prix-container .table td.actions-cell .btn i { 
        margin-right: 0.3rem;
    }

    .calculateur-prix-container .material-item .row,
    .calculateur-prix-container .consumable-item .row {
        gap: 0.75rem 0;
    }

    .calculateur-prix-container .material-item .remove-item-btn,
    .calculateur-prix-container .consumable-item .remove-item-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calculateur-prix-container .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    h2 {
        font-size: 1.5rem;
    }
    
    .calculateur-prix-container .table td.actions-cell .btn-group .btn span {
        display: none;
    }
    .calculateur-prix-container .table td.actions-cell .btn i {
        margin-right: 0;
    }

    .tab-content .row > [class^="col-"] {
        margin-bottom: 1rem;
    }
    .tab-content .row > [class^="col-"]:last-child {
        margin-bottom: 0;
    }
}
/* =================================================================== */
/* BANDEAU D'ESSAI PERSISTANT                                       */
/* =================================================================== */
.cpa-trial-banner-container {
    /* Garde le bandeau en haut de la page */
    position: sticky;
    top: 0; 
    z-index: 1050; /* Au-dessus de la plupart des éléments, mais en dessous des modales (1055+) */
    background-color: #263780; /* Couleur de fond (votre --bs-primary) */
    color: #ffffff;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.cpa-trial-banner {
    max-width: 1200px; /* S'aligne avec votre contenu principal */
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: 500;
}
.cpa-trial-banner span {
    margin-right: 1.5rem;
}
.cpa-trial-banner a {
    color: #ffffff;
    background-color: #f59e0b; /* Bouton "premium" (votre --bs-warning) */
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.cpa-trial-banner a:hover {
    background-color: #ffffff;
    color: #263780;
}

/* Si la barre admin WP est présente, on décale le bandeau vers le bas */
.admin-bar .cpa-trial-banner-container {
    top: 32px; /* Hauteur de la barre admin */
}
@media screen and (max-width: 782px) {
    .admin-bar .cpa-trial-banner-container {
        top: 46px; /* Hauteur de la barre admin sur mobile */
    }
}
@media screen and (max-width: 600px) {
    .cpa-trial-banner {
        flex-direction: column;
        gap: 0.5rem;
    }
    .cpa-trial-banner span {
        margin-right: 0;
    }
}