/* ============================================
   ERP - Styles Globaux (extraction refactoring)
   ============================================ */

/* --- RESET & BASE --- */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: #333; line-height: 1.5; }
a { text-decoration: none; color: inherit; }

/* Corps avec sidebar (pages ERP incluant navbar.php) */
body:has(.sidebar) {
    margin-left: 250px !important;
    margin-top: 80px;
    padding: 20px;
    background-color: #f0f2f5;
}

/* --- SIDEBAR (navbar.php) --- */
.sidebar {
    height: 100vh;
    width: 250px;
    position: fixed;
    top: 0; left: 0;
    background-color: #2c3e50;
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}
.sidebar-content { flex: 1; overflow-y: auto; padding-top: 10px; }
.sidebar-footer { padding: 15px 0; background-color: #1a252f; border-top: 1px solid #34495e; }
.sidebar-brand {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #34495e;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    background: #253342;
}
.nav-logo-img { max-width: 200px; max-height: 60px; width: auto; height: auto; object-fit: contain; }
.nav-text-brand { font-size: 1.4em; font-weight: bold; color: #ecf0f1; letter-spacing: 1px; }
.sidebar a {
    padding: 12px 20px;
    text-decoration: none;
    font-size: 15px;
    color: #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s;
    border-left: 4px solid transparent;
}
.sidebar a:hover { color: white; background-color: #34495e; border-left: 4px solid #3498db; }
.sidebar-section-title {
    color: #7f8c8d;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: bold;
    padding: 20px 20px 10px 20px;
    letter-spacing: 1px;
}
.badge-notif { font-size: 0.75em; padding: 2px 8px; border-radius: 10px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.bg-red { background-color: #e74c3c; color: white; }
.bg-blue { background-color: #3498db; color: white; }
.bg-orange { background-color: #f39c12; color: white; }
.btn-logout { color: #e74c3c !important; }
.btn-logout:hover { background-color: #c0392b !important; color: white !important; }
.sidebar-submenu { padding-left: 20px; }
.sidebar-submenu a { padding: 10px 20px 10px 35px; font-size: 14px; border-left: 3px solid transparent; }
.sidebar-submenu a:hover { border-left: 3px solid #3498db; }
.sidebar-content::-webkit-scrollbar { width: 5px; }
.sidebar-content::-webkit-scrollbar-thumb { background: #455a64; border-radius: 10px; }

/* --- TOP BAR (barre fixe sous la nav) --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    height: 70px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.bar-left { display: flex; align-items: center; gap: 15px; }
.bar-right { display: flex; align-items: center; gap: 20px; }

/* --- SEARCH BOX --- */
.search-box { position: relative; width: 300px; }
.search-box input {
    width: 100%;
    padding: 8px 15px 8px 30px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    outline: none;
}
.search-box input:focus { background: white; border-color: #007bff; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #999; font-size: 0.8em; }

/* --- BOUTONS --- */
.btn-action {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-new {
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    white-space: nowrap;
    background: #28a745;
    color: white;
    border: none;
}
.btn-new:hover { background: #218838; color: white; }
.top-bar .action-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-google { background: white; color: #444; border: 1px solid #ddd; }
.btn-google:hover { background: #f1f1f1; }
.btn-toggle {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #555;
    white-space: nowrap;
}
.btn-toggle:hover { background: #e2e6ea; }
.btn-toggle.active { background: #6c757d; color: white; border-color: #6c757d; }
.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 15px;
    background-color: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    transition: 0.2s;
}
.btn-view:hover { background-color: #bbdefb; transform: translateY(-1px); }
.btn-back { text-decoration: none; padding: 8px 15px; border-radius: 20px; font-weight: bold; font-size: 0.9em; background: #eee; color: #555; transition: 0.2s; border: 1px solid #ddd; display: flex; align-items: center; gap: 5px; }
.btn-back:hover { background: #e2e6ea; color: #333; }

/* --- STATS WIDGET --- */
.stats-widget { display: flex; gap: 10px; }
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 15px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    background: #f8f9fa;
    border: 1px solid #eee;
}
.stat-item:hover { transform: translateY(-2px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.stat-item.active { background: #e8f0fe; border-color: #007bff; }
.stat-val { font-weight: bold; font-size: 1.1em; }
.stat-label { font-size: 0.7em; text-transform: uppercase; color: #666; }
.st-orange .stat-val { color: #fd7e14; }
.st-blue .stat-val { color: #007bff; }
.st-red .stat-val { color: #dc3545; }
.st-green .stat-val { color: #28a745; }
.st-grey .stat-val { color: #666; }
.st-indigo .stat-val { color: #6610f2; }

/* --- CONTAINER & CARD --- */
.container { max-width: 1400px; margin: 0 auto; }
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}

/* --- TABLES --- */
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background-color: #f8f9fa; color: #666; font-weight: 600; text-transform: uppercase; font-size: 0.85em; }
tr:hover { background-color: #fafafa; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { text-align: left; color: #888; font-size: 0.85em; text-transform: uppercase; padding-bottom: 10px; border-bottom: 2px solid #eee; }
.mini-table td { padding: 10px 0; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: none; }

/* --- BADGES --- */
.badge { padding: 4px 10px; border-radius: 12px; font-weight: bold; font-size: 0.8em; text-transform: uppercase; }
/* Rouge */
.bg-urg { background: #f8d7da; color: #721c24; }
.bg-NON_PAYE { background: #f8d7da; color: #dc3545; border: 1px solid #f5c6cb; }
/* Bleu */
.bg-new { background: #d1ecf1; color: #0c5460; }
.bg-EN_ATTENTE { background: #e7f1ff; color: #007bff; border: 1px solid #b8daff; }
.status-PRET { background: #cce5ff; color: #004085; }
.status-EN_COURS { background: #0d6efd; color: white; }
/* Vert */
.badge-VALIDE, .status-TERMINE { background: #d4edda; color: #28a745; }
.bg-PAYE { background: #d4edda; color: #28a745; border: 1px solid #c3e6cb; }
.bg-NOUVEAU { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
/* Orange/Jaune */
.bg-ECHEANCIER, .status-DEVIS { background: #fff3cd; color: #fd7e14; }
.bg-ECHEANCIER { border: 1px solid #ffeeba; }
.status-RECEPTION, .status-VALIDE { background: #ffe8cc; color: #e8590c; }
/* Gris */
.bg-ARCHIVE { background: #f8f9fa; color: #6c757d; border: 1px solid #dee2e6; }
.badge-BROUILLON { background: #e9ecef; color: #6c757d; }
.bg-TRAITE { background: #e2e3e5; color: #383d41; }
.status-EN_FACTURATION { background: #f8f9fa; color: #6c757d; }

/* --- MODAL --- */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; animation: fadeIn 0.2s; }
.modal-content {
    background: white;
    width: 600px;
    max-width: 95%;
    margin: 10% auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: visible;
}
.close-btn { position: absolute; top: 10px; right: 15px; font-size: 1.5em; cursor: pointer; color: #888; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- ACTION BAR --- */
.action-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.action-btn { text-decoration: none; padding: 4px 10px; border-radius: 4px; font-size: 0.8em; font-weight: bold; background: #eee; color: #555; transition: 0.2s; }
.action-btn:hover { background: #ddd; color: #333; }
.action-btn-danger { background: #fff; border: 1px solid #dc3545; color: #dc3545; cursor: pointer; padding: 6px 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 1em; }
.action-btn-danger:hover { background: #dc3545; color: white; }

/* --- ALERTS --- */
.alert { padding: 10px 15px; border-radius: 5px; margin-bottom: 20px; font-weight: bold; }
.alert.success, .alert-success { background: #d4edda; color: #155724; padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; }
.alert.error, .alert-error { background: #f8d7da; color: #721c24; padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; }
.alert.warning { background: #fff3cd; color: #856404; }

/* --- HEADER FICHE --- */
.header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.header.archived { background: #6c757d; }
.header-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

/* --- TABS --- */
.tabs { display: flex; background: #f8f9fa; border-bottom: 1px solid #ddd; padding: 0 20px; overflow-x: auto; }
.tab, .tab-btn { padding: 15px 25px; cursor: pointer; color: #666; font-weight: 600; border-bottom: 3px solid transparent; transition: 0.3s; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; }
.tab:hover, .tab-btn:hover { color: #007bff; background: #eee; }
.tab.active, .tab-btn.active { color: #007bff; border-bottom: 3px solid #007bff; background: white; }
.tab-content { display: none; padding: 30px; min-height: 200px; }
.tab-content.active { display: block; }

/* --- FORM --- */
.form-group { margin-bottom: 20px; }
.form-control { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; box-sizing: border-box; }
.form-control:focus { outline: none; border-color: #007bff; }
/* Labels de formulaires (regroupés) */
.form-group label, .row .col label, .main-card label, .form-produit label, .form-content label, .facture-libre-card label { display: block; font-weight: 600; margin-bottom: 8px; color: #333; }
.main-card label:first-child, .main-card form > label:first-child, .facture-libre-card label:first-child, .facture-libre-card form > label:first-child { margin-top: 0; }
.main-card form > label, .facture-libre-card form > label { margin-top: 18px; }
/* Champs de formulaires (regroupés – input file exclu pour main-card) */
.form-group input, .form-group select, .form-group textarea, .row .col input, .row .col select, .row .col textarea, .main-card input:not([type="file"]), .main-card select, .main-card textarea, .facture-libre-card input, .facture-libre-card select, .facture-libre-card textarea, .form-produit input, .form-produit select, .form-produit textarea, .form-content input, .form-content select, .form-content textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; box-sizing: border-box; }
.main-card input[type="file"] { padding-left: 0; border: none; }
.btn-primary { background: #007bff; color: white; border: none; padding: 12px 24px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 1em; }
.btn-primary:hover { background: #0056b3; }
.btn-small { text-decoration: none; font-size: 0.85em; padding: 4px 10px; border-radius: 4px; background: #eee; color: #333; font-weight: bold; cursor: pointer; }
.btn-small:hover { background: #ddd; }

/* --- FORMULAIRES DANS MODALES --- */
.modal-content label { display: block; font-weight: 600; margin-bottom: 6px; margin-top: 10px; color: #333; font-size: 0.9em; text-align: left; }
.modal-content input, .modal-content select, .modal-content textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 15px; box-sizing: border-box; font-size: 0.95em; }
.modal-content textarea { min-height: 80px; resize: vertical; }
.modal-content .btn-create { background: #28a745; color: white; border: none; padding: 12px 24px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 1em; width: 100%; margin-top: 15px; }
.modal-content .btn-create:hover { background: #218838; }
.modal-content .tabs { overflow-x: hidden; flex-wrap: wrap; padding-bottom: 0; }
.modal-content .select2-container { width: 100% !important; }
.modal-content .select2-container .select2-selection--single { height: 42px !important; display: flex; align-items: center; }
.modal-inline-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 15px; width: 100%; }
.modal-inline-row > div { flex: 1; min-width: 0; }
.modal-inline-row input, .modal-inline-row select, .modal-inline-row .select2-container { margin-bottom: 0 !important; }
.modal-inline-row .btn-mini-plus { height: 42px !important; margin-bottom: 0 !important; display: flex; align-items: center; justify-content: center; }

/* --- FORM ROW/COL LAYOUT (nouveau_client, nouveau_vehicule, nouveau_produit, etc.) --- */
.row { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 15px; }
.col { flex: 1; min-width: 0; }

/* --- MAIN CARD & FORMULAIRES SPÉCIFIQUES --- */
.main-card { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); padding: 30px; margin: 0 auto; }
.main-card form > input, .main-card form > select, .main-card form > textarea, .facture-libre-card form > input, .facture-libre-card form > select, .facture-libre-card form > textarea { margin-bottom: 15px; }
.main-card form > hr { margin: 25px 0; border: 0; border-top: 1px solid #eee; }
/* Select2 : empêcher le débordement dans les cartes formulaire */
.facture-libre-card .select2-container, .main-card .select2-container, .form-produit .select2-container { width: 100% !important; max-width: 100%; }
.facture-libre-card .select2-container .select2-selection, .main-card .select2-container .select2-selection { min-height: 42px; }

/* --- PLACAGE BADGE --- */
.plaque-mini, .plaque-badge { background: #eee; padding: 2px 5px; border-radius: 3px; font-family: monospace; font-weight: bold; border: 1px solid #ccc; }

/* --- SECTION HEADER --- */
.section-header { background-color: #f1f3f5; font-weight: bold; color: #495057; padding: 8px; font-size: 0.9em; border-radius: 4px; margin-top: 15px; }
.section-title { font-size: 1.1em; font-weight: bold; color: #2c3e50; margin: 0; }

/* --- TEXT UTILITIES --- */
.text-muted { color: #888; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.amount-red { color: #dc3545; font-weight: bold; }

/* --- BACK LINK --- */
a.back { color: #6f42c1; text-decoration: none; display: inline-block; margin-bottom: 15px; }
a.back:hover { text-decoration: underline; }

/* --- MODULE PRESTATION / CALCUL --- */
.calc-box { background: #f0f0f0; padding: 15px; border-radius: 8px; margin-top: 15px; border:1px solid #ddd; }
.editable-price { background: white !important; border: 2px solid #28a745 !important; color: #28a745 !important; }
.w-100 { width: 100% !important; box-sizing: border-box; }
.mb-2 { margin-bottom: 10px !important; }
.mt-3 { margin-top: 15px !important; }

/* --- MODULE PARAMETRES --- */
.page-parametres .main-card { max-width: 950px; padding: 0; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); overflow: hidden; }
.page-parametres .main-card h1 { margin: 0; padding: 20px; background: #333; color: white; font-size: 1.5em; }
.page-parametres .tab { text-decoration: none; }
.page-parametres .row { gap: 20px; }
.btn-del { background: #dc3545; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }
.btn-del:hover { background: #c82333; color: white; }
.badge-ADMIN { background: #f8d7da; color: #721c24; }
.badge-status { padding: 5px 12px; border-radius: 20px; font-weight: bold; font-size: 0.8em; text-transform: uppercase; border: 1px solid rgba(0,0,0,0.1); background: #eee; color: #666; }
.badge-status.ok { background: #d4edda; color: #155724; }
.badge-status.ko { background: #f8d7da; color: #721c24; }
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #28a745; }
input:checked + .slider:before { transform: translateX(24px); }
.integ-box { border: 1px solid #eee; padding: 20px; border-radius: 8px; margin-bottom: 20px; background: #fafafa; display: flex; justify-content: space-between; align-items: center; }
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-top: 20px; }
.banner-item { position: relative; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.banner-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.banner-actions { background: #f8f9fa; padding: 10px; text-align: center; border-top: 1px solid #ddd; }
.btn-param-google { background: #4285F4 !important; }
.btn-param-google:hover { background: #3367d6 !important; }
.btn-param-telegram { background: #0088cc !important; }
.btn-param-telegram:hover { background: #006699 !important; }
.btn-param-success { background: #28a745 !important; }
.btn-param-success:hover { background: #218838 !important; }
.btn-param-info { background: #17a2b8 !important; }
.btn-param-info:hover { background: #138496 !important; }
.btn-param-gemini { background: #8e44ad !important; }
.btn-param-gemini:hover { background: #6c3483 !important; }
.btn-param-warning { background: #856404 !important; }
.btn-param-warning:hover { background: #6d4f04 !important; }
.btn-param-secondary { background: #666 !important; }
.btn-param-secondary:hover { background: #555 !important; }
a.btn-primary.btn-as-link { text-decoration: none; display: inline-block; }
a.btn-del.btn-as-link { padding: 8px 15px; text-decoration: none; display: inline-block; }

/* --- MODULE CLIENT --- */
.page-nouveau-client .main-card { max-width: 600px; }
.page-nouveau-client .main-card h1 { margin-top: 0; border-bottom: 2px solid #007bff; padding-bottom: 10px; display: inline-block; }
.page-modifier-client .main-card { max-width: 800px; }
.client-form-header { margin-top: 0; border-bottom: 2px solid #007bff; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.client-form-cancel { font-size: 0.75em; text-decoration: none; color: #666; font-weight: normal; }
.client-form-cancel:hover { color: #333; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-group .btn-primary { flex: 1; min-width: 140px; }
.btn-secondary { background: #6c757d !important; color: white !important; }
.btn-secondary:hover { background: #5a6268 !important; color: white !important; }
.btn-disabled { background: #e9ecef !important; color: #999 !important; cursor: not-allowed; border: 1px solid #ddd !important; flex: 1; padding: 14px 20px; border-radius: 6px; font-weight: bold; font-size: 1em; }
.info-box { background: #e3f2fd; color: #0d47a1; padding: 10px; border-radius: 5px; margin-bottom: 20px; font-size: 0.9em; border-left: 4px solid #007bff; }
.photo-container { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; background: #f8f9fa; padding: 15px; border-radius: 8px; border: 1px solid #eee; }
.photo-container-field { flex: 1; }
.photo-container-field label.mt-0 { margin-top: 0; }
.img-preview { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.2); flex-shrink: 0; }
.img-preview-placeholder { background: #ddd; display: flex; align-items: center; justify-content: center; font-size: 2em; }
.mt-0 { margin-top: 0 !important; }
/* Grille adresse client : CP étroit, Ville large */
.col-civilite { flex: 0 0 120px !important; }
.col-cp { flex: 1 !important; }
.col-ville { flex: 2 !important; }

/* --- MODULE VEHICULE --- */
.page-nouveau-vehicule .main-card,
.page-modifier-vehicule .main-card { max-width: 800px; }
.page-nouveau-vehicule .main-card h1 { margin-top: 0; color: #333; border-bottom: 2px solid #007bff; padding-bottom: 10px; display: inline-block; }
.vehicule-form-header { margin-top: 0; color: #333; border-bottom: 2px solid #007bff; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.vehicule-form-cancel { font-size: 0.75em; text-decoration: none; color: #666; padding-top: 10px; }
.vehicule-form-cancel:hover { color: #333; }
.input-group { display: flex; gap: 5px; align-items: stretch; }
.input-group-select { flex: 1; min-width: 0; }
.btn-plus { background: #28a745; color: white; border: none; width: 40px; border-radius: 4px; cursor: pointer; font-size: 1.2em; font-weight: bold; flex-shrink: 0; }
.btn-plus:hover { background: #218838; color: white; }
.col-annee { flex: 0.5 !important; }
.input-immat { text-transform: uppercase !important; font-weight: bold !important; }
.veh-modal .modal-content { width: 500px; margin: 50px auto; }
.veh-modal-marque.modal-content { width: 300px; }
.veh-modal .modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }
.veh-modal .modal-header-title { margin: 0; }
.modal-close-btn { border: none; background: none; font-size: 1.5em; cursor: pointer; color: #888; padding: 0; line-height: 1; }
.modal-close-btn:hover { color: #333; }
.text-primary { color: #007bff !important; }

/* --- MODULE PRODUIT --- */
.page-nouveau-produit .produit-form,
.page-modifier-produit .produit-form { max-width: 900px; padding: 0; overflow: hidden; }
.produit-form .form-content { padding: 25px; }
.produit-page-header { max-width: 900px; margin: 0 auto 15px auto; }
.produit-page-header h1 { margin: 0; color: #333; }
.produit-page-header-with-link { display: flex; justify-content: space-between; align-items: center; }
.produit-back-link { color: #666; text-decoration: none; }
.produit-back-link:hover { color: #333; }
.produit-page-msg { max-width: 900px; margin: 0 auto; }
.produit-form-submit { border-radius: 0 0 8px 8px; font-size: 1.1em; }
.price-help { font-size: 0.85em; color: #666; margin-top: 5px; display: flex; justify-content: space-between; font-weight: bold; }
.price-input-group { display: flex; gap: 5px; }
.input-prix-vente { font-weight: bold !important; border: 2px solid #28a745 !important; flex: 1; min-width: 0; }
.btn-magic { flex: 1; border: none; border-radius: 4px; padding: 0 10px; font-size: 0.85em; cursor: pointer; color: white; font-weight: bold; height: 42px; margin-top: 5px; }
.btn-min { background: #fd7e14; }
.btn-min:hover { background: #e86f0c; }
.btn-std { background: #28a745; }
.btn-std:hover { background: #218838; }
.col-flex-1 { flex: 1 !important; }
.col-flex-2 { flex: 2 !important; }
.col-tva { flex: 0.6 !important; }
.col-vente { flex: 1.5 !important; }
.input-disabled { background: #f9f9f9 !important; color: #999 !important; }
.prod-tabs, .mod-prod-tabs { display: flex; background: #f8f9fa; border-top: 1px solid #eee; border-bottom: 1px solid #eee; margin-top: 30px; }
.prod-tabs .tab-btn, .mod-prod-tabs .tab-btn { flex: 1; padding: 15px; text-align: center; cursor: pointer; color: #666; font-weight: bold; border-bottom: 3px solid transparent; transition: 0.2s; background: none; border: none; font-size: 1em; }
.prod-tabs .tab-btn:hover, .mod-prod-tabs .tab-btn:hover { background: #eee; }
.prod-tabs .tab-btn.active, .mod-prod-tabs .tab-btn.active { color: #007bff; border-bottom: 3px solid #007bff; background: white; }
.prod-tab-content, .mod-prod-tab-content { display: none; padding: 25px; background: #fff; min-height: 200px; }
.prod-tab-content.active, .mod-prod-tab-content.active { display: block; animation: fadeInProd 0.3s; }
.oem-row { display: flex; gap: 10px; margin-bottom: 5px; }
.oem-row input { flex: 1; min-width: 0; }
.btn-remove-oem { background: #dc3545; color: white; border: none; width: 35px; border-radius: 4px; cursor: pointer; font-weight: bold; flex-shrink: 0; }
.btn-add-oem { background: #6c757d; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-size: 0.9em; margin-top: 5px; }
.btn-add-oem:hover { background: #5a6268; color: white; }
/* Select2 produit : surcharge pour hauteur cohérente */
.produit-form .select2-container .select2-selection--single,
.produit-form .select2-container .select2-selection--multiple { min-height: 42px !important; border: 1px solid #ddd !important; border-radius: 4px !important; }
.produit-form .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #e3f2fd; border: 1px solid #bbdefb; color: #0d47a1; }
@keyframes fadeInProd { from { opacity: 0; } to { opacity: 1; } }
.produit-tarif-box { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-top: 25px; border: 1px solid #e9ecef; }
.produit-tarif-sep { height: 1px; background: #ddd; margin: 15px 0; }
.produit-stock-row { align-items: flex-end; }
.produit-colisage-box { background: #e8f0fe; padding: 10px; border-radius: 4px; border: 1px solid #b8daff; }
.produit-colisage-inner { display: flex; gap: 10px; }
.produit-colisage-field { flex: 1; }
.produit-reappro-field { flex: 1; display: flex; align-items: center; }
.produit-checkbox-label { margin: 0; font-size: 0.85em; cursor: pointer; }
.produit-form input[type="checkbox"] { width: auto; margin-right: 5px; }
.produit-normes-box { background: #e3f2fd; padding: 15px; border-radius: 6px; margin-bottom: 15px; }
.text-sm { font-size: 0.8em !important; }
.mt-2 { margin-top: 8px !important; }

/* --- MODULE FOURNISSEUR --- */
.page-nouveau-fournisseur .main-card,
.page-modifier-fournisseur .main-card { max-width: 600px; }
.fournisseur-page-title { text-align: center; margin-bottom: 15px; }
.fournisseur-page-msg { max-width: 600px; margin: 0 auto 15px auto; }

/* --- MODULE FACTURATION & OR --- */
/* OR (Ouverture Dossier) */
.or-form-card { max-width: 700px; padding: 0; overflow: hidden; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); }
.or-card-header { background: #333; color: white; padding: 20px; text-align: center; }
.or-card-header h1 { margin: 0; font-size: 1.5em; font-weight: 500; }
.or-card-body { padding: 30px; }
.or-form-card label { margin-top: 20px; margin-bottom: 8px; }
.or-form-card label:first-child { margin-top: 0; }
.or-step-content { margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px; animation: fadeIn 0.5s; }
.step { display: inline-block; background: #eee; color: #555; width: 25px; height: 25px; text-align: center; line-height: 25px; border-radius: 50%; margin-right: 10px; font-size: 0.8em; }
.input-titre { font-weight: bold !important; color: #2c3e50 !important; }
.or-form-card .select2-container .select2-selection--single { min-height: 45px !important; border-radius: 6px !important; }
.alert-warning-link { color: #856404; font-weight: bold; }
.alert-warning-link:hover { color: #533f03; text-decoration: underline; }
/* Facture Libre */
.facture-libre-card { max-width: 600px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.facture-libre-card h1 { margin-top: 0; color: #333; text-align: center; border-bottom: 2px solid #2c3e50; padding-bottom: 10px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* --- MODULE LISTES & TABLEAUX --- */
.list-page-title { margin: 0; font-size: 1.2em; color: #333; }
.list-page-title-mr { margin-right: 15px; }
.form-inline-list { margin: 0; }
.form-inline-ml { margin-left: 15px; }
.filter-clear { font-size: 1.2em; align-self: center; text-decoration: none; color: #999; }
.filter-clear:hover { color: #666; }
.filter-notice { margin-bottom: 15px; color: #666; }
.archive-notice { margin-bottom: 15px; color: #6c757d; font-style: italic; }
.row-clickable { cursor: pointer; }
.amount-cell { text-align: right; font-weight: bold; color: #333; }
.actions-cell { white-space: nowrap; }
.btn-trash {
    background: none; border: none; cursor: pointer; color: #dc3545; font-size: 1.2em;
    padding: 5px 8px; border-radius: 50%; transition: 0.2s; margin-left: 5px; vertical-align: middle;
}
.btn-trash:hover { background-color: #fee2e2; transform: scale(1.1); }
.icon-sur-parc { color: #28a745; font-size: 1em; margin-left: 4px; }
.font-weight-bold { font-weight: bold; }
.modal-delete.modal-content { width: 400px; margin: 15% auto; text-align: center; }
.modal-title { margin-top: 0; color: #333; }
.modal-body-text { color: #666; font-size: 0.95em; margin-bottom: 25px; }
.modal-icon { font-size: 3em; margin-bottom: 10px; display: block; }
.btn-danger { background: #dc3545; color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-danger:hover { background: #c82333; color: white; }

/* --- MODULE FICHES DETAILLES --- */
/* Conteneur principal des fiches */
.fiche-container { max-width: 1000px; overflow: hidden; padding: 0 !important; }
.fiche-container.fiche-reparation { max-width: 100%; }

/* Fiche Client - Header bleu */
.fiche-client .fiche-header { background: #007bff; color: white; padding: 20px; flex-wrap: wrap; gap: 15px; display: flex; align-items: center; justify-content: space-between; }
.fiche-client .fiche-header.archived { background: #6c757d; }
.fiche-header-title { flex: 1; min-width: 250px; }
.fiche-header h1 { margin: 0; font-size: 1.5em; word-break: break-word; }
.fiche-contact-sub { font-size: 0.6em; font-weight: normal; opacity: 0.9; margin-top: 5px; }
.badge-banner { background: rgba(0,0,0,0.2); font-size: 0.5em; padding: 3px 8px; border-radius: 4px; vertical-align: middle; margin-left: 10px; color: white; }
.fiche-vehicule .badge-banner { font-size: 0.9em; padding: 5px 10px; }
.fiche-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fiche-client .fiche-header-actions button,
.fiche-client .fiche-header-actions a { color: #007bff; background: white; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9em; border: 1px solid rgba(0,0,0,0.08); transition: 0.2s; }
.fiche-client .fiche-header-actions a:hover, .fiche-client .fiche-header-actions button:hover { background: #e6f0ff; }
.fiche-client .fiche-header-actions .btn-restore { color: #28a745 !important; border-color: #28a745; }
.fiche-client .fiche-header-actions .btn-restore:hover { background: #28a745 !important; color: white !important; }
.fiche-client .fiche-header-actions .btn-archive { color: #6c757d !important; border-color: #6c757d; }
.fiche-client .fiche-header-actions .btn-archive:hover { background: #6c757d !important; color: white !important; }
.form-inline { display: inline; }

/* Fiche Client - Contenu */
.fiche-main-content { flex-wrap: wrap; display: flex; padding: 30px; gap: 40px; border-bottom: 1px solid #eee; }
.fiche-col-left { min-width: 300px; }
.fiche-col-right { border-left: 1px solid #eee; padding-left: 40px; min-width: 300px; }
.fiche-photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 4px solid #f4f4f4; }
.fiche-block h2, .fiche-col-right h3 { margin: 0 0 10px 0; font-size: 1.1em; color: #333; font-weight: 600; }
.address-box { font-style: normal; line-height: 1.6; color: #555; }
.fiche-access-ok { margin-top: 10px; font-size: 0.85em; color: #28a745; font-weight: bold; }
.fiche-access-ko { margin-top: 10px; font-size: 0.85em; color: #dc3545; }
.tab-empty-msg { text-align: center; padding: 20px; color: #999; }
.tab-actions-right { text-align: right; margin-bottom: 15px; }
.btn-pdf { background: #34495e !important; color: white !important; }

/* Modal overlay fiche (flex centré) */
.modal-overlay-fiche { display: none; justify-content: center; align-items: center; }
.modal-overlay-fiche[style*="block"] { display: flex !important; }
.modal-fiche-access { width: 400px; max-width: 95%; }
.modal-fiche-access input { width: 100%; padding: 10px; margin: 10px 0; box-sizing: border-box; }
.modal-buttons { display: flex; gap: 10px; margin-top: 15px; }
.modal-buttons button { flex: 1; }
.admin-vue-box { margin-bottom: 20px; padding: 15px; background: #e7f3ff; border-left: 4px solid #17a2b8; }
.admin-vue-title { margin: 0 0 10px 0; font-weight: bold; color: #0c5460; }
.tab-content textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; font-size: 0.95em; resize: vertical; min-height: 80px; }
.tab-content textarea:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,0.15); }
.spinner-border { display: inline-block; width: 2rem; height: 2rem; border: 3px solid #e0e0e0; border-top-color: #007bff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fiche-emails-loading { display: none; }

/* Fiche Véhicule */
.fiche-bar-title { font-weight: bold; font-size: 1.1em; color: #333; margin-left: 10px; }
.widget-veh { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 20px; font-size: 0.85em; font-weight: bold; background: #f8f9fa; border: 1px solid #eee; }
.widget-orange { color: #fd7e14; border-color: #ffeeba; background: #fff3cd; }
.widget-red { color: #dc3545; border-color: #f5c6cb; background: #f8d7da; }
.fiche-veh-header { background: #2c3e50; color: white; padding: 25px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.fiche-veh-header.archived { background: #6c757d; }
.fiche-header-plaque-wrap { display: flex; align-items: center; gap: 20px; }
.plaque-header { background: white; color: black; padding: 8px 20px; border-radius: 4px; font-family: monospace; font-weight: bold; font-size: 1.8em; border-left: 15px solid #003399; border-right: 15px solid #003399; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.fiche-veh-actions .btn-action { color: #2c3e50; background: white; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9em; border: 1px solid rgba(255,255,255,0.3); transition: 0.2s; }
.fiche-veh-actions .btn-action:hover { background: #ecf0f1; }
.fiche-veh-actions .btn-create { color: #28a745 !important; border-color: #28a745; }
.fiche-veh-actions .btn-create:hover { background: #28a745 !important; color: white !important; }
.fiche-veh-actions .btn-edit { color: #007bff !important; }
.fiche-veh-actions .btn-edit:hover { background: #007bff !important; color: white !important; }
.fiche-veh-actions .btn-archive { color: #6c757d !important; border-color: #6c757d; }
.fiche-veh-actions .btn-archive:hover { background: #6c757d !important; color: white !important; }
.fiche-veh-actions .btn-delete { color: #dc3545 !important; border-color: #dc3545; }
.fiche-veh-actions .btn-delete:hover { background: #dc3545 !important; color: white !important; }
.fiche-veh-actions .btn-restore { color: #28a745 !important; border-color: #28a745; }
.fiche-veh-actions .btn-restore:hover { background: #28a745 !important; color: white !important; }
.fiche-veh-content { padding: 30px; gap: 40px; border-bottom: 1px solid #eee; }
.fiche-veh-content .fiche-col-left { flex: 1; text-align: center; border-right: 1px solid #eee; padding-right: 40px; }
.fiche-veh-content .fiche-col-right { flex: 2; }
.fiche-veh-logo { width: 120px; height: 120px; object-fit: contain; margin-bottom: 15px; opacity: 0.8; }
.fiche-veh-marque { margin: 0; color: #333; }
.fiche-veh-modele { margin: 5px 0 0 0; color: #666; font-weight: normal; }
.fiche-owner-box { padding: 18px; margin-top: 20px; text-align: left; }
.fiche-box-label { color: #888; text-transform: uppercase; font-weight: bold; font-size: 0.75em; letter-spacing: 0.5px; display: block; }
.fiche-owner-body { margin-top: 5px; }
.fiche-section-title { color: #007bff; border-bottom: 2px solid #007bff; padding-bottom: 10px; display: inline-block; margin-top: 0; background: none !important; }
.info-row { display: flex; border-bottom: 1px solid #eee; padding: 12px 0; }
.info-label { font-weight: bold; width: 140px; color: #666; font-size: 0.9em; text-transform: uppercase; }
.info-val { color: #333; font-weight: 500; font-size: 1.05em; }
.info-val-monospace { font-size: 0.9em; font-family: monospace; }
.fiche-motor-box { padding: 18px; margin-top: 20px; }
.fiche-motor-title { margin: 0 0 15px 0; color: #444; display: flex; align-items: center; gap: 10px; font-size: 1em; }
.badge-energie { background: #e9ecef; color: #495057; font-size: 0.7em; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }
.fiche-motor-def { font-size: 1.1em; font-weight: bold; color: #007bff; margin-bottom: 5px; }
.fiche-motor-code { margin-bottom: 15px; }
.fiche-motor-specs { gap: 20px; border-top: 1px solid #eee; padding-top: 15px; }
.fiche-spec-label { color: #888; font-weight: bold; }
.fiche-spec-val { font-size: 1.1em; }
.btn-create { background: #28a745 !important; color: white !important; }
.btn-create:hover { background: #218838 !important; color: white !important; }
.badge.bg-RECEPTION { background: #fff3cd; color: #856404; }
.badge.bg-EN_COURS { background: #cce5ff; color: #004085; }
.badge.bg-TERMINE { background: #d4edda; color: #155724; }
.badge.bg-EN_FACTURATION { background: #e2e3e5; color: #383d41; }

/* Fiche Réparation - Barre & Status */
.back-btn { text-decoration: none; font-size: 1.5em; color: #666; }
.bar-title { font-size: 1.2em; font-weight: bold; color: #333; }
.status-badge { padding: 6px 15px; border-radius: 20px; letter-spacing: 0.5px; }
.st-DEVIS { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.st-RECEPTION, .st-VALIDE { background: #ffe8cc; color: #e8590c; border: 1px solid #ffd8a8; }
.st-PRET { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.st-EN_COURS { background: #0d6efd; color: white; border: 1px solid #0b5ed7; }
.st-EN_FACTURATION { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.st-TERMINE { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* Fiche Réparation - Info header */
.info-header-container { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 12px; padding: 20px; margin-bottom: 25px; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.or-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #e9ecef; }
.or-title-row h1 { margin: 0; font-size: 1.6em; color: #2c3e50; }
.edit-title-btn { background: none; border: none; font-size: 1em; cursor: pointer; color: #aaa; transition: 0.2s; }
.edit-title-btn:hover { color: #007bff; transform: scale(1.2); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; }
.info-col { padding: 0 10px; }
.info-col:not(:last-child) { border-right: 1px solid #e0e0e0; }
.col-label { display: block; font-size: 0.75em; text-transform: uppercase; color: #888; font-weight: bold; margin-bottom: 5px; }
.col-value { font-size: 1.05em; font-weight: 500; color: #333; line-height: 1.5; }
.fiche-reparation .plaque-badge { background: white; border: 1px solid #333; color: black; padding: 1px 8px; border-radius: 4px; border-left: 5px solid #003399; font-size: 1em; }
.main-layout { display: flex; gap: 25px; }
.col-content { flex: 3; }
.col-chatbox { flex: 1; min-width: 300px; }

/* Chatbox IA */
.chatbox-card { background: white; border-radius: 12px; border: 1px solid #e9ecef; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow: hidden; display: flex; flex-direction: column; }
#chat-history { height: 400px; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 12px; background: #f8f9fa; }
.chat-bubble { max-width: 90%; padding: 10px 14px; border-radius: 12px; font-size: 0.95em; line-height: 1.5; word-wrap: break-word; }
.chat-bubble.user { align-self: flex-end; background: #007bff; color: white; border-bottom-right-radius: 4px; }
.chat-bubble.model { align-self: flex-start; background: #e9ecef; color: #212529; border-bottom-left-radius: 4px; }
.chat-bubble.model .chat-markdown { white-space: pre-wrap; line-height: 1.6; }
.chat-bubble.model .chat-markdown strong { font-weight: 600; }
.chat-bubble.model .chat-markdown ul, .chat-bubble.model .chat-markdown ol { margin: 8px 0; padding-left: 20px; }
.chat-bubble.model .chat-markdown p { margin: 4px 0; }
.chat-input-row { display: flex; gap: 8px; padding: 12px; background: white; border-top: 1px solid #e9ecef; }
#ia_input { flex: 1; padding: 10px 12px; border: 1px solid #dee2e6; border-radius: 8px; resize: none; font-size: 0.95em; }
#btn-send-ia { background: #007bff; color: white; border: none; padding: 10px 18px; border-radius: 8px; font-weight: bold; cursor: pointer; white-space: nowrap; }
#btn-send-ia:hover:not(:disabled) { background: #0056b3; }
#btn-send-ia:disabled { background: #adb5bd; cursor: not-allowed; }
.chat-loading { align-self: flex-start; background: #e9ecef; color: #6c757d; padding: 10px 14px; border-radius: 12px; font-style: italic; font-size: 0.9em; }

/* Lignes OR / Devis */
.btn-validate-header { background: #28a745; color: white; margin-left: 5px; }
.btn-back-devis { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.btn-back-devis:hover { background: #ffeeba; }
.btn-cancel { background: #6c757d; color: white; border: none; }
.btn-validate { width: 100%; text-align: center; font-size: 1em; margin-top: 10px; }
.input-inline { padding: 5px; border: 1px solid #007bff; border-radius: 4px; font-size: 1em; font-weight: bold; color: #333; width: 300px; }
.input-live { width: 100%; padding: 10px; border: 2px solid #28a745; border-radius: 4px; font-size: 1em; background: #fafffb; box-sizing: border-box; }
.lines-toolbar { display: flex; gap: 15px; margin-bottom: 15px; padding: 10px 0; border-bottom: 1px solid #e9ecef; }
.toolbar-link { color: #007bff; text-decoration: none; font-size: 0.95em; }
.toolbar-link:hover { text-decoration: underline; }
.toolbar-link-disabled { color: #adb5bd; cursor: not-allowed; pointer-events: none; }
.table-lines-odoo { width: 100%; border-collapse: collapse; }
.table-lines-odoo .col-handle { width: 30px; padding: 8px 5px; cursor: grab; color: #adb5bd; }
.table-lines-odoo .col-type { width: 45px; text-align: center; }
.table-lines-odoo .col-designation { min-width: 200px; }
.table-lines-odoo .col-qte { width: 90px; text-align: center; }
.table-lines-odoo .col-unite { width: 80px; }
.table-lines-odoo .col-prix { width: 100px; text-align: right; }
.table-lines-odoo .col-montant { width: 100px; text-align: right; font-weight: 500; }
.table-lines-odoo .col-actions { width: 50px; text-align: center; }
.odoo-input { border: none; background: transparent; padding: 6px 8px; font-size: 0.95em; }
.odoo-input:hover, .odoo-input:focus { background: #f8f9fa; outline: 1px solid #dee2e6; border-radius: 3px; }
.line-row:hover { background: #f8f9fa; }
.line-row.sortable-ghost { opacity: 0.4; background: #e9ecef; }
.line-row-section { background: #f1f3f5 !important; }
.line-row-section:hover { background: #e9ecef !important; }
.odoo-input-section { font-weight: bold; background: transparent !important; border: none !important; width: 100% !important; }
.btn-delete-line { background: none; border: none; color: #dc3545; cursor: pointer; font-size: 1.3em; padding: 0 5px; line-height: 1; }
.btn-delete-line:hover { color: #c82333; }
.drag-handle { user-select: none; }
.btn-add-line { background: #28a745; color: white; border: none; padding: 12px; border-radius: 4px; width: 100%; font-weight: bold; font-size: 1em; margin-top: 5px; cursor: pointer; }
.btn-add-line:hover { background: #218838; }
.btn-mini-plus { background: #6c757d; color: white; border: none; width: 40px; height: 38px; border-radius: 4px; font-weight: bold; font-size: 1.2em; display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.btn-mini-plus:hover { background: #5a6268; }
.btn-copy { background: #6f42c1; color: white; border: none; padding: 15px; width: 100%; margin-top: 10px; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 1em; }
.btn-copy:hover { background: #5a2e99; }
.btn-email { background: #007bff; color: white; border: none; padding: 15px; width: 100%; margin-top: 10px; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 1em; }
.btn-email:hover { background: #0056b3; }

/* Modals OR */
.fiche-reparation .modal-content { width: 600px; padding: 25px 25px 35px 25px; text-align: center; overflow: visible; }
.select2-container--open { z-index: 99999 !important; }
.diag-modal-section { margin-bottom: 18px; }
.diag-modal-label { font-size: 0.85rem; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.diag-modal-body { background: #f8f9fa; border-radius: 8px; padding: 12px 14px; font-size: 0.95rem; color: #333; line-height: 1.5; }
.diag-modal-codes { font-family: ui-monospace, 'Consolas', monospace; font-size: 0.9rem; }
.diag-modal-conclusion { font-weight: 600; background: #e8f0fe; color: #1a202c; }

/* Toggle parc & RDV */
.toggle-parc { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 8px; background: #f8f9fa; border: 1px solid #e9ecef; }
.toggle-parc-on { background: #d4edda; border-color: #c3e6cb; }
.toggle-parc-switch { position: relative; width: 52px; height: 28px; background: #adb5bd; border-radius: 14px; cursor: pointer; transition: 0.2s; }
.toggle-parc-switch::after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.toggle-parc-switch.active { background: #28a745; }
.toggle-parc-switch.active::after { left: 27px; }
.badge-date-rdv { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 0.8em; font-weight: 600; margin-left: 8px; }
.badge-rdv-null { background: #e9ecef; color: #6c757d; border: 1px solid #dee2e6; }
.badge-rdv-ok { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }

/* --- MODULE IMPRESSION (DEVIS / FACTURES / AVOIRS) --- */
.body-print { margin: 0; padding: 0; background: #555; font-family: 'Arial', sans-serif; font-size: 13px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.document-a4 { max-width: 21cm; width: 210mm; min-height: 297mm; margin: 20px auto; padding: 15mm; box-sizing: border-box; position: relative; background: white; box-shadow: 0 0 15px rgba(0,0,0,0.5); }
.doc-print-toolbar { position: fixed; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 1000; }
.btn-print-close { background: #6c757d !important; color: white !important; border: none !important; padding: 10px 20px !important; border-radius: 5px !important; font-weight: bold !important; cursor: pointer !important; }
.btn-print-close:hover { background: #5a6268 !important; color: white !important; }

/* En-tête document */
.body-print .header { display: flex; justify-content: space-between; margin-bottom: 40px; align-items: flex-start; }
.body-print .logo-box { width: 45%; }
.body-print .logo-img { max-width: 200px; max-height: 80px; margin-bottom: 10px; display: block; }
.body-print .enseigne { font-size: 1.6em; font-weight: bold; color: #003366; text-transform: uppercase; margin: 0; }
.body-print .garage-info { text-align: right; width: 50%; font-size: 0.95em; color: #444; line-height: 1.4em; }
.body-print .garage-raison { font-weight: bold; text-transform: uppercase; }

/* Bloc titre + meta */
.body-print .doc-header { border-bottom: 2px solid #003366; margin-bottom: 20px; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; }
.body-print .doc-title { font-size: 2em; font-weight: bold; color: #333; margin: 0; }
.body-print .doc-meta { text-align: right; font-size: 1.1em; }

/* Facture : accent vert */
.document-facture .doc-header { border-bottom-color: #28a745; }
.document-facture .box h3 { color: #003366; }
.document-facture table th { background: #333; color: white; border: 1px solid #333 !important; }
.document-facture .total-final { background: #e3f2fd; color: #003366; border: 1px solid #b3e5fc; }
.document-facture .stamp-paid { border: 2px solid #28a745; color: #28a745; padding: 10px; margin-top: 15px; border-radius: 5px; text-align: center; font-weight: bold; font-size: 0.9em; background-color: #eafaf1; }

/* Devis : accent bleu */
.document-devis .doc-header { border-bottom-color: #003366; }
.document-devis .box h3 { color: #003366; }
.document-devis table th { background: #003366; color: white; border: 1px solid #003366 !important; }
.document-devis .total-final { background: #e3f2fd; color: #003366; border: 1px solid #b3e5fc; }
.document-devis .mention-ae { text-align: right; font-size: 0.8em; font-style: italic; color: #666; margin-top: 5px; }
.document-devis .bottom-section { display: flex; gap: 20px; margin-top: 40px; page-break-inside: avoid; }
.document-devis .conditions { flex: 1; font-size: 0.85em; color: #666; text-align: justify; }
.document-devis .signature { width: 250px; border: 1px solid #ccc; height: 100px; padding: 10px; font-size: 0.9em; font-weight: bold; }

/* Avoir : accent rouge */
.document-avoir .doc-header { border-bottom-color: #dc3545; }
.document-avoir .doc-title { color: #dc3545; }
.document-avoir .box h3 { color: #666; }
.document-avoir table th { background: #dc3545; color: white; border: 1px solid #dc3545 !important; }
.document-avoir .total-final { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Grille infos client/garage */
.body-print .info-grid { display: flex; gap: 20px; margin-bottom: 30px; }
.body-print .box { flex: 1; border: 1px solid #ccc; border-radius: 5px; padding: 15px; }
.body-print .box h3 { margin-top: 0; border-bottom: 2px solid #eee; padding-bottom: 5px; font-size: 1.1em; }
.body-print .box-content { line-height: 1.5em; }
.body-print .plate { display: inline-block; background: white; border: 1px solid #333; border-left: 5px solid #003399; padding: 2px 5px; font-family: 'Courier New', monospace; font-weight: bold; font-size: 1.1em; letter-spacing: 1px; border-radius: 3px; }

/* Tableau lignes */
.body-print .document-a4 table { width: 100%; border-collapse: collapse; margin-bottom: 20px; border: 1px solid #ccc; }
.body-print .document-a4 th { padding: 10px; text-align: left; text-transform: uppercase; font-size: 0.85em; border: 1px solid #333; }
.body-print .document-a4 td { padding: 8px 10px; border: 1px solid #ddd; vertical-align: top; }
.body-print .col-qty { text-align: center; width: 50px; }
.body-print .col-price { text-align: right; width: 80px; }
.body-print .document-avoir .col-price { width: 90px; }
.body-print .col-total { text-align: right; width: 90px; font-weight: bold; }
.body-print .document-avoir .col-total { width: 100px; }
.body-print .row-section { background-color: #f0f0f0; font-weight: bold; color: #003366; text-transform: uppercase; font-size: 0.9em; padding-top: 15px; border-bottom: 2px solid #ccc; border: 1px solid #ddd; }
.body-print .row-subtotal { background-color: #fafafa; font-style: italic; color: #666; font-size: 0.9em; text-align: right; }
.body-print .indent { padding-left: 25px; }

/* Totaux */
.body-print .footer-total { display: flex; justify-content: flex-end; page-break-inside: avoid; }
.body-print .total-box { width: 250px; }
.body-print .total-row { display: flex; justify-content: space-between; padding: 5px 0; }
.body-print .total-final { display: flex; justify-content: space-between; align-items: center; font-size: 1.4em; font-weight: bold; padding: 10px; margin-top: 10px; border-radius: 4px; }

/* Pied de page */
.body-print .legal-footer { position: absolute; bottom: 15mm; left: 15mm; right: 15mm; text-align: center; font-size: 0.7em; color: #999; border-top: 1px solid #eee; padding-top: 10px; }

/* Impression */
@media print {
    .body-print { background: white; margin: 0; padding: 0; }
    .no-print { display: none !important; }
    .document-a4 { margin: 0; padding: 0; box-shadow: none; max-width: 100%; width: 100%; min-height: auto; }
    @page { size: A4; margin: 10mm 10mm 15mm 10mm; }
    .body-print .legal-footer { position: fixed; bottom: 0; left: 0; right: 0; border-top: 1px solid #ddd; padding-top: 5px; background: white; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* --- MODULE DASHBOARD & LOGIN --- */
/* Sidebar : bouton Nouvel OR, sous-menu paramètres */
.badge-pulse { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.sidebar-btn-new { background: #2980b9; color: white; margin: 5px 10px; border-radius: 4px; border-left: none; }
.sidebar-btn-new:hover { background: #3498db; color: white; }
.sidebar-params-toggle { display: flex; justify-content: space-between; }
.sidebar-arrow { font-size: 0.8em; transition: 0.3s; }
.sidebar-submenu-panel { display: none; background-color: #1a252f; }
.sidebar-submenu-panel a { padding-left: 40px; font-size: 0.9em; border-left: none; }
.sidebar-submenu-item { padding-left: 40px !important; font-size: 0.9em !important; border-left: none !important; }

/* Dashboard : pas de top-bar, annuler margin-top */
body.page-dashboard { margin-top: 0 !important; }
.dashboard-title { margin-top: 0; color: #333; }
.dashboard-subtitle { color: #666; margin-bottom: 20px; }

/* Grille finances */
.finance-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.finance-widget { background: white; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); padding: 20px; border-left: 5px solid transparent; }
.finance-widget-purple { border-left-color: #6c5ce7; }
.finance-widget-blue { border-left-color: #007bff; }
.finance-widget-green { border-left-color: #28a745; }
.finance-title { font-size: 0.85em; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.finance-value { font-size: 1.5em; font-weight: bold; color: #333; }
.finance-widget-sub { font-size: 0.7em; font-weight: normal; color: #888; }
.progress-bar-outer { height: 12px; background: #eee; border-radius: 6px; overflow: hidden; margin-top: 12px; }
.progress-bar-inner { height: 100%; border-radius: 6px; transition: width 0.3s; }
.progress-bar-inner.prog-red { background: #dc3545; }
.progress-bar-inner.prog-yellow { background: #ffc107; }
.progress-bar-inner.prog-green { background: #28a745; }
.tendance { font-size: 0.9em; margin-top: 5px; }

/* Cartes statistiques */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: space-between; border-left: 5px solid transparent; }
.stat-card-title { font-size: 0.9em; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.stat-card-value { font-size: 1.8em; font-weight: bold; color: #333; }
.stat-card-icon { font-size: 2.5em; opacity: 0.2; }
.stat-card-icon-purple { color: #6610f2; opacity: 0.3; }
.stat-card-blue { border-left-color: #007bff; }
.stat-card-green { border-left-color: #28a745; }
.stat-card-red { border-left-color: #dc3545; }
.stat-card-orange { border-left-color: #fd7e14; }
.stat-card-purple { border-left-color: #6610f2; }

/* Grille principale dashboard */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.section-card { background: white; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); padding: 20px; margin-bottom: 20px; }
.section-card-accent-blue { border-left: 4px solid #007bff; }
.section-card .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; background: none; border-radius: 0; padding: 0 0 10px 0; margin-top: 0; }
.section-card .section-title { font-size: 1.1em; font-weight: bold; color: #2c3e50; margin: 0; }
.section-title-mb { margin-bottom: 15px; }
.section-card-emoji { font-size: 1.5em; }
.chart-container { position: relative; height: 300px; width: 100%; }
.dashboard-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-action-orange { background: #fd7e14 !important; color: white !important; }
.btn-action-orange:hover { background: #e86f0c !important; color: white !important; }
.btn-action-dark { background: #2c3e50 !important; color: white !important; }
.btn-action-dark:hover { background: #34495e !important; color: white !important; }
.btn-action-green { background: #28a745 !important; color: white !important; }
.btn-action-green:hover { background: #218838 !important; color: white !important; }

@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .finance-row { grid-template-columns: 1fr; }
}

/* Page Login */
.body-login { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: #2c3e50; margin: 0; padding: 0; }
.login-wrapper { width: 100%; display: flex; justify-content: center; align-items: center; padding: 20px; }
.login-card { max-width: 400px; width: 100%; text-align: center; padding: 40px; }
.login-logo { display: block; font-size: 3em; margin-bottom: 10px; }
.login-title { margin: 0 0 20px 0; color: #333; }
.login-card input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 16px; }
.login-forgot-link { display: block; margin-top: 10px; font-size: 0.85em; color: #007bff; cursor: pointer; }
.login-forgot-link:hover { text-decoration: underline; }
.login-back-link { display: block; margin-top: 20px; color: #666; }
.login-back-link:hover { color: #333; }
.modal-overlay-login { display: none; justify-content: center; align-items: center; }
.modal-overlay-login[style*="flex"] { display: flex !important; }
.modal-login-content { width: 90%; max-width: 400px; }
.modal-login-content input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; }
.modal-login-content button { width: 100%; padding: 12px; margin-top: 10px; }
.msg-box { margin-top: 15px; padding: 10px; border-radius: 5px; font-size: 0.9em; display: none; }
.msg-success { background: #d4edda; color: #155724; }
.msg-error { background: #f8d7da; color: #721c24; }

/* --- MODULES ANNEXES (AGENDA, STOCK, STATS, URGENCE, RECEPTION) --- */

/* Agenda : FullCalendar + Modales */
.agenda-card { padding: 20px; }
.fc-theme-standard .fc-scrollgrid { border: none !important; }
.fc-theme-standard td, .fc-theme-standard th { border: none !important; }
.fc .fc-timegrid-slot { border-bottom: 1px solid #f1f1f1 !important; height: 2.6em !important; }
.fc .fc-timegrid-col { border-left: 1px solid #f1f1f1 !important; }
.fc-timegrid-cols td:first-child, .fc-timegrid-col:first-child { border-left: none !important; }
.fc .fc-col-header-cell { border-bottom: 1px solid #eee !important; }
.fc-scroller::-webkit-scrollbar { display: none !important; }
.fc-scroller { -ms-overflow-style: none !important; scrollbar-width: none !important; }
.fc-col-header-cell-cushion { display: flex !important; flex-direction: column; align-items: center; padding: 10px 0 !important; text-decoration: none !important; color: #333 !important; }
.fc-day-header-day { font-size: 0.7em; text-transform: uppercase; color: #95a5a6; font-weight: 700; letter-spacing: 0.5px; }
.fc-day-header-date { font-size: 1.4em; font-weight: bold; color: #2c3e50; margin-top: 2px; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; }
.fc-day-today .fc-day-header-date { background-color: #007bff; color: white !important; border-radius: 50%; box-shadow: 0 3px 6px rgba(0,123,255,0.3); }
.fc-day-today .fc-day-header-day { color: #007bff; }
.fc-v-event { border: none !important; border-left: 4px solid rgba(0,0,0,0.2) !important; border-radius: 6px !important; }
.fc-button-primary { background-color: #2c3e50 !important; border: none !important; border-radius: 8px !important; font-weight: bold !important; }
.fc-today-button { background-color: #007bff !important; opacity: 1 !important; }
.modal-agenda .modal-content { width: 450px; margin: 10% auto; }
.modal-agenda-view { border-top: 5px solid #007bff; }
.detail-row { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #f8f9fa; }
.detail-label { font-size: 0.75em; color: #95a5a6; text-transform: uppercase; font-weight: bold; margin-bottom: 4px; display: block; }
.detail-value { font-size: 1em; color: #2c3e50; font-weight: 500; }
.agenda-input { width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 8px; margin-bottom: 15px; font-size: 1em; outline: none; }
.agenda-input:focus { border-color: #007bff; }
.btn-agenda-add { background: #34495e; color: white; border: none; width: 36px; height: 36px; border-radius: 50%; font-weight: bold; cursor: pointer; }
.agenda-sync-badge { font-size: 0.85em; color: #27ae60; font-weight: bold; }
.main-card .select2-container--default .select2-selection--single { height: 46px !important; padding: 8px !important; border: 2px solid #ddd !important; border-radius: 8px !important; display: flex; align-items: center; }
.main-card .select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px !important; right: 10px !important; }
.main-card .select2-container { width: 100% !important; margin-bottom: 15px !important; }

/* Stock */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 20px; }
.main-card.cat-card { overflow: hidden; transition: 0.3s; }
.main-card.cat-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.cat-header { background: #f8f9fa; padding: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.cat-title { font-weight: bold; color: #2c3e50; text-decoration: none; font-size: 1.1em; }
.sub-list { list-style: none; padding: 10px 15px; margin: 0; }
.sub-item { padding: 8px 0; border-bottom: 1px solid #f9f9f9; }
.sub-link { text-decoration: none; color: #666; font-size: 0.9em; display: block; transition: 0.2s; }
.sub-link:hover { color: #007bff; padding-left: 5px; }
.badge-stock { padding: 6px 14px; border-radius: 15px; font-weight: bold; font-size: 0.85em; white-space: nowrap; display: inline-block; }
.stock-ok { background: #d4edda; color: #155724; }
.stock-low { background: #f8d7da; color: #dc3545; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #dc3545; }
.col-stock { width: 150px; text-align: center !important; }
.col-price { width: 130px; text-align: right !important; }
.breadcrumb { margin-bottom: 20px; font-size: 0.9em; color: #666; }
.breadcrumb a { color: #007bff; text-decoration: none; font-weight: bold; }
.breadcrumb-clear { margin-left: 10px; color: #999; font-weight: normal; }
.stock-toggle-wrap { display: flex; background: #eee; padding: 3px; border-radius: 25px; margin-left: 10px; }
.stock-search-form { margin: 0; margin-left: 15px; }
.stock-alerte-link { text-decoration: none; text-align: center; }
.stock-alerte-count { font-weight: bold; color: #dc3545; }
.stock-alerte-label { color: #666; text-transform: uppercase; font-size: 0.7em; }

/* Statistiques */
.page-header { margin-top: 0; margin-bottom: 8px; }
.page-sub { color: #666; margin-bottom: 30px; font-size: 0.95em; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { border-left: 5px solid #007bff; padding: 20px; }
.stat-card-green { border-left-color: #28a745; }
.stat-card-orange { border-left-color: #fd7e14; }
.stat-card h3 { font-size: 0.85em; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 10px 0; }
.stat-card .value { font-size: 1.8em; font-weight: bold; color: #333; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.chart-card h3 { font-size: 1em; font-weight: bold; color: #2c3e50; margin: 0 0 15px 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.chart-section-title { font-size: 1.1em; font-weight: bold; color: #2c3e50; margin: 25px 0 15px 0; padding-bottom: 8px; border-bottom: 2px solid #007bff; }
.chart-card-objectif { grid-column: 1 / -1; max-width: 500px; margin: 0 auto; }
@media (max-width: 1200px) {
    .stats-row, .charts-row { grid-template-columns: 1fr; }
}

/* Urgence (page standalone) */
body.urgence-page { background-color: #f8d7da; margin: 0; padding: 20px; color: #721c24; }
.urgence-page .main-card { max-width: 500px; margin: 0 auto; border-top: 10px solid #dc3545; }
.urgence-page h1 { text-align: center; color: #dc3545; margin-top: 0; font-size: 1.8em; text-transform: uppercase; }
.urgence-page input:focus, .urgence-page textarea:focus { border-color: #dc3545; outline: none; }
.urgence-submit { width: 100%; padding: 15px; margin-top: 25px; text-transform: uppercase; background: #dc3545 !important; }
.urgence-submit:hover { background: #c82333 !important; }
.urgence-success { text-align: center; padding: 30px; }
.urgence-icon-ok { font-size: 4em; display: block; margin-bottom: 10px; }
.urgence-success-title { color: #28a745; margin: 0; }
.urgence-success-text { color: #333; }
.urgence-back-link { display: block; margin-top: 20px; color: #666; }
.warning-box { background: #fff3cd; color: #856404; padding: 15px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9em; border: 1px solid #ffeeba; text-align: justify; }
.urgence-footer { text-align: center; margin-top: 20px; }
.urgence-footer a { color: #666; text-decoration: none; font-size: 0.9em; }
.urgence-footer a:hover { color: #333; }
.hidden-field { display: none; }

/* Réception globale */
.reception-wrapper { max-width: 1200px; }
.scan-bar { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 30px; border-radius: 12px; margin-bottom: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.scan-bar h2 { color: white; margin: 0 0 20px 0; font-size: 1.5em; }
.scan-form { display: flex; gap: 15px; align-items: center; }
.scan-input { flex: 1; padding: 15px 20px; font-size: 1.3em; border: none; border-radius: 8px; outline: none; font-family: monospace; }
.btn-scan { background: white !important; color: #667eea !important; }
.btn-scan:hover { background: #f0f0f0 !important; transform: scale(1.02); }
.alert.info { background: #cce5ff; color: #004085; border-left: 4px solid #007bff; padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; }
.reception-wrapper .section-title { margin: 30px 0 15px 0; padding-bottom: 10px; border-bottom: 2px solid #eee; }
.reception-table th { background-color: #6f42c1; color: white; }
.col-photo { width: 60px; text-align: center; }
.col-photo img { max-width: 50px; max-height: 50px; border-radius: 4px; }
.btn-manual { padding: 6px 12px; font-size: 0.9em; }
.empty-state { text-align: center; padding: 50px; color: #999; font-size: 1.1em; }
.empty-state-icon { font-size: 3em; margin-bottom: 15px; }
.back-link { display: inline-block; margin-bottom: 20px; color: #666; text-decoration: none; font-weight: bold; }
.back-link:hover { color: #333; }
.badge-commande { background: #e7f1ff; color: #004085; padding: 3px 8px; border-radius: 12px; font-size: 0.85em; font-weight: bold; }

/* --- FICHE FACTURE : LAYOUT & COMPOSANTS --- */
.facture-container { max-width: 1300px; margin: 0 auto; display: flex; gap: 20px; }
.facture-container .main-col { flex: 3; }
.facture-container .side-col { flex: 1; min-width: 350px; display: flex; flex-direction: column; gap: 0; }
.facture-status-badge { position: absolute; top: 20px; right: 20px; color: white; padding: 8px 15px; border-radius: 20px; font-weight: bold; text-transform: uppercase; font-size: 0.85em; }
.facture-container .info-header-container { display: flex; gap: 20px; }
.facture-container .info-col { flex: 1; padding-right: 20px; border-right: 1px solid #ddd; }
.facture-container .info-col:last-child { border-right: none; padding-right: 0; }
.btn-edit-ech { background: none; border: none; cursor: pointer; color: #007bff; font-size: 0.9em; text-decoration: underline; float: right; }
select.modern-select { width: 100%; padding: 12px; border-radius: 8px; border: 2px solid #ddd; background-color: #fff; font-size: 1em; color: #333; cursor: pointer; outline: none; appearance: none; }
.facture-container .total-big { font-size: 1.8em; font-weight: bold; color: #333; text-align: right; margin-top: 20px; }
.facture-container .ech-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.facture-container .ech-row:hover { background-color: #f9f9f9; }
.ech-date { font-weight: bold; color: #555; }
.ech-amount { font-size: 1.1em; font-weight: bold; color: #333; }
.btn-mini-pay { background: #007bff; color: white; border: none; padding: 5px 12px; border-radius: 15px; font-size: 0.8em; cursor: pointer; }
.badge-ech { font-size: 0.75em; padding: 3px 8px; border-radius: 4px; font-weight: bold; }
.be-PAYE { background: #d4edda; color: #155724; }
.be-A_VENIR { background: #fff3cd; color: #856404; }
.facture-container .hist-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #eee; font-size: 0.9em; color: #555; }
.facture-modal .modal-content { width: 450px; }
.facture-container .radio-group { display: flex; gap: 10px; margin-bottom: 15px; }
.facture-container .radio-label { background: #f8f9fa; padding: 10px; border: 1px solid #ddd; border-radius: 6px; flex: 1; cursor: pointer; text-align: center; }
.facture-container .radio-label input { margin-right: 5px; }
.side-col-card .btn-primary { display: block; text-decoration: none; text-align: center; }
.facture-container .side-col a.btn-primary { text-decoration: none; }

/* --- BOUTONS SPECIFIQUES (FACTURES & OR) --- */
.btn-print { background-color: #34495e !important; color: white !important; }
.btn-print:hover { background-color: #2c3e50 !important; }
.btn-sumup-web { background-color: #0052cc !important; color: white !important; }
.btn-sumup-web:hover { background-color: #003d99 !important; }
.btn-sumup-tpe { background-color: #2c3e50 !important; color: white !important; border: 1px solid #1a252f !important; }
.btn-sumup-tpe:hover { background-color: #000 !important; }
.btn-pay { background-color: #28a745 !important; color: white !important; }
.btn-pay:hover { background-color: #218838 !important; }
.btn-echeance { background-color: #fd7e14 !important; color: white !important; }
.btn-echeance:hover { background-color: #e86f0c !important; }
.btn-avoir { background-color: #dc3545 !important; color: white !important; border: 2px dashed #ffb3b3 !important; }
.btn-avoir:hover { background-color: #c82333 !important; }
.btn-abby { background-color: #5c6bc0 !important; color: white !important; }
.btn-abby:hover { background-color: #3f51b5 !important; }
.btn-archive { background-color: #6c757d !important; color: white !important; }
.btn-archive:hover { background-color: #5a6268 !important; }

/* --- MODULE PLANIFICATEUR (RDV) --- */
.planificateur-container { display: flex; gap: 20px; height: calc(100vh - 120px); }
.left-panel { flex: 0 0 320px; display: flex; flex-direction: column; gap: 20px; }
.right-panel { flex: 1; background: white; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.planif-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.info-duration { text-align: center; margin-top: 15px; padding: 10px; background: #e3f2fd; border-radius: 8px; color: #0d47a1; font-weight: bold; }
.mini-cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.mini-cal-title { font-weight: bold; color: #333; font-size: 1.1em; text-transform: capitalize; }
.btn-nav { background: none; border: none; font-size: 1.2em; cursor: pointer; color: #666; width: 30px; height: 30px; border-radius: 50%; }
.btn-nav:hover { background: #eee; color: #007bff; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.day-name { font-size: 0.75em; color: #999; font-weight: bold; padding-bottom: 5px; }
.day-cell { height: 35px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 0.9em; cursor: default; transition: 0.2s; color: #ccc; font-weight: 500; }
.day-cell.available { background: #d4edda; color: #155724; font-weight: bold; cursor: pointer; border: 1px solid #c3e6cb; }
.day-cell.available:hover { background: #c3e6cb; transform: scale(1.1); }
.day-cell.active { background: #007bff !important; color: white !important; border-color: #007bff !important; box-shadow: 0 3px 6px rgba(0,123,255,0.3); }
.day-cell.today { border: 2px solid #007bff; }
.day-cell.empty { cursor: default; background:transparent !important; border:none !important; }
.week-header { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #eee; background: #fafafa; }
.col-header { padding: 15px 5px; text-align: center; border-right: 1px solid #f0f0f0; }
.col-header:last-child { border-right: none; }
.day-label { display: block; font-size: 0.8em; text-transform: uppercase; color: #888; font-weight: bold; margin-bottom: 4px; }
.day-number { font-size: 1.4em; font-weight: bold; color: #333; }
.day-number.current { color: #007bff; }
.week-body { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(7, 1fr); background: white; padding-bottom: 20px; }
.day-column { border-right: 1px solid #f7f7f7; padding: 10px 5px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.day-column:last-child { border-right: none; }
.slot-btn { background: #f8fafc; border: 1px solid #e2e8f0; color: #2d3748; padding: 10px 0; border-radius: 6px; text-align: center; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: 0.2s; }
.slot-btn:hover { background: #3182ce; color: white; border-color: #3182ce; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(49,130,206,0.3); }
.slot-btn small { display: block; font-size: 0.75em; opacity: 0.8; font-weight: normal; margin-top: 2px; }
.empty-msg { text-align: center; color: #cbd5e0; font-size: 0.8em; margin-top: 20px; font-style: italic; }
.loader-overlay { position: absolute; top:0; left:0; width:100%; height:100%; background:rgba(255,255,255,0.9); display:none; align-items:center; justify-content:center; z-index: 10; border-radius:12px; }
.loading-spinner { font-size: 3em; animation: spin 1s linear infinite; }

/* --- GRILLE DE FORMULAIRE POUR MODALES COMPLEXES --- */
.modal-form-grid { display: flex; flex-direction: column; gap: 15px; width: 100%; padding: 10px 0; }

/* Ligne standard plein largeur */
.form-grid-row-full { width: 100%; }
.form-grid-row-full label { display: block; margin-bottom: 5px; font-weight: 600; color: #333; font-size: 0.9em; }

/* Ligne avec un champ (input/select) et une action (bouton +) a droite */
.form-grid-row-action { display: flex; gap: 10px; align-items: flex-end; width: 100%; }
.form-grid-row-action .field-container { flex: 1; min-width: 0; }
.form-grid-row-action .action-container { flex: 0 0 auto; }
.form-grid-row-action label { display: block; margin-bottom: 5px; font-weight: 600; color: #333; font-size: 0.9em; }

/* Ligne avec 3 colonnes egales (pour Qte, Prix HT, Prix TTC) */
.form-grid-row-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; width: 100%; }
.form-grid-row-3col label { display: block; margin-bottom: 5px; font-weight: 600; color: #333; font-size: 0.9em; }

/* CRITICAL FIX FOR HEIGHTS (Select2 & Buttons) */
.modal-form-grid input, .modal-form-grid select, .modal-form-grid .select2-container--default .select2-selection--single {
    height: 40px !important; margin-bottom: 0 !important; box-sizing: border-box; width: 100% !important;
}
/* Centrer le texte dans Select2 verticalement */
.modal-form-grid .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important; padding-left: 10px;
}
/* Aligner le bouton + */
.modal-form-grid .btn-mini-plus {
    height: 40px !important; margin-bottom: 0 !important; display: flex; align-items: center; justify-content: center; padding: 0 15px;
}

/* Ajustements visuels specifiques a la modale Ajouter un produit */
#modalAddProduct .modal-content { text-align: left; }
#modalAddProduct .tab-content { padding: 16px 0 0 0; }
#modalAddProduct .btn-add-line { margin-top: 4px; }
#modalAddProduct .modal-row-with-qty .qty-container { flex: 0 0 90px; min-width: 90px; }
#modalAddProduct .modal-row-with-qty .action-container { flex: 0 0 auto; }
#modalAddProduct .tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    overflow: hidden;
}
#modalAddProduct .tabs .tab-btn {
    width: 100%;
    text-align: center;
    padding: 12px 8px;
    font-size: 0.95em;
    border-right: 1px solid #ddd;
}
#modalAddProduct .tabs .tab-btn:last-child { border-right: none; }
