/* ==============================================
   1. VARIABLES & GLOBAL
   ============================================== */
:root {
    --primary-color: #0d47a1;
    --primary-light: #1565c0;
    --secondary-gray: #f4f7f6;
    --medium-gray: #e0e0e0;
    --dark-gray: #333;
    --white: #ffffff;
    --danger-red: #d32f2f;
    --success-green: #2e7d32;
    --warning-orange: #ed6c02;
    --info-cyan: #0097a7;
    --bodywork-purple: #7b1fa2;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: #f1f5f9; color: var(--dark-gray); line-height: 1.6; }
button { font-family: var(--font-family); cursor: pointer; border: none; padding: 10px 16px; border-radius: 4px; font-size: 1rem; transition: background-color 0.2s; }
input, select, textarea { font-family: var(--font-family); padding: 10px; font-size: 1rem; border: 1px solid var(--medium-gray); border-radius: 4px; width: 100%; }
textarea { resize: vertical; }
input:disabled, textarea:read-only { background-color: var(--secondary-gray); color: #777; border-color: #eee; }

/* ==============================================
   2. NOTIFICATIONS (TOASTS)
   ============================================== */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    animation: fadeUp 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast.success { background: #2e7d32; }
.toast.error { background: #d32f2f; }
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* ==============================================
   PAGE DE CONNEXION (SPLIT SCREEN DESIGN)
   ============================================== */

/* Le conteneur global qui prend tout l'écran */
.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: white;
}

/* --- PARTIE GAUCHE : FORMULAIRE --- */
.login-left {
    width: 100%;
    max-width: 500px; /* Largeur max du panneau blanc */
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    z-index: 2;
    box-shadow: 5px 0 30px rgba(0,0,0,0.05); /* Ombre portée sur l'image */
}

.login-brand {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.login-welcome {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 3rem;
}

/* Inputs spécifiques Login */
.login-input-group {
    margin-bottom: 1.5rem;
}

.login-input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.3s;
    color: #333;
}

.login-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1);
    outline: none;
}

/* Bouton Login */
.btn-login-full {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.3);
}

.btn-login-full:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 71, 161, 0.4);
}

/* Footer discret */
.login-footer {
    margin-top: 3rem;
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
}

/* --- PARTIE DROITE : IMAGE --- */
.login-right {
    flex: 1; /* Prend tout le reste de la place */
    background-image: url('https://images.unsplash.com/photo-1486262715619-01b80250e0dc?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Filtre bleu par dessus l'image */
.login-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.85), rgba(13, 71, 161, 0.4));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem;
    color: white;
}

.overlay-text h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1; }
.overlay-text p { font-size: 1.1rem; opacity: 0.9; max-width: 500px; }

/* Responsive Mobile : On cache l'image */
@media (max-width: 900px) {
    .login-right { display: none; }
    .login-left { max-width: 100%; }
}

/* ==============================================
   4. HEADER & NAVIGATION (BLEU PRO CENTRÉ)
   ============================================== */
#app-container { display: flex; flex-direction: column; min-height: 100vh; }

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--primary-color); 
    color: white;
    padding: 0.8rem 2rem;
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.25);
    position: sticky;
    top: 0;
    z-index: 50;
}

header h1 {
    font-size: 1.4rem;
    margin-right: 1rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Menu Centré */
.header-controls-group {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-toggle-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.view-toggle-btn.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Déconnexion */
.header-controls { margin-left: auto; z-index: 2; }
#logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
}
#logout-btn:hover { background-color: var(--danger-red); border-color: var(--danger-red); }

@media (max-width: 1000px) {
    header { flex-direction: column; gap: 1rem; padding: 1rem; position: static; }
    .header-controls-group { position: static; transform: none; width: 100%; justify-content: center; flex-wrap: wrap; background: rgba(0,0,0,0.1); }
    .view-toggle-btn { flex: 1; text-align: center; margin-bottom: 0; }
    .header-controls { margin-left: 0; width: 100%; }
    #logout-btn { width: 100%; }
}

/* ==============================================
   5. GESTION DES VUES
   ============================================== */
main { flex-grow: 1; padding: 1.5rem; overflow-x: auto; }
.view-content { display: none; }
.view-content.active { display: block; }
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.view-header h2 { color: var(--primary-color); }

/* ==============================================
   6. VUE PLANNING SEMAINE (KANBAN)
   ============================================== */
#week-nav-container { display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap; gap: 1rem; background: white; padding: 1rem 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
#week-nav-container h2 { font-size: 1.2rem; margin: 0; text-align: center; white-space: nowrap; color: var(--primary-color); }
#week-nav-container button { white-space: nowrap; padding: 8px 16px; font-size: 0.9rem; }

#week-grid-content { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.2rem; padding-bottom: 2rem; min-width: 1200px; }
.day-column { background-color: #f1f5f9; border-radius: 12px; display: flex; flex-direction: column; min-height: 400px; border: 1px solid #e2e8f0; transition: background-color 0.3s; }
.day-column.today { background-color: #eef2ff; border: 2px solid var(--primary-color); box-shadow: 0 0 15px rgba(13, 71, 161, 0.15); }
.day-column.today .day-header { background: var(--primary-color); }

.day-header { background-color: #334155; color: white; padding: 1rem; border-radius: 10px 10px 0 0; text-align: center; position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.day-header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.day-header span { display: block; margin-top: 4px; background: transparent !important; font-size: 0.85rem; opacity: 0.9; font-weight: 400; }

.appointments-list { padding: 10px; flex-grow: 1; display: flex; flex-direction: column; gap: 10px; }

/* CARTE RDV */
.appointment-item { background: white; border-radius: 8px; padding: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; border-left: 5px solid var(--primary-color); cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; overflow: hidden; }
.appointment-item:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); border-color: #cbd5e1; }
.appointment-item.type-bodywork { border-left-color: #9c27b0; }
.appointment-item.type-mechanic { border-left-color: #0d47a1; }

.app-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.app-time-badge { background: #f1f5f9; color: #334155; font-size: 0.8rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.app-parts-icon { font-size: 1rem; }
.app-client-name { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-vehicle-info { font-size: 0.85rem; color: #64748b; margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }

.app-card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed #f1f5f9; padding-top: 8px; margin-top: 8px; gap: 10px; }
.mechanic-badge { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: white; background: #64748b; padding: 3px 8px; border-radius: 4px; flex-shrink: 0; }
.appointment-item.type-bodywork .mechanic-badge { background: #ab47bc; }
.appointment-item.type-mechanic .mechanic-badge { background: #42a5f5; }
.app-card-footer span:last-child { font-size: 0.75rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; flex-grow: 1; }

@media (max-width: 1000px) { #week-grid-content { grid-template-columns: 1fr; min-width: auto; } .day-column { min-height: auto; margin-bottom: 1.5rem; } }

/* ==============================================
   7. VUE COMMANDES / PIÈCES (WORKFLOW)
   ============================================== */
#parts-view { max-width: 1100px; margin: 0 auto; padding-bottom: 3rem; }
#parts-view h2 { color: var(--primary-color); font-size: 1.8rem; margin-bottom: 0.5rem; }
#parts-view > p { color: #64748b; margin-bottom: 2rem; }
#parts-list-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

.part-card { background: white; border-radius: 16px; padding: 1.5rem; box-shadow: 0 4px 6px rgba(0,0,0,0.02); border: 1px solid #e2e8f0; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; }
.part-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.part-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #ccc; }

.part-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.part-client-info h3 { margin: 0; font-size: 1.1rem; color: #1e293b; font-weight: 700; }
.part-client-info p { margin: 2px 0 0 0; font-size: 0.9rem; color: #64748b; display: flex; align-items: center; gap: 5px; }
.part-status-badge { font-size: 0.7rem; text-transform: uppercase; font-weight: 800; padding: 4px 8px; border-radius: 6px; letter-spacing: 0.5px; }

.part-content-box { background-color: #fffbeb; border: 1px solid #fef3c7; color: #92400e; padding: 1rem; border-radius: 8px; font-family: 'Courier New', monospace; font-size: 0.9rem; line-height: 1.5; margin-bottom: 1.5rem; flex-grow: 1; }

.part-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 1rem; border-top: 1px dashed #e2e8f0; }
.part-date { font-size: 0.8rem; font-weight: 600; color: #94a3b8; display: flex; align-items: center; gap: 5px; }
.btn-part-action { border: none; padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; gap: 6px; }

/* Couleurs Statuts Pièces */
.status-todo::before { background: #ef4444; }
.status-todo .part-status-badge { background: #fee2e2; color: #dc2626; }
.status-todo .btn-part-action { background: #ef4444; color: white; }
.status-todo .btn-part-action:hover { background: #dc2626; }

.status-ordered::before { background: #f59e0b; }
.status-ordered .part-status-badge { background: #fef3c7; color: #d97706; }
.status-ordered .btn-part-action { background: #f59e0b; color: white; }
.status-ordered .btn-part-action:hover { background: #d97706; }

.status-received::before { background: #10b981; }
.status-received .part-status-badge { background: #d1fae5; color: #059669; }
.status-received .btn-part-action { background: #10b981; color: white; }
.status-received .btn-part-action:hover { background: #059669; }

/* ==============================================
   8. VUE TABLEAU DE BORD (DASHBOARD)
   ============================================== */
.dashboard-container { max-width: 1100px; margin: 0 auto; padding-bottom: 3rem; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.dashboard-header h2 { color: var(--primary-color); margin: 0; font-size: 1.5rem; }
.quick-actions { display: flex; gap: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 1.5rem; transition: transform 0.2s; border: 1px solid #f0f2f5; }
.stat-card:hover { transform: translateY(-3px); }
.stat-icon { font-size: 2.5rem; background: #f8fafc; width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; border-radius: 50%; }
.stat-info h3 { margin: 0 0 5px 0; font-size: 0.9rem; color: #64748b; font-weight: 600; }
.stat-info p { margin: 0; font-size: 1.8rem; font-weight: 800; color: #1e293b; }
.stat-info small { color: #94a3b8; font-size: 0.75rem; }
.card-blue .stat-info p { color: var(--primary-color); }
.card-red .stat-info p { color: var(--danger-red); }
.card-orange .stat-info p { color: var(--warning-orange); }
.card-green .stat-info p { color: var(--success-green); }

.dashboard-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; }
.list-card { background: white; border-radius: 16px; padding: 1.5rem; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #f0f2f5; }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f1f5f9; }
.list-header h3 { margin: 0; color: var(--primary-color); font-size: 1.1rem; }
.btn-text { background: none; border: none; color: #64748b; font-size: 0.85rem; cursor: pointer; text-decoration: underline; }
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li { padding: 12px 0; border-bottom: 1px dashed #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.simple-list li:last-child { border-bottom: none; }
.list-item-main { font-weight: 600; color: #334155; display: block; }
.list-item-sub { font-size: 0.85rem; color: #94a3b8; }
.list-tag { font-size: 0.75rem; padding: 3px 8px; border-radius: 10px; font-weight: bold; }

@media (max-width: 768px) {
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .quick-actions { width: 100%; }
    .quick-actions button { flex: 1; }
    .dashboard-lists { grid-template-columns: 1fr; }
}

/* ==============================================
   DESIGN PREMIUM - VUE CLIENTS (BDD)
   ============================================== */

#database-view {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

/* Barre de recherche Design */
.search-bar-container {
    margin-bottom: 2rem;
    position: relative;
}

#database-search-input {
    padding: 15px 20px;
    font-size: 1.1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 15px center;
    background-size: 20px;
    padding-left: 50px; /* Espace pour l'icône */
}

#database-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1);
    outline: none;
}

/* Grille des Résultats */
#database-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* --- LA CARTE CLIENT --- */
.client-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.client-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

/* En-tête : Avatar + Nom */
.client-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.client-avatar {
    width: 50px;
    height: 50px;
    background: #eef2ff;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    flex-shrink: 0;
}

.client-info h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1e293b;
    font-weight: 700;
    line-height: 1.2;
}

.client-phone {
    margin-top: 4px;
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Infos Véhicule (Bloc gris) */
.client-vehicle-box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.vehicle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vehicle-model {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.vehicle-plate {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Footer : Stats et Actions */
.client-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px dashed #f1f5f9;
}

.client-stats {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.client-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-action {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.btn-history { background: #f1f5f9; color: #475569; }
.btn-history:hover { background: #e2e8f0; color: #1e293b; }

.btn-edit { background: #e0f2fe; color: #0284c7; }
.btn-edit:hover { background: #0284c7; color: white; }

/* ==============================================
   10. VUE DEVIS (CARTES PREMIUM V2 CORRIGÉES)
   ============================================== */
#quotes-view { max-width: 1100px; margin: 0 auto; padding-bottom: 3rem; }
.quotes-toolbar { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.search-bar-container { flex-grow: 1; margin-bottom: 0 !important; }
#quote-search-input { background: white; border: 1px solid #e2e8f0; box-shadow: 0 2px 5px rgba(0,0,0,0.02); padding: 12px 15px; border-radius: 10px; transition: border-color 0.2s; width: 100%; }
#quote-search-input:focus { border-color: var(--primary-color); outline: none; }

#quotes-list-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }

/* La Carte Devis */
.quote-card {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    min-height: 200px;
}

.quote-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

/* En-tête */
.quote-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.quote-number { font-family: 'Courier New', monospace; font-weight: 700; color: #64748b; font-size: 0.9rem; background: transparent; padding: 0; white-space: nowrap; letter-spacing: 0; }

.quote-status-select { appearance: none; -webkit-appearance: none; border: none; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; color: white; cursor: pointer; text-align: center; text-align-last: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); max-width: 100px; }
.quote-status-select:focus { outline: none; }

/* Corps */
.quote-body { flex-grow: 1; margin-bottom: 1rem; }
.quote-client-name { font-size: 1.15rem; font-weight: 800; color: #1e293b; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-vehicle-info { display: inline-flex; align-items: center; gap: 8px; color: #475569; font-weight: 600; font-size: 0.85rem; background: #f1f5f9; padding: 6px 12px; border-radius: 8px; margin-top: 4px; }

/* Pied */
.quote-footer { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px dashed #f1f5f9; padding-top: 1rem; }
.quote-price-wrapper { display: flex; flex-direction: column; align-items: flex-end; }
.quote-date-create { font-size: 0.7rem; color: #cbd5e1; margin-bottom: 2px; }
.quote-price-tag { font-size: 1.5rem; font-weight: 900; color: #0f172a; line-height: 1; letter-spacing: -0.5px; }
.price-accepted { color: #10b981; }

.btn-view-quote { background: var(--primary-color); color: white; border: none; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 10px rgba(13, 71, 161, 0.2); }
.btn-view-quote:hover { background: var(--primary-light); transform: scale(1.05); }

.status-brouillon { background-color: #94a3b8; }
.status-attente { background-color: #f59e0b; }
.status-accepte { background-color: #10b981; }
.status-refuse { background-color: #ef4444; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 4rem 2rem; color: #94a3b8; background: white; border-radius: 16px; border: 2px dashed #e2e8f0; }

/* ==============================================
   11. VUE CONFIGURATION
   ============================================== */
#config-view { max-width: 960px; margin: 0 auto; padding-bottom: 4rem; }
#config-view h2 { text-align: center; color: var(--primary-color); font-size: 2rem; margin-bottom: 2rem; font-weight: 700; }
.config-card { background: #ffffff; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.04); padding: 2.5rem; margin-bottom: 2rem; border: 1px solid #f0f2f5; transition: transform 0.2s ease; }
.config-card:hover { transform: translateY(-2px); }
.config-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 2px solid #f7f9fc; padding-bottom: 1rem; }
.config-header h3 { margin: 0; color: #2c3e50; font-size: 1.4rem; display: flex; align-items: center; gap: 10px; }
.garage-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.full-width { grid-column: span 2; }
.input-group { display: flex; flex-direction: column; }
.input-group label { font-weight: 600; margin-bottom: 0.5rem; color: #546e7a; font-size: 0.9rem; margin-left: 4px; }
.input-group input, .input-group textarea, .config-form input, .config-form-grid input { width: 100%; padding: 14px; border: 2px solid #edf2f7; border-radius: 10px; background-color: #f8fafc; font-size: 1rem; color: #333; transition: all 0.3s ease; }
.input-group input:focus, .input-group textarea:focus, .config-form input:focus, .config-form-grid input:focus { background-color: #fff; border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1); outline: none; }
.btn-save-config { background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%); color: white; padding: 12px 25px; font-size: 1rem; font-weight: bold; border-radius: 30px; border: none; box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3); cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; }
.btn-save-config:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4); }
.config-list { list-style: none; padding: 0; margin-top: 1.5rem; }
.config-list li { background: #f8fafc; padding: 12px 15px; border-radius: 8px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e2e8f0; font-weight: 500; }
.config-list li button { background: #fee2e2; color: #dc2626; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; padding: 0; }
.config-list li button:hover { background: #dc2626; color: white; }

/* ==============================================
   12. BOUTON FLOTTANT (FAB)
   ============================================== */
#add-appointment-btn { position: fixed; bottom: 2rem; right: 2rem; width: 60px; height: 60px; z-index: 100; display: flex; justify-content: center; align-items: center; padding: 0; padding-bottom: 4px; font-size: 2.5rem; line-height: 1; font-weight: 300; text-align: center; background-color: var(--primary-color); color: var(--white); border-radius: 50%; box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3); border: none; transition: transform 0.2s, background-color 0.2s; }
#add-appointment-btn:hover { background-color: var(--primary-light); transform: scale(1.1); }

/* ==============================================
   13. MODALES & DIALOGUES
   ============================================== */
#modal-overlay, #client-modal-overlay, #quote-modal-overlay, #history-modal-overlay, #user-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 1rem; overflow-y: auto; }
#appointment-modal, #client-modal, #history-modal { background: var(--white); padding: 2rem; border-radius: 8px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.form-group { margin-bottom: 1rem; }
.form-group-inline { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-group-inline .form-group { width: 100%; margin-bottom: 0; }
.modal-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; }
.btn-secondary { background-color: #546e7a; color: white; }
.btn-quote { background-color: var(--success-green); color: white; }

/* Modale RDV Specific */
#appointment-modal h2 { margin-top: 0; color: var(--primary-color); font-size: 1.8rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }
#appointment-modal h2::before { content: '📅'; }
.type-selector-wrapper { display: flex; gap: 1.5rem; margin-bottom: 2rem; }
.type-option { flex: 1; position: relative; }
.type-option input[type="radio"] { position: absolute; opacity: 0; cursor: pointer; }
.type-card { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 1.2rem; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; transition: all 0.2s ease; font-weight: 700; color: #64748b; background: #f8fafc; }
.type-card:hover { transform: translateY(-2px); border-color: #cbd5e1; }
.type-option input[value="mechanic"]:checked + .type-card { border-color: var(--primary-color); background-color: #eff6ff; color: var(--primary-color); box-shadow: 0 4px 12px rgba(13, 71, 161, 0.15); }
.type-option input[value="bodywork"]:checked + .type-card { border-color: var(--bodywork-purple); background-color: #f3e5f5; color: var(--bodywork-purple); box-shadow: 0 4px 12px rgba(123, 31, 162, 0.15); }
.app-grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.app-section { background: #fff; border: 1px solid #e2e8f0; padding: 1.2rem; border-radius: 12px; position: relative; }
.section-title { position: absolute; top: -12px; left: 15px; background: white; padding: 0 8px; font-size: 0.85rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.app-date-grid { display: grid; grid-template-columns: 1.5fr 1fr 0.8fr 1.5fr; gap: 1rem; margin-bottom: 1.5rem; }
.desc-wrapper textarea { min-height: 100px; border: 2px solid #e2e8f0; background: #f8fafc; }
.desc-wrapper textarea:focus { background: #fff; border-color: var(--primary-color); }
.quick-add-btn { background: #e2e8f0; color: #475569; border: none; padding: 8px 15px; border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 600; }
.quick-add-btn:hover { background: #cbd5e1; }

@media (max-width: 768px) { .app-grid-row, .app-date-grid { grid-template-columns: 1fr; gap: 1rem; } .type-selector-wrapper { flex-direction: column; gap: 0.5rem; } }

/* Modale Devis Specific */
#quote-modal { background: #fff; padding: 2.5rem; border-radius: 20px; width: 90%; max-width: 900px; max-height: 85vh; overflow-y: auto; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
#quote-modal h2 { margin-top: 0; color: var(--primary-color); font-size: 1.8rem; border-bottom: 3px solid #f0f2f5; padding-bottom: 1rem; margin-bottom: 2rem; display: flex; align-items: center; }
#quote-modal h2::before { content: '📝'; margin-right: 10px; font-size: 1.4rem; }
.form-section { background: #f8fafc; padding: 1.5rem; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 2rem; }
.form-section label { display: block; font-size: 1.1rem; font-weight: 700; color: #475569; margin-bottom: 1rem; }
#quote-service-adder-group, #quote-part-adder-group { background: white; padding: 10px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 1rem; border: 1px solid #edf2f7; display: flex; gap: 10px; }
#quote-part-adder-group input, #quote-service-adder-group select { border: none; background: transparent; box-shadow: none; padding: 8px; flex-grow: 1; }
#quote-part-adder-group input:focus, #quote-service-adder-group select:focus { outline: none; background: #f0f9ff; border-radius: 4px; }
#quote-service-adder-btn, #quote-part-adder-btn { background: var(--primary-color); color: white; border-radius: 6px; padding: 8px 15px; font-size: 0.9rem; border: none; cursor: pointer; transition: background 0.2s; }
#quote-service-adder-btn:hover, #quote-part-adder-btn:hover { background: #1565c0; }
.quote-lines-list { list-style: none; padding: 0; margin: 0; background: white; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.quote-lines-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid #f1f5f9; }
.quote-lines-list li:last-child { border-bottom: none; }
.quote-lines-list li:hover { background: #f8fafc; }
.quote-lines-list li span:first-child { font-weight: 500; color: #334155; }
.quote-lines-list li span:last-child { font-family: 'Courier New', monospace; font-weight: 700; color: #000; display: flex; align-items: center; gap: 10px; }
.quote-lines-list li button { background: #fee2e2; color: #dc2626; border: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; padding: 0; cursor: pointer; }
.quote-lines-list li button:hover { background: #dc2626; color: white; }
.quote-totals { background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%); padding: 2rem; border-radius: 16px; margin-bottom: 2rem; border: 1px solid #e2e8f0; display: flex; flex-direction: column; align-items: flex-end; }
.total-line { display: flex; justify-content: space-between; width: 100%; max-width: 400px; margin-bottom: 0.8rem; font-size: 1.1rem; color: #64748b; }
.total-line.total-ttc { margin-top: 1rem; padding-top: 1rem; border-top: 2px dashed #cbd5e1; font-size: 1.5rem; color: var(--primary-color); align-items: center; }
.total-line.total-ttc strong:last-child { font-size: 2rem; font-weight: 900; color: #2e7d32; background: #dcfce7; padding: 5px 15px; border-radius: 10px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
#quote-modal .modal-actions { display: flex; gap: 1rem; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid #f0f2f5; background: #fff; position: sticky; bottom: 0; z-index: 10; }
#quote-modal .modal-actions button { padding: 12px 20px; font-size: 1rem; border-radius: 8px; font-weight: 600; cursor: pointer; }
#quote-save-btn { background: #2e7d32; color: white; box-shadow: 0 4px 10px rgba(46, 125, 50, 0.2); border: none; }
#quote-save-btn:hover { background: #1b5e20; transform: translateY(-2px); }
#quote-pdf-btn { background: var(--primary-color); color: white; border: none; }
#quote-pdf-btn:hover { background: #1565c0; transform: translateY(-2px); }
#delete-quote-btn { background: transparent; color: #dc2626; border: 2px solid #fee2e2; }
#delete-quote-btn:hover { background: #fee2e2; }
#quote-cancel-btn { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
#quote-cancel-btn:hover { background: #e2e8f0; color: #334155; }
#quote-modal::-webkit-scrollbar { width: 8px; }
#quote-modal::-webkit-scrollbar-track { background: #f1f5f9; margin: 20px; border-radius: 4px; }
#quote-modal::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
#quote-modal::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
/* ==============================================
   DESIGN PREMIUM - MODALE DEVIS (STYLE APP)
   ============================================== */

#quote-modal {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 24px; /* Arrondi identique aux autres modales */
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Titre avec icône */
#quote-modal h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
#quote-modal h2::before { content: '📝'; font-size: 1.5rem; }

/* Grille des Inputs du haut (Client/Véhicule) */
.quote-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.quote-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

/* Champs de formulaire standard */
#quote-modal input, #quote-modal select {
    width: 100%;
    padding: 12px;
    border: 2px solid #f1f5f9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: #f8fafc;
    margin-bottom: 10px;
}
#quote-modal input:focus, #quote-modal select:focus {
    background: #fff;
    border-color: var(--primary-color);
    outline: none;
}

/* Sections Grisées (Pour casser le blanc) */
.form-section {
    background: #f1f5f9; /* Gris un peu plus soutenu */
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.form-section label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Groupe d'ajout (Ligne blanche dans le gris) */
#quote-service-adder-group, 
#quote-part-adder-group {
    background: white;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

#quote-service-adder-group input,
#quote-part-adder-group input,
#quote-service-adder-group select {
    border: none;
    background: transparent;
    margin-bottom: 0; /* Annule la marge par défaut des inputs */
}

/* Boutons Ajouter */
#quote-service-adder-btn, 
#quote-part-adder-btn {
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}
#quote-service-adder-btn:hover, 
#quote-part-adder-btn:hover { background: var(--primary-light); }

/* Liste des items ajoutés */
.quote-lines-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.quote-lines-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}
.quote-lines-list li:last-child { border-bottom: none; }

/* Totaux (Bloc en bas à droite) */
.quote-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

.total-line {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 350px;
    margin-bottom: 5px;
    color: #64748b;
}

.total-line.total-ttc {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    color: var(--dark-gray);
    font-size: 1.2rem;
    align-items: center;
}

.total-line.total-ttc strong:last-child {
    font-size: 1.8rem;
    color: var(--primary-color);
    background: #eef2ff;
    padding: 5px 15px;
    border-radius: 8px;
}

/* Actions du bas */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.modal-actions button {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
}

/* Scrollbar jolie */
#quote-modal::-webkit-scrollbar { width: 8px; }
#quote-modal::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

@media (max-width: 768px) {
    .quote-top-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ==============================================
   DESIGN PREMIUM - HISTORIQUE (TIMELINE)
   ============================================== */

/* Conteneur global de la timeline */
.history-timeline {
    position: relative;
    padding-left: 20px; /* Espace pour la ligne verticale */
    margin-top: 1rem;
}

/* La ligne verticale grise */
.history-timeline::before {
    content: '';
    position: absolute;
    left: 6px; /* Centré par rapport aux points */
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

/* L'item individuel */
.history-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 20px; /* Espace entre la ligne et la carte */
    animation: fadeUp 0.3s ease;
}

/* Le Point (Dot) sur la ligne */
.history-dot {
    position: absolute;
    left: -21px; /* Ajustement précis sur la ligne */
    top: 15px;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border: 3px solid white; /* Contour blanc pour détacher */
    border-radius: 50%;
    box-shadow: 0 0 0 1px #e2e8f0; /* Petit anneau gris */
    z-index: 2;
}

/* La Carte Contenu */
.history-card {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}

.history-card:hover {
    transform: translateX(5px);
    border-color: #e2e8f0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* En-tête de la carte (Date) */
.history-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Description */
.history-desc {
    font-size: 1rem;
    color: #334155;
    line-height: 1.5;
    font-weight: 500;
}

/* Bloc Pièces (si existant) */
.history-parts {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #f1f5f9;
    font-size: 0.85rem;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-parts span { font-weight: bold; color: #d97706; /* Orange foncé */ }

/* ==============================================
   DESIGN PREMIUM - MODALE CLIENT (EDIT)
   ============================================== */

#client-modal {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 24px;
    width: 95%;
    max-width: 800px; /* Plus large pour mettre côte à côte */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Titre */
#client-modal h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
#client-modal h2::before { content: '👤'; }

/* Grille 2 Colonnes */
.client-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Les blocs grisés */
.client-section-box {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.client-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Style spécial pour la plaque d'immatriculation */
#client-form-plate {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: #fff;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .client-edit-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* Bouton Supprimer Client */
.btn-delete-client { 
    background: #fee2e2; 
    color: #dc2626; 
}
.btn-delete-client:hover { 
    background: #dc2626; 
    color: white; 
}
/* ==============================================
   14. DESIGN FACTURES (HARMONISÉ AVEC DEVIS)
   ============================================== */

#invoices-view {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

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

/* Carte Facture : Copie conforme de .quote-card */
.invoice-card {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    min-height: 200px;
}

.invoice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

/* En-tête */
.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.invoice-number {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #64748b;
    font-size: 0.95rem;
}

/* Badges Statuts */
.invoice-status-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Couleurs des Badges (identiques aux selects) */
.badge-paid { 
    background-color: #dcfce7; color: #166534; /* Vert */
}
.badge-unpaid { 
    background-color: #fee2e2; color: #991b1b; /* Rouge */
}

/* Corps */
.invoice-body {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.invoice-client-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.invoice-vehicle-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
    margin-top: 4px;
}

/* Pied de page */
.invoice-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Aligne tout en bas */
    border-top: 1px dashed #f1f5f9;
    padding-top: 1rem;
}

/* Groupe de boutons (Gauche) */
.invoice-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Groupe Prix + Date (Droite) */
.invoice-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Aligne le texte à droite */
    text-align: right;
}

.invoice-date-create {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 4px;
    font-weight: 500;
}

.invoice-price-tag {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.5px;
}

/* Bouton Imprimer : Style "Bouton Bleu" comme la flèche des devis */
.btn-print-invoice {
    background: var(--primary-color); /* Bleu foncé */
    color: white;
    border: none;
    width: 36px; 
    height: 36px;
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(13, 71, 161, 0.2);
}

.btn-print-invoice:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

/* Style spécifique pour les Avoirs */
.invoice-card.is-avoir::before {
    background: #f59e0b; /* Orange */
}
.invoice-card.is-avoir .invoice-status-badge {
    background: #fef3c7; color: #d97706; border-color: #fcd34d;
}

/* Bouton Créer Avoir (Style harmonisé mais différent) */
.btn-create-avoir {
    background: white;
    border: 1px solid #cbd5e1;
    color: #64748b;
    width: 36px; 
    height: 36px;
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 5px;
}

.btn-create-avoir:hover {
    background: #fff7ed;
    color: #d97706;
    border-color: #d97706;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.15);
}

/* ==============================================
   15. ÉTATS DE CHARGEMENT
   ============================================== */
body.loading {
    cursor: wait;
}
body.loading button {
    opacity: 0.7;
    pointer-events: none;
}