/* --- STYLES DE BASE ET POLICE --- */
:root {
    /* --- THÈME AMT — calme & professionnel (marine + jaune) --- */
    --primary: #1A3553; /* Bleu marine AMT (défaut, surchargé par le branding) */
    --primary-hover: #14283f;
    --secondary: #1A3553; /* Barre latérale = marine unie */
    --accent: #FDC615; /* Jaune AMT — accent net (actions clés) */
    --accent-hover: #e6b200;
    --success: #059669; /* Vert (positif / payé) */
    --danger: #E51F21; /* Rouge AMT */
    --warning: #f59e0b; /* Amber */

    --bg-body: #F1F5F9; /* Gris très clair neutre (fini le voile vert) */
    --bg-surface: #ffffff;

    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */

    --border-color: #e2e8f0; /* Slate 200 */
    --radius: 14px;
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
    --shadow-md: 0 2px 8px -2px rgb(15 23 42 / 0.08), 0 1px 3px -1px rgb(15 23 42 / 0.06);
    --shadow-lg: 0 12px 28px -8px rgb(15 23 42 / 0.14), 0 4px 10px -6px rgb(15 23 42 / 0.08);

    /* MAPPING VARIABLES EXISTANTES */
    --bg-gradient: var(--bg-body);
    --glass-bg: var(--bg-surface);
    --glass-border: var(--border-color);
    --glass-shadow: var(--shadow-md);
    --accent-color: var(--primary);
    --success-color: var(--success);
    --danger-color: var(--danger);
    --card-radius: var(--radius);
    --input-bg: #f8fafc;
}

html {
    /* Empêche Chrome/Safari Android de GONFLER automatiquement les polices sur
       mobile (« font boosting ») -> le texte s'affiche à sa vraie taille CSS,
       comme sur ordinateur. C'était la cause du « polices trop grandes ». */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0; padding: 0 10px 15px 10px;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

h1, h2, h3, .app-header { font-family: 'Comfortaa', sans-serif; letter-spacing: -0.5px; }

.app-header {
    display: flex; align-items: center; justify-content: center; /* Centré */
    position: relative; /* Important pour le bouton déconnexion en absolute */
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--secondary, #1e293b) 0%, var(--primary, #334155) 100%);
    color: white;
    border-bottom: none;
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius) var(--radius);
}
.app-logo { height: 36px; margin-right: 15px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.app-header h1 { margin: 0; font-size: 22px; font-weight: 700; }
h2 { text-align: center; color: var(--text-main); margin: 15px 0 10px 0; font-size: 18px; font-weight: 600; }

/* Rendu Conditionnel Vue Bureau / Vue Mobile */
#desktop-view { display: block; }
#mobile-view { display: none; }

/* --- NAVIGATION --- */
.navigation {
    display: flex; justify-content: center;
    margin-bottom: 15px;
    background: white; padding: 6px; border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    width: fit-content; margin-left: auto; margin-right: auto;
}
.nav-menu {
    display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; justify-content: center;
}
.nav-menu > li {
    position: relative; /* Requis pour le dropdown absolu */
}
.nav-menu a {
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none; padding: 8px 14px;
    border-radius: 8px; color: var(--text-muted); font-weight: 600;
    background: transparent;
    transition: all 0.2s ease; font-size: 13px;
    border: none; box-shadow: none; white-space: nowrap;
}
.nav-menu a:hover { background: #f1f5f9; color: var(--primary); transform: translateY(-1px); }
.nav-menu a.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }

/* Flèche pour les menus déroulants */
.has-dropdown > a::after {
    content: "▾";
    font-size: 11px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}
.has-dropdown:hover > a::after {
    transform: rotate(180deg);
}

/* Menu Déroulant (Dropdown) */
.dropdown {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--bg-surface); min-width: 220px;
    box-shadow: var(--shadow-lg); border-radius: 8px;
    padding: 8px 0; list-style: none; margin: 5px 0 0 0;
    z-index: 1000; border: 1px solid var(--border-color);
    flex-direction: column; gap: 2px;
}

/* Pont invisible pour garder le hover actif quand on passe du menu au sous-menu */
.dropdown::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
}

.has-dropdown:hover .dropdown {
    display: flex; animation: fadeInDropdown 0.2s ease-in-out;
}
.dropdown a {
    padding: 8px 16px; border-radius: 0; width: 100%; box-sizing: border-box;
    font-weight: 500; color: var(--text-main);
}
.dropdown a:hover {
    background: #f8fafc; color: var(--primary); transform: none; padding-left: 20px; /* Petit effet au survol */
}
@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Badge Notification Confirmation */
#nav-confirmation,
.nav-menu li:has(#nav-confirmation.has-pending) > a { position: relative; }

#nav-confirmation.has-pending::after,
.nav-menu li:has(#nav-confirmation.has-pending) > a::before {
    content: "!";
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Masquer l'onglet Admin par défaut pour tous (Sécurité) */
#nav-admin { display: none; }

/* --- HAMBURGER MENU (Desktop) --- */
.hamburger-btn, #mobileToggle, .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; background: none; border: none; font-size: 24px; cursor: pointer; color: inherit; margin-right: 15px; }
.mobile-overlay { display: none; }

/* --- SOUS-ONGLETS --- */
.sub-nav {
    display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; justify-content: center;
    border-bottom: 1px solid var(--glass-border); padding-bottom: 5px;
}
.sub-nav a {
    text-decoration: none; padding: 6px 15px;
    border-radius: 20px; background: white;
    color: var(--text-muted); font-weight: 600; font-size: 13px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.sub-nav a.active { background: var(--text-main); color: #fff; border-color: var(--text-main); box-shadow: var(--shadow-sm); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- FORMULAIRE DE SAISIE --- */
#caisseForm {
    background: var(--glass-bg);
    border: none;
    padding: 15px;
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    margin-bottom: 15px;
}
.form-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-end; /* Aligne les champs en bas pour compenser les labels Paris/Abidjan */
}
input, select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 13px;
    box-sizing: border-box;
    /* min-height au lieu de height fixe : les selects/inputs au padding plus
       grand (ex. padding:12px dans des modales) peuvent désormais grandir et
       afficher leur libellé en entier au lieu de le rogner verticalement. */
    min-height: 36px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    background: white;
}

/* Couleurs spécifiques */
input[id*="montantParis"] { background-color: #eff6ff; border-color: #bfdbfe; color: #1e40af; font-weight: 600; }
input[id*="montantAbidjan"] { background-color: #fff7ed; border-color: #fed7aa; color: #9a3412; font-weight: 600; }

.form-buttons { display: flex; gap: 8px; margin-top: 15px; }
.form-buttons button, #addTransactionBtn, #saveDayBtn {
    flex-grow: 1; padding: 8px;
    font-size: 14px; font-weight: bold;
    cursor: pointer; border: 1px solid var(--border-color); border-radius: 8px; 
    background: white; color: var(--text-main);
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}
.form-buttons button:hover, #addTransactionBtn:hover, #saveDayBtn:hover { background: #f8fafc; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.form-buttons button.primary, #addTransactionBtn { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); 
    color: white; border: none; 
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25); 
}
.form-buttons button.primary:hover, #addTransactionBtn:hover { box-shadow: 0 6px 12px rgba(79, 70, 229, 0.35); background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%); }

/* --- AUTOCOMPLETION INTELLIGENTE --- */
.autocomplete-suggestions { position: absolute; z-index: 1000; background: white; border: 1px solid #cbd5e1; width: 100%; max-height: 200px; overflow-y: auto; list-style: none; padding: 0; margin: 4px 0 0 0; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: none; text-align: left; }
.autocomplete-suggestions li { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 13px; color: #1e293b; transition: background-color 0.2s, color 0.2s; }
.autocomplete-suggestions li:hover, .autocomplete-suggestions li.selected { background: #e0f2fe; color: #0284c7; font-weight: 600; }

#saveDayBtn {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white; border: none;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.25);
}
#saveDayBtn:hover { box-shadow: 0 6px 12px rgba(16, 185, 129, 0.35); background: linear-gradient(135deg, #059669 0%, var(--success) 100%); }

/* WIZARD DESKTOP (Masqué) */
.mobile-progress-bar, .btn-scan, .summary-card, .btn-prev, .btn-next { display: none; }
.desktop-only-title { display: block; }
.step-nav { display: none; }

.prix-container { display: flex; align-items: center; gap: 5px; }
.prix-container input { flex-grow: 1; }
.cfa-label { font-weight: bold; color: var(--text-muted); font-size: 12px; }

/* --- TABLEAUX --- */
table {
    width: 100%; border-collapse: collapse; background-color: transparent;
    font-size: 13px; /* Texte tableau un peu plus grand pour la lecture */
}
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border-color); color: var(--text-main); }
/* En-tête collant (Sticky Header) : reste visible au scroll — version épurée. */
thead { position: sticky; top: 0; z-index: 90; background-color: #f8fafc; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .6px; font-weight: 700; box-shadow: inset 0 -1px 0 var(--border-color); }
tbody tr:nth-child(even) { background-color: #fbfcfe; }
tbody tr:hover { background-color: #eef2f7; }
td button.deleteBtn { background-color: var(--danger); color: white; border: none; padding: 4px 8px; border-radius: 7px; cursor: pointer; font-size: 11px; }
td button.editBtn { background-color: #475569; color: white; border: none; padding: 4px 8px; border-radius: 7px; cursor: pointer; margin-right: 5px; font-size: 11px; }

/* --- NOUVEAUX COMPOSANTS SAAS (Bilan du jour, Utilisateurs, etc.) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}
.stat-value {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.2;
}
.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
/* CHARTE : tableaux .data-table = en-tête marine + lignes zébrées + compact
   (relooke d'un coup toutes les pages qui réutilisent cette classe). */
.data-table th {
    background-color: #1A3553;
    color: #e7edf6;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 11px 16px;
    border-bottom: none;
    text-align: left;
}
.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
    color: #1e293b;
    vertical-align: middle;
}
.data-table tbody tr:nth-child(even) td { background-color: #f6f9fc; }
.data-table tr:hover td {
    background-color: #eaf1fb;
}

/* CHARTE — lisibilité des en-têtes sur barre marine.
   Beaucoup de tableaux posent la couleur du texte sur la LIGNE d'en-tête (tr)
   à fond marine, pas sur chaque th : la règle globale « th { color } » l'écrasait
   -> libellés NOIRS sur fond bleu-nuit. On force le th à hériter de la couleur
   de sa ligne (qui est claire). De même, les titres de panneaux/modales (h2)
   étaient repeints en foncé par la règle globale « h2 { color } » : on les fait
   hériter de la couleur (blanche) de leur bandeau. */
tr[style*="1A3553"] th,
tr[style*="1a3553"] th { color: inherit; }
.panel__title,
.bd-modal-title { color: inherit; }

/* ─────────────────────────────────────────────────────────────────────────
   REPÈRE MODE D'EXPÉDITION (anti-erreur Maritime / Aérien)
   Cadre coloré tout autour de l'écran + libellé dans le coin + teinte TRÈS
   légère de la zone de travail. Piloté par html[data-ship-mode] (posé par
   auth-guard). Bleu = Maritime 🚢, Violet = Aérien ✈️ (mêmes couleurs que le
   bouton de bascule). Le cadre est en périphérie (bords libres) : il n'ajoute
   RIEN dans l'en-tête déjà chargé. pointer-events:none -> ne gêne aucun clic.
   ───────────────────────────────────────────────────────────────────────── */
html[data-ship-mode="maritime"] { --ship-color: #0369a1; --ship-tint: #eef5fb; --ship-label: "\1F6A2  MARITIME"; }
html[data-ship-mode="aerien"]   { --ship-color: #7c3aed; --ship-tint: #f4f0fc; --ship-label: "\2708\FE0F  AÉRIEN"; }

html[data-ship-mode]::before {
    content: '';
    position: fixed; inset: 0; z-index: 10000; pointer-events: none;
    border: 6px solid var(--ship-color);
}
html[data-ship-mode]::after {
    content: var(--ship-label);
    position: fixed; left: 0; bottom: 0; z-index: 10001; pointer-events: none;
    background: var(--ship-color); color: #fff;
    font-family: 'Comfortaa', 'Jost', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .05em;
    padding: 6px 12px 6px 10px; border-radius: 0 12px 0 0;
    box-shadow: 0 -4px 14px -6px rgba(0,0,0,.35);
}
/* Teinte légère de la zone de travail (n'écrase pas le fond de branding, qui
   s'applique au <body> via --bg-body). */
html[data-ship-mode] .main-content { background-color: var(--ship-tint); }

@media (max-width: 768px) {
    html[data-ship-mode]::before { border-width: 4px; }
    html[data-ship-mode]::after { font-size: 11px; padding: 5px 10px 5px 8px; }
}
/* Mode intégré (webview de l'app mobile) : pas de cadre ni de teinte. */
html:has(body.embed-mode)::before, html:has(body.embed-mode)::after { content: none; border: none; box-shadow: none; }
html:has(body.embed-mode) .main-content { background-color: transparent; }

/* ─────────────────────────────────────────────────────────────────────────
   TABLEAUX COMPACTS sur petits écrans de bureau (12–15", zoom 100%).
   Densifie police + espacements (au-dessus du seuil mobile 768px, jusqu'à un
   écran large) pour que TOUTES les colonnes rentrent sans réduire le zoom.
   Préfixe `body` = gagne sur les styles par classe, quel que soit l'ordre.
   (La barre latérale est repliée automatiquement par app.js sur ces écrans.)
   ───────────────────────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1600px) {
    /* Gouttières au strict minimum -> on rend ces ~50 px à la zone des tableaux. */
    body .content-container { padding-left: 10px; padding-right: 10px; }
    body .factures-table-header { padding: 12px 14px; }
    /* Cellules denses. */
    body th, body td { padding: 5px 6px; font-size: 12px; }
    body .data-table th, body .factures-table th, body .reg-table th,
    body .am__table th, body .chauffeurs-table th, body .modal-table th {
        padding: 7px 6px; font-size: 10.5px; letter-spacing: 0;
    }
    body .data-table td, body .factures-table td, body .reg-table td,
    body .am__table td, body .chauffeurs-table td, body .modal-table td {
        padding: 5px 6px; font-size: 12px;
    }
    body .status-badge, body .badge, body .meta-tag, body .factures-count-badge { font-size: 10px; padding: 2px 6px; }
    body .row-actions { gap: 4px; }
    body .row-actions .icon-btn { padding: 4px 6px; font-size: 13px; }
}

/* --- STYLES SPÉCIFIQUES --- */
.tag { color: white; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: bold; display: inline-block; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.perc { font-size: 0.9em; color: #ff6b6b; font-weight: bold; }

/* --- DASHBOARD (TOTAUX) --- */
.dashboard-container { 
    background: var(--glass-bg);
    border: none; box-shadow: var(--shadow-md);
    padding: 15px; border-radius: var(--card-radius); 
}
.totals-container { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.total-card { 
    flex-grow: 1; background: #fff;
    border-radius: 10px; padding: 10px 12px;
    text-align: center; border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    cursor: pointer;
}
.total-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.total-card h3 { margin-top: 0; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.total-card p { margin-bottom: 0; font-size: 19px; font-weight: 700; color: var(--text-main); }

/* Bouton Actualiser Stats */
.btn-refresh-stats {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-refresh-stats:hover { background-color: #bae6fd; }
.btn-refresh-stats:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- DASHBOARD MODERNISATION (SaaS Style) --- */
.modern-dashboard {
    padding: 25px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.dashboard-header-modern {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap; gap: 15px;
}
.header-titles h2 { margin: 0; font-size: 24px; color: #0f172a; text-align: left; font-weight: 800; letter-spacing: -0.5px; }
.header-titles p { margin: 5px 0 0 0; color: #64748b; font-size: 14px; }

.filter-controls-modern {
    display: flex; align-items: center; gap: 12px;
    background: #f8fafc; padding: 8px 16px;
    border-radius: 12px; border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.date-filter-modern { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; color: #64748b; }
.date-filter-modern input[type="date"] { 
    border: none; background: #ffffff; color: #0f172a; 
    padding: 6px 10px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 600; cursor: pointer;
}
.btn-modern-reset { 
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; 
    width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; 
    color: #ef4444; font-weight: bold; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-modern-reset:hover { background: #ef4444; color: white; border-color: #ef4444; transform: rotate(180deg); }

.kpi-section-title {
    font-size: 16px; color: #1e293b; margin: 0 0 15px 0;
    display: flex; align-items: center; gap: 10px; font-weight: 700;
    letter-spacing: -0.3px;
}
.kpi-section-title span.icon-bg {
    background: #f1f5f9; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 16px; border: 1px solid #e2e8f0;
}

/* Redéfinition des cartes pour le look SaaS */
.totals-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 20px !important;
}
.total-card {
    position: relative; overflow: hidden; text-align: left !important;
    padding: 20px 24px !important; border-radius: 16px !important; border: none !important;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05) !important;
    display: flex; flex-direction: column; justify-content: space-between; z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.total-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15), 0 8px 10px -6px rgba(0,0,0,0.1) !important;
}
.total-card h3 { font-size: 14px !important; opacity: 0.9; margin-bottom: 10px !important; text-transform: none !important; font-weight: 600; letter-spacing: -0.3px; }
.total-card p { font-size: 26px !important; font-weight: 800 !important; letter-spacing: -1px; margin: 0; }

/* Filigranes décoratifs ($, ATM, colis…) retirés : look plus net et moderne. */
.card-watermark { display: none !important; }
.card-subtext { display: block; font-size: 12px; opacity: 0.85; margin-top: 8px; font-weight: 500; }

@media (min-width: 768px) {
    .span-2 { grid-column: span 2; }
}

/* COULEURS GRANDS TOTAUX DASHBOARD — palette SÉMANTIQUE cohérente (marque AMT).
   Marine = totaux/solde · Vert = entrées · Rouge = dépenses · Ambre = en attente · Ardoise = neutre. */
#card-percu { background: linear-gradient(135deg, #24496f 0%, #1A3553 100%) !important; }        /* total -> marine */
#card-other { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important; }          /* entrée -> teal */
#card-depenses { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important; }       /* dépense -> rouge */
#card-caisse-especes { background: linear-gradient(135deg, #059669 0%, #047857 100%) !important; } /* cash -> émeraude */
#card-solde-banque { background: linear-gradient(135deg, #24496f 0%, #1A3553 100%) !important; }   /* solde -> marine */
#card-caisse-euros { background: linear-gradient(135deg, #334d6e 0%, #1f3a5f 100%) !important; }   /* € -> marine acier */
#card-reste { background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important; }          /* en attente -> ambre */
#card-retraits { background: linear-gradient(135deg, #475569 0%, #334155 100%) !important; }       /* retrait -> ardoise */
#card-depots { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important; }         /* dépôt -> teal */
#card-operations { background: linear-gradient(135deg, #475569 0%, #334155 100%) !important; }     /* neutre -> ardoise */
#card-other-cash { background: linear-gradient(135deg, #059669 0%, #047857 100%) !important; }     /* entrée cash -> émeraude */
#card-sorties-cash { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important; }   /* sortie -> rouge */

.card-positif { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; border: none !important; }
.card-negatif { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important; border: none !important; }

/* Texte blanc pour le contraste */
.total-card.colored-card h3, .total-card.colored-card p, .total-card.colored-card span, .total-card.colored-card div,
.card-positif h3, .card-positif p, .card-positif div,
.card-negatif h3, .card-negatif p, .card-negatif div {
    color: #ffffff !important;
}
.total-card.colored-card { border: none !important; }

/* Ajustement layout sous-titre Paris */
#grandTotalParisHidden { display: block; font-size: 0.75em; margin-top: 4px; font-weight: 500; }

.reste-positif { color: var(--success) !important; } /* Vert */
.reste-negatif { color: var(--danger) !important; } /* Rouge */

.text-red { color: var(--danger) !important; font-weight: bold; }
.text-orange { color: var(--warning) !important; font-weight: bold; }
.text-blue-sub { display: block; font-size: 0.75em; color: var(--primary); margin-top: 4px; font-weight: 500; }

/* --- FILTRES --- */
.filter-container { 
    background: white; 
    padding: 15px; 
    border-radius: var(--radius); 
    flex-grow: 1; 
    border: 1px solid var(--border-color); 
    box-shadow: var(--shadow-sm); 
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.filter-fields { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-fields label { 
    font-weight: 600; font-size: 11px; color: var(--text-muted); 
    text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px;
}
.filter-fields input[type="date"], 
.filter-fields select,
.filter-fields input[type="text"] { 
    padding: 6px 10px; width: auto; height: 36px; 
    border: 1px solid var(--border-color); border-radius: 6px;
    background-color: #f8fafc; color: var(--text-main);
    font-size: 13px; transition: all 0.2s;
}
.filter-fields input:focus, .filter-fields select:focus {
    border-color: var(--primary); background-color: white;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}
.filter-fields button { 
    padding: 8px 16px; font-size: 12px; font-weight: 600;
    border-radius: 6px; border: 1px solid var(--border-color);
    background: white; color: var(--text-muted);
    cursor: pointer; transition: all 0.2s;
}
.filter-fields button:hover {
    background: #f1f5f9; color: var(--text-main); border-color: #cbd5e1;
}

.history-controls { 
    background: white;
    padding: 15px; border-radius: var(--radius); 
    border: 1px solid var(--border-color);
    margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.history-controls .filter-grid { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; align-items: flex-end; }
.date-filter-group { display: flex; align-items: center; gap: 8px; background: #f8fafc; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border-color); height: 36px; }
.date-filter-group span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.date-filter-group input[type="date"] { border: none; font-size: 13px; background: transparent; color: var(--text-main); outline: none; padding: 0; height: auto; box-shadow: none; }

.checkbox-container { justify-self: start; padding: 5px; font-size: 12px; }
.daily-summary { 
    display: flex; justify-content: space-around; gap: 10px; margin-top: 15px; padding: 10px; 
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 8px; flex-wrap: wrap; 
}
.summary-item h4 { margin: 0 0 3px 0; font-size: 12px; color: var(--text-muted); }
.summary-item span { font-size: 16px; }

/* --- MODALE --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-content { 
    background: #fff; /* Fond blanc Light Mode */
    border: none;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    color: var(--text-main);
    margin: 5% auto; padding: 25px; width: 90%; max-width: 500px; border-radius: 16px; 
    max-height: 85vh; /* Limite la hauteur à 85% de l'écran */
    overflow-y: auto; /* Active le scroll à l'intérieur du modal */
}
/* Fond opaque pour les en-têtes sticky dans les modales */
.modal-content th {
    background-color: #e2e8f0;
}
/* ════════════════════════════════════════════════════════════════════════
   CORRECTIF GLOBAL — en-têtes de tableau collants dans les modales.
   La règle « thead { position:sticky; top:0 } » (plus haut) rend TOUS les
   en-têtes collants. Combinée au padding-HAUT d'un corps de modale défilant,
   des lignes « remontaient » AU-DESSUS de l'en-tête (« padding décalé »).
   -> Dans une modale, le conteneur qui enveloppe DIRECTEMENT un tableau ne doit
   pas avoir de padding-haut : l'en-tête colle alors proprement tout en haut.
   Seul le padding HAUT est retiré (côtés/bas conservés). :has() = OK sur les
   navigateurs récents (appli interne, ordinateur).
   ════════════════════════════════════════════════════════════════════════ */
.modal-content:has(> table),
.modal-content div:has(> table),
.bd-modal-box div:has(> table),
.amt-modal div:has(> table),
.modal--detail div:has(> table) { padding-top: 0 !important; }
/* Sécurité : l'en-tête collant garde un fond opaque partout (rien ne transparaît). */
.modal-content thead th, .bd-modal-box thead th, .amt-modal thead th { background-clip: padding-box; }
.history-list li { padding: 10px 0; font-size: 13px; border-bottom: 1px solid #f1f5f9; }

/* --- SUPPRESSION --- */
.deleted-row td { background-color: rgba(255,0,0,0.05) !important; text-decoration: line-through; color: #666; }
.deleted-row .deleteBtn, .deleted-row .editBtn { display: none; }

/* Classes couleurs agents/communes (exemple compact) */
.abobo{background-color:#dc3545}.anyama{background-color:#ffc107;color:#333}.autres-communes{background-color:#6c757d}.cocody{background-color:#007bff}.entrepot{background-color:#6f42c1}.yopougon{background-color:#28a745}.adboul-paris{background-color:#FF6347}.ali-paris{background-color:#4682B4}.autres-paris{background-color:#999999}.aziz{background-color:#8A2BE2}.bakary-paris{background-color:#5F9EA0}.cesar{background-color:#D2691E}.cheick-paris{background-color:#6495ED}.constant{background-color:#DC143C}.coulibaly-traore-mah{background-color:#008B8B}.demba-paris{background-color:#B8860B}.drissa-paris{background-color:#006400}.fatim-paris{background-color:#FF8C00}.hamza{background-color:#8B008B}.jb{background-color:#556B2F}.julien{background-color:#FF1493}.kady-paris{background-color:#483D8B}.maley{background-color:#2F4F4F}.males{background-color:#00CED1}.mohamed-paris{background-color:#9400D3}.moussa-paris{background-color:#191970}.salif{background-color:#CD5C5C}.samba{background-color:#20B2AA}.toure{background-color:#6A5ACD}.aziz-om{background-color:#343a40}.aziz-wave{background-color:#495057}.aziz-sys{background-color:#6c757d}.jb-om{background-color:#9c27b0}.jb-wave{background-color:#673ab7}.jb-sys{background-color:#3f51b5}
.saisi-par {
    display: block;
    font-size: 11px;
    color: #6c757d; /* Gris */
    margin-top: 4px;
    font-style: italic;
}

/* Scrollbar Premium */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

/* --- AMÉLIORATION SCROLL --- */
/* On rétablit le scroll naturel de la page */
html { height: 100%; }
body { min-height: 100vh; overflow-y: auto; overflow-x: hidden; }

/* --- GRAPHIQUES --- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.chart-card {
    background: white;
    border: none; border-radius: var(--card-radius);
    padding: 15px;
    box-shadow: var(--glass-shadow);
    min-height: 300px;
}
.chart-card h3 { margin-top: 0; color: var(--text-muted); font-size: 14px; text-transform: uppercase; text-align: center; margin-bottom: 15px; }

/* --- AMÉLIORATION TABLEAU CONTENEUR --- */
/* Rend les lignes du tableau conteneur cliquables */
#containerSummaryTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}
#containerSummaryTable tbody tr:hover {
    background-color: #eff6ff; /* Bleu très clair au survol */
}

/* --- STYLE DU NOUVEAU MODAL (Détails Conteneur) --- */
.modal-lg {
    max-width: 95% !important; /* Modal plus large pour le tableau */
    width: 900px !important;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center; color: var(--text-main); font-weight: 700; font-size: 18px;
    border-bottom: 1px solid var(--glass-border);
    /* position: static (et non sticky) : avec la marge negative -25px + le padding
       du modal-content, le sticky decalait l'en-tete de 25px au scroll/focus et
       masquait la 1re ligne de contenu. En static, l'en-tete reste en haut sans decalage. */
    position: static;
    background-color: #fff;
    z-index: 110;
    margin: -25px -25px 15px -25px;
    padding: 20px 25px 15px 25px;
    border-radius: 16px 16px 0 0;
}
.close-modal {
    font-size: 24px; font-weight: bold; cursor: pointer; color: #aaa;
}
.close-modal:hover { color: #000; }

/* --- BOUTON DÉCONNEXION --- */
#logoutBtn, .logout-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin-left: 10px;
    font-size: 12px;
}
#logoutBtn:hover, .logout-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* --- MENU UTILISATEUR (HEADER) --- */
.user-info { display: flex; align-items: center; gap: 15px; }
.user-avatar {
    width: 40px; height: 40px; background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.user-dropdown-container { position: relative; }
.user-dropdown-menu {
    position: absolute; right: 0; top: 110%; background: white; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); min-width: 180px; padding: 8px 0;
    display: flex; flex-direction: column; opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: all 0.3s ease; z-index: 1000;
}
.user-dropdown-container:hover .user-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.user-dropdown-menu a {
    padding: 10px 20px; color: #334155; text-decoration: none; font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px; transition: background 0.2s; border: none; box-shadow: none;
}
.user-dropdown-menu a:hover { background: #f8fafc; color: #3b82f6; transform: none; }

/* Priorité sur l'ancien style #logoutBtn blanc */
.user-dropdown-menu a.logout, .user-dropdown-menu a#logoutBtn { color: #ef4444; background: transparent; border: none; padding: 10px 20px; margin: 0; font-size: 14px; font-weight: 500; justify-content: flex-start; }
.user-dropdown-menu a.logout:hover, .user-dropdown-menu a#logoutBtn:hover { background: #fef2f2; color: #dc2626; transform: none; }

/* --- CHOICES.JS (SÉLECTEUR AGENTS) --- */
/* Adaptation Light Mode */
.choices { margin-bottom: 0; }
.choices__inner {
    background-color: #f8fafc !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    color: var(--text-main) !important;
    min-height: 36px;
    font-size: 13px;
}
.choices__input { background-color: transparent !important; color: var(--text-main) !important; margin-bottom: 0 !important; }
.choices__list--dropdown {
    background-color: #fff !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow-lg) !important;
}
.choices__item--choice { color: var(--text-main) !important; }
.choices__item--choice.is-highlighted { background-color: #f1f5f9 !important; color: var(--primary) !important; }

/* Page de Connexion */
body.login-page {
    background: #1e293b;
}

/* --- MODIFICATION AGENT MM (Lisibilité) --- */ 
.mm-tag {
    color: #1e293b !important; /* Texte Noir/Gris foncé */
    background-color: #f1f5f9; /* Fond Gris très clair par défaut */
    border: 1px solid #cbd5e1;
}
/* Surcharge des couleurs spécifiques pour les rendre pastels (compatibles texte noir) */
.aziz-om { background-color: #e2e8f0 !important; border-color: #94a3b8; }
.aziz-wave { background-color: #f8fafc !important; border-color: #cbd5e1; }
.aziz-sys { background-color: #cbd5e1 !important; border-color: #64748b; }
.jb-om { background-color: #f3e8ff !important; border-color: #d8b4fe; }
.jb-wave { background-color: #ede9fe !important; border-color: #c4b5fd; }
.jb-sys { background-color: #e0e7ff !important; border-color: #a5b4fc; }

/* --- RESPONSIVE MOBILE (Livreurs) --- */
@media (max-width: 768px) {
    /* Inversion de l'affichage principal */
    #desktop-view { display: none !important; }
    #mobile-view { display: block !important; padding-bottom: 70px; }

    /* --- STYLES SPA LIVREUR (MOBILE) --- */
    .mob-header { background: linear-gradient(135deg, var(--secondary, #1e293b) 0%, var(--primary, #334155) 100%); color: white; padding: 15px; text-align: center; border-radius: 0 0 16px 16px; margin-bottom: 15px; margin: -10px -10px 15px -10px; position: relative;}
    .mob-header h2 { margin: 0; font-family: 'Comfortaa', sans-serif; font-size: 18px; color: white; line-height: 30px;}
    
    .mob-summary { display: flex; gap: 8px; padding: 0 5px; margin-bottom: 15px; }
    .mob-stat { flex: 1; background: white; padding: 10px 5px; border-radius: 12px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; }
    .mob-stat span { display: block; font-size: 10px; color: #64748b; text-transform: uppercase; margin-bottom: 3px; font-weight: bold;}
    .mob-stat b { font-size: 14px; color: #0f172a; display: block; word-break: break-word;}
    
    .mob-card { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin: 0 5px 15px 5px; border: 1px solid #e2e8f0; }
    .mob-card h3 { margin-top: 0; margin-bottom: 15px; font-size: 16px; color: #1e293b; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; text-align: left; }
    .mob-card input, .mob-card select { width: 100%; margin-bottom: 12px; padding: 14px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 16px; box-sizing: border-box; background: #f8fafc; color: #0f172a; font-weight: 600;}
    .mob-card input:focus, .mob-card select:focus { border-color: #4f46e5; outline: none; background: white; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
    
    .mob-btn { width: 100%; padding: 16px; border-radius: 8px; font-weight: bold; font-size: 16px; border: none; cursor: pointer; transition: 0.2s; }
    .mob-btn-primary { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); color: white; box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2); }
    .mob-btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2); }
    .mob-btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2); }
    
    .mob-list-item { background: white; margin: 0 5px 10px 5px; padding: 12px 15px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
    .mob-list-item strong { font-size: 15px; color: #1e293b; }
    .mob-list-item-actions button { background: none; border: none; font-size: 18px; padding: 5px; margin-left: 5px; cursor: pointer; }
    
    .mob-bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: white; display: flex; border-top: 1px solid #e2e8f0; padding-bottom: env(safe-area-inset-bottom); z-index: 1000; box-shadow: 0 -4px 10px rgba(0,0,0,0.05); }
    .mob-nav-item { flex: 1; text-align: center; padding: 15px 0; font-size: 13px; font-weight: bold; color: #64748b; cursor: pointer; transition: 0.2s; text-transform: uppercase; letter-spacing: 0.5px;}
    .mob-nav-item.active { color: #4f46e5; border-top: 3px solid #4f46e5; background: #f8fafc; }

    /* Onglets Saisie/Dépenses EN HAUT (remplacent l'ancien nav fixe en bas
       qui masquait la navigation globale Accueil/Caisse/Livraison/Menu). */
    .mob-top-tabs { display: flex; gap: 8px; margin-bottom: 15px; }
    .mob-top-tab { flex: 1; padding: 12px; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; color: #64748b; }
    .mob-top-tab.active { background: #1e293b; color: #fff; border-color: #1e293b; }

        /* (Ancien hamburger off-canvas SUPPRIMÉ : il surchargeait .mobile-toggle en
           position:absolute / z-index:10002 et ciblait .navigation/.mobile-overlay
           qui n'existent plus -> conflit avec le top-bar et le menu .sidebar moderne.
           Le menu .sidebar + #sidebarOverlay gèrent tout le responsive désormais.) */
        
        /* Adaptation Mobile pour les Dropdowns (Tiroir) */
        .nav-menu { flex-direction: column !important; width: 100%; }
        .nav-menu > li { width: 100%; display: flex; flex-direction: column; }
        .has-dropdown > a::after { display: none; } /* Masquer la flèche sur mobile */
        /* Toujours afficher les sous-menus en mobile, avec une indentation */
        .dropdown { position: static !important; display: flex !important; box-shadow: none !important; border: none !important; margin: 0 !important; padding: 0 0 0 15px !important; background: transparent !important; }
        .dropdown a { padding: 10px 15px !important; font-size: 14px !important; border-bottom: none !important; }

    /* Sous-menus (Arrivages, etc.) */
    .sub-nav { overflow-x: auto; white-space: nowrap; justify-content: flex-start; padding-bottom: 10px; }

    /* Formulaires : Tout en une seule colonne pour faciliter la saisie */
    .form-grid { grid-template-columns: 1fr !important; gap: 15px; }
    
    /* Inputs plus hauts pour le tactile (doigts) */
    input, select, button { min-height: 48px; font-size: 16px; /* 16px évite le zoom auto sur iPhone */ }
    
    /* Ajustement Choices.js mobile */
    .choices__inner { min-height: 48px; font-size: 16px; display: flex; align-items: center; }
    
    /* Filtres Historique empilés */
    .history-controls .filter-grid { flex-direction: column; align-items: stretch; }
    .date-filter-group { width: 100%; justify-content: space-between; box-sizing: border-box; margin: 5px 0; }
    #smartSearch { width: 100%; margin-bottom: 5px; }
    
    /* Tableaux : Police plus petite mais lisible */
    th, td { padding: 10px 5px; font-size: 12px; white-space: nowrap; }
    
    /* Résumés journaliers (Saisie) */
    .daily-summary { flex-direction: column; gap: 15px; }
    .summary-item { display: flex; justify-content: space-between; width: 100%; border-bottom: 1px solid #eee; padding-bottom: 5px; }
    
    /* Ajustement grille dépenses livreur spécifique */
    #caisseForm .form-grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    .form-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

    /* --- WIZARD MOBILE (SAISIE CAISSE) --- */
    .desktop-only-title { display: none !important; }
    .mobile-progress-bar { display: flex; justify-content: space-between; background: #f1f5f9; border-radius: 12px; padding: 6px; margin-bottom: 25px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); }
    .step-indicator { flex: 1; text-align: center; padding: 10px 5px; font-size: 12px; font-weight: bold; color: #64748b; border-radius: 8px; transition: 0.3s; }
    .step-indicator.active { background: #4f46e5; color: white; box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2); }
    .step-indicator.completed { color: #4f46e5; background: #e0e7ff; }
    
    .btn-scan { display: flex; width: 100%; justify-content: center; align-items: center; background: #e0f2fe; color: #0369a1; border: 2px dashed #bae6fd; padding: 15px; border-radius: 8px; font-size: 16px; font-weight: bold; margin-top: 10px; cursor: pointer; }
    
    .step-nav { display: flex !important; justify-content: space-between; margin-top: 20px; gap: 10px; }
    .btn-prev, .btn-next { display: block; padding: 15px !important; font-size: 16px !important; flex: 1; text-align: center; }
    
    #caisseForm.mobile-step-1 .step-2, #caisseForm.mobile-step-1 .step-3 { display: none !important; }
    #caisseForm.mobile-step-2 .step-1, #caisseForm.mobile-step-2 .step-3 { display: none !important; }
    #caisseForm.mobile-step-3 .step-1, #caisseForm.mobile-step-3 .step-2 { display: none !important; }
    #caisseForm.mobile-step-1 #finalSubmitWrapper, #caisseForm.mobile-step-2 #finalSubmitWrapper { display: none !important; }
    
    #caisseForm input, #caisseForm select { padding: 15px !important; font-size: 18px !important; min-height: 54px; }
    #addEntryBtn { padding: 18px !important; font-size: 18px !important; width: 100%; }
    
    .summary-card { display: block; background: #fff; border: 2px dashed #cbd5e1; padding: 25px 20px; text-align: center; border-radius: 12px; margin-bottom: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
}

/* ── MOBILE FIRST PWA (APP PARIS) ── */
@media (max-width: 768px) {
    /* Main content : libérer l'espace en bas pour la Bottom Nav */
    .main-content { padding-bottom: 80px !important; }

    /* Topbar mobile : plus compacte */
    .top-bar { padding: 10px 14px; min-height: 60px; }
    .page-title { font-size: 18px; }
    
    /* Padding réduit pour maximiser l'espace écran */
    .content-container { padding: 15px 10px; }

    /* ── BOTTOM NAVIGATION ── */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 65px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid #e2e8f0;
        z-index: 990; /* Sous les modales (1000) */
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: #94a3b8;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
        border: none;
        background: none;
        font-family: inherit;
    }

    .bottom-nav-item i { font-size: 20px; transition: transform 0.2s; }
    .bottom-nav-item.active { color: #3b82f6; }
    .bottom-nav-item.active i { transform: translateY(-2px); }

    .bottom-nav-item .nav-badge {
        position: absolute;
        top: 6px; right: calc(50% - 20px);
        background: #ef4444; color: white;
        font-size: 10px; font-weight: 700;
        border-radius: 10px;
        padding: 2px 5px;
        min-width: 18px; text-align: center;
        box-shadow: 0 2px 4px rgba(239,68,68,0.3);
    }

    /* ── FAB (Floating Action Button) ── */
    .fab-btn {
        position: fixed;
        bottom: 85px; right: 16px;
        width: 56px; height: 56px;
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        border-radius: 50%;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        z-index: 980;
        box-shadow: 0 6px 16px rgba(59,130,246,0.4);
        display: flex; align-items: center; justify-content: center;
        transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .fab-btn:active { transform: scale(0.9); }

    /* Bouton « retour en haut » : REMONTÉ au-dessus de la barre du bas et du FAB
       (à bottom:20px il recouvrait l'item « Menu » de la barre du bas). */
    #backToTopBtn { bottom: 150px !important; right: 16px !important; }

    /* ☰ de l'en-tête masqué sur mobile : le bouton « Menu » de la barre du bas
       ouvre déjà le tiroir latéral (doublon inutile). Le web PC garde son ☰. */
    .top-bar .mobile-toggle { display: none !important; }

    /* Badge de mode (bas-gauche) masqué sur mobile : il recouvrait la barre du
       bas, et le mode est déjà indiqué dans l'en-tête (bouton Maritime/Aérien). */
    html[data-ship-mode]::after { display: none !important; }

    /* « Nettoyer Doublons » (bas-gauche) : REMONTÉ au-dessus de la barre du bas
       (à bottom:20px il la recouvrait). */
    #btnCleanDuplicates { bottom: 80px !important; left: 12px !important; }

    /* ── MODALES : Bottom Sheet Style ── */
    .modal-content {
        margin: auto auto 0 auto !important; /* Force en bas */
        border-radius: 20px 20px 0 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 25px 20px 40px 20px !important;
        animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    @keyframes slideUpModal { from { transform: translateY(100%); } to { transform: translateY(0); } }

    /* ── RESPONSIVE : grilles & barres qui débordaient sur téléphone ── */
    /* Graphiques : une colonne pleine largeur (minmax(400px) débordait). */
    .charts-grid { grid-template-columns: 1fr !important; gap: 15px !important; }
    /* Les <canvas> Chart.js restent dans leur carte. */
    .chart-card canvas, .chart-card { max-width: 100%; }
    /* Barre de stats Livraison : passe à la ligne au lieu de déborder. */
    .stats-bar { flex-wrap: wrap; gap: 12px; }
    .stat-item { border-right: none; min-width: 40%; flex: 1 1 40%; }
    /* Modales larges forcées (width:95%/max-width:1200px en inline) -> pleine largeur. */
    .modal-content.modal-lg { width: 100% !important; max-width: 100% !important; }
    /* Filet de sécurité : toute grille inline multi-colonnes repasse en 1 colonne. */
    .charts-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

    /* ── TABLEAU DE BORD (en-tête + filtres date) ── */
    .modern-dashboard { padding: 15px 12px !important; box-shadow: none !important; }
    .dashboard-header-modern { margin-bottom: 18px; padding-bottom: 14px; }
    .header-titles h2 { font-size: 20px; }
    .header-titles p { font-size: 12.5px; }
    /* Le bloc de filtres prend toute la largeur et passe à la ligne. */
    .filter-controls-modern { width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 8px 10px; }
    .date-filter-modern { flex-wrap: wrap; gap: 6px; }
    .date-filter-modern input[type="date"] { flex: 1 1 120px; min-width: 0; }
    /* Cartes KPI : un peu plus compactes sur mobile. */
    .totals-container { gap: 12px !important; }
    .total-card { padding: 16px 18px !important; }
    .total-card p { font-size: 22px !important; }
    /* Les blocs internes des grandes cartes (encaissements / dépenses détaillés)
       s'empilent proprement au lieu de se serrer. */
    .total-card .card-subtext { margin-top: 4px; }

    /* ── TABLEAUX RÉCAP (Tableau de bord) : défilables au lieu d'être coupés ──
       Les tableaux .table dans les onglets n'ont pas de conteneur scrollable :
       on rend le tableau lui-même défilable horizontalement (le doigt fait
       glisser pour voir les colonnes de droite). */
    .tab-panel table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    /* En-tête non collant dans ce contexte (évite les artefacts de sticky
       dans un bloc à défilement horizontal). */
    .tab-panel table thead { position: static; }
}

/* ── TABLEAU DE BORD MOBILE : « résumé d'abord » ──
   Sur ordinateur, tout s'affiche (bouton masqué, .dash-secondary visible).
   Sur téléphone, seule la Performance Financière reste visible ; le reste
   (trésorerie, tableaux, graphiques) se déplie via le bouton. */
.dash-more-btn { display: none; }
.show-on-mobile { display: none; }
@media (max-width: 768px) {
    .dash-more-btn {
        display: block; width: 100%; margin: 2px 0 18px;
        padding: 12px 14px; border: 1px solid #F2A312;
        background: #fff8ec; color: #B8780A; font-weight: 700;
        border-radius: 12px; cursor: pointer; font-family: inherit; font-size: 14px;
        text-align: center;
    }
    .dash-more-btn.on { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
    .dash-secondary { display: none; }
    body.dash-show-details .dash-secondary { display: block; }

    /* ── Accès rapides (Tableau de bord Paris) : grille compacte 4 colonnes ──
       Petits boutons « icône d'app » pour occuper un minimum de hauteur. */
    .amt-quick-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 6px !important; margin-bottom: 20px !important; }
    .amt-quick { padding: 8px 3px !important; gap: 4px !important; border-radius: 11px !important; }
    .amt-quick .amt-quick-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
    .amt-quick-label { font-size: 9.5px; line-height: 1.15; }

    /* « Évolution Facturation » + « Dernières Factures » : une colonne pleine
       largeur (la grille minmax(400px) débordait en scroll horizontal). */
    .dash-2col { grid-template-columns: 1fr !important; gap: 14px !important; }
    .dash-2col > div { padding: 16px !important; }
    /* Graphique d'évolution : plus bas sur mobile pour voir les factures sans trop défiler */
    .dash-chart-box { height: 175px !important; }

    /* Utilitaire générique : grille à colonnes -> 1 colonne sur mobile
       (sans toucher au padding des enfants). */
    .resp-1col-mobile { grid-template-columns: 1fr !important; }

    /* Barres de contrôles (recherche + cases à cocher) : s'enroulent au lieu
       de déborder du cadre. L'input de recherche prend toute la largeur. */
    .history-controls { flex-wrap: wrap !important; gap: 10px !important; }
    .history-controls input[type="text"] { min-width: 0 !important; flex: 1 1 100%; box-sizing: border-box; }

    /* Confirmation : les 2 colonnes (liste sessions / détails) avaient des
       min-width (300/400px) qui débordaient l'écran -> pleine largeur empilée. */
    .confirm-col { min-width: 0 !important; max-width: none !important; flex-basis: 100% !important; }

    /* Dépenses Tréso : cases de catégories en grille 2 colonnes (au lieu de
       s'empiler verticalement). */
    .exp-stats-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .exp-stats-grid .stat-box { min-width: 0; }

    /* Bascule tableau (ordinateur) / fiches (mobile). */
    .hide-on-mobile { display: none !important; }
    .show-on-mobile { display: block; }

    /* ── FICHES COMMISSIONS (mobile) : 3 lignes compactes ──
       L1 : Partenaire (gras) + Statut
       L2 : Date · Type · Réf colis
       L3 : Montants (Base / Net en vert / Bonus en orange). */
    .comm-mob-card {
        border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
        padding: 10px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
    .comm-mob-l1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 5px; min-width: 0; }
    /* Le titre en gras se tronque (…) au lieu de forcer la largeur de la fiche
       sur les libelles longs (sinon la fiche deborde sur tres petit ecran). */
    .comm-mob-l1 strong { font-size: 15px; color: #0f172a; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .comm-mob-l2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #64748b; margin-bottom: 7px; }
    .comm-mob-l3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; border-top: 1px solid #f1f5f9; padding-top: 7px; }

    /* Boutons d'action dans les fiches (les regles globales sont scopees a
       "td button", donc sans effet hors tableau). */
    .comm-mob-card .editBtn { background-color: #007bff; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 700; }
    .comm-mob-card .deleteBtn { background-color: #dc3545; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 700; }
    /* Tags (agents, modes...) : fond lisible par defaut dans les fiches
       (.tag a color:white ; sans fond defini -> blanc sur blanc). */
    .comm-mob-card .tag { background-color: #475569; color: #fff; box-shadow: none; }

    /* Cartes FACTURES : format ULTRA-COMPACT validé (standard). Fiche pleine
       largeur séparée par un simple trait (pas d'ombre/coins), 3 lignes denses,
       actions en MICRO-ICÔNES en haut à droite (≥5 fiches par écran). */
    .comm-mob-card[data-invoice-id] { padding: 5px 12px; margin: 0; border: none; border-radius: 0; border-bottom: 1px solid #cbd5e1; box-shadow: none; }
    .comm-mob-card[data-invoice-id]:last-child { border-bottom: none; }
    .comm-mob-card[data-invoice-id] .fmob-l1 { display: flex; align-items: center; gap: 5px; margin-bottom: 1px; min-width: 0; }
    .comm-mob-card[data-invoice-id] .fmob-ref { font-weight: 900; font-size: 11.5px; color: #1A3553; padding: 0; flex-shrink: 0; }
    .comm-mob-card[data-invoice-id] .fmob-spacer { flex: 1; min-width: 4px; }
    .comm-mob-card[data-invoice-id] .status-badge { font-size: 8px; padding: 1px 6px; flex-shrink: 0; }
    .comm-mob-card[data-invoice-id] .fmob-actions { display: flex; gap: 0; flex-shrink: 0; }
    .comm-mob-card[data-invoice-id] .fmob-actions .icon-btn { width: 22px; height: 22px; min-width: 22px; padding: 0; border: none; background: transparent; color: #94a3b8; font-size: 11px; border-radius: 6px; }
    .comm-mob-card[data-invoice-id] .fmob-actions .icon-btn:hover { background: #f1f5f9; color: #1A3553; }
    .comm-mob-card[data-invoice-id] .fmob-l2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 1px; min-width: 0; }
    .comm-mob-card[data-invoice-id] .fmob-name { font-size: 11.5px; font-weight: 800; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .comm-mob-card[data-invoice-id] .fmob-amount { font-size: 11.5px; font-weight: 900; color: #0f172a; white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; padding: 0; }
    .comm-mob-card[data-invoice-id] .fmob-amount.is-zero { color: #94a3b8; font-weight: 700; }
    .comm-mob-card[data-invoice-id] .fmob-meta { font-size: 9.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* ─── FICHE COMPACTE RÉUTILISABLE « .fmob-card » (patron « Toutes les factures ») ───
       À utiliser pour rendre N'IMPORTE QUELLE liste en fiches denses sur mobile :
         <div class="fmob-list"> ... pour chaque ligne :
           <div class="fmob-card">
             <div class="fmob-l1"><span class="fmob-ref">REF</span> ...badges... <span class="fmob-spacer"></span> <span class="fmob-actions">…icônes…</span></div>
             <div class="fmob-l2"><span class="fmob-name">NOM</span> <span class="fmob-amount">VALEUR</span></div>
             <div class="fmob-meta">meta1 · meta2 · meta3</div>
           </div>
       Densité max, tout sur 2-3 lignes, méta en une ligne (ellipsis). */
    .fmob-list { display: block; }
    .fmob-card { padding: 6px 12px; border: none; border-bottom: 1px solid #e2e8f0; background: #fff; }
    .fmob-card:last-child { border-bottom: none; }
    .fmob-card .fmob-l1 { display: flex; align-items: center; gap: 5px; margin-bottom: 1px; min-width: 0; }
    .fmob-card .fmob-ref { font-weight: 900; font-size: 12px; color: #1A3553; padding: 0; flex-shrink: 0; background: none; border: none; font-family: inherit; cursor: pointer; }
    .fmob-card .fmob-spacer { flex: 1; min-width: 4px; }
    .fmob-card .status-badge, .fmob-card .fmob-badge { font-size: 8.5px; padding: 1px 6px; flex-shrink: 0; border-radius: 10px; font-weight: 800; }
    .fmob-card .fmob-actions { display: flex; gap: 2px; flex-shrink: 0; }
    .fmob-card .fmob-actions .icon-btn, .fmob-card .fmob-actions button { width: 24px; height: 24px; min-width: 24px; padding: 0; border: none; background: transparent; color: #94a3b8; font-size: 12px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
    .fmob-card .fmob-actions .icon-btn:hover, .fmob-card .fmob-actions button:hover { background: #f1f5f9; color: #1A3553; }
    .fmob-card .fmob-l2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 1px; min-width: 0; }
    .fmob-card .fmob-name { font-size: 12px; font-weight: 800; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .fmob-card .fmob-amount { font-size: 12px; font-weight: 900; color: #0f172a; white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
    .fmob-card .fmob-amount.is-zero { color: #94a3b8; font-weight: 700; }
    .fmob-card .fmob-meta { font-size: 10px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Masquer bottom-nav et FAB sur desktop */
@media (min-width: 769px) {
    .bottom-nav { display: none; }
    .fab-btn { display: none; }
}


/* --- INTEGRATION MODULE LIVRAISON --- */

/* Barre de statistiques (Dashboard Livraison) */
.stats-bar { display: flex; gap: 30px; align-items: center; margin-bottom: 20px; padding: 10px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-item { text-align: center; flex: 1; border-right: 1px solid #eee; }
.stat-item:last-child { border-right: none; }
.stat-number { font-size: 1.8em; font-weight: bold; color: var(--primary); }
.stat-label { font-size: 0.8em; opacity: 0.9; color: var(--text-muted); text-transform: uppercase; }

/* Onglets spécifiques Livraison */
.delivery-tabs { display: flex; background: white; padding: 0 10px; border-bottom: 1px solid #e0e0e0; margin-bottom: 15px; gap: 5px; }
.tab-btn { padding: 10px 20px; border: none; background: none; font-size: 13px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; text-decoration: none; }
.tab-btn:hover { background: #f8fafc; color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: #f1f5f9; }

/* Barre d'outils Livraison */
.toolbar { padding: 15px; background: #f8f9fa; border: 1px solid #e0e0e0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-radius: 8px; margin-bottom: 15px; }

/* Boutons génériques Livraison */
.btn { padding: 9px 16px; background: var(--primary); color: white; border: none; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: all 0.18s; text-decoration: none; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--warning); }
.btn-small { padding: 4px 10px; font-size: 11px; }
.btn input[type="file"] { display: none; }
/* .btn pose color:white ; sans cette règle, un bouton "btn btn-outline" (ex.
   Annuler) garde un texte blanc sur fond clair = illisible. On rétablit un
   style outline lisible globalement (l'app unifiée ne charge pas paris/css). */
.btn-outline { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.btn-outline:hover { background: #f1f5f9; border-color: #94a3b8; opacity: 1; }
/* Même problème pour la variante "ghost" (non définie globalement) : on force
   un texte foncé pour rester lisible sur fond clair/blanc. */
.btn--ghost { background: transparent; color: #475569; border: 1px solid #cbd5e1; }
.btn--ghost:hover { background: #f1f5f9; border-color: #94a3b8; opacity: 1; }

/* Badges de Statut */
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.status-attente { background: #fff3cd; color: #856404; }
.status-en-cours { background: #cce5ff; color: #004085; }
.status-livre { background: #d4edda; color: #155724; }
.status-incident { background: #fee2e2; color: #991b1b; }
.status-retour { background: #f3f4f6; color: #1f2937; }
.status-abandonne { background: #1e293b; color: #ffffff; } /* Slate 800 */

/* Badges Communes (Couleurs spécifiques) */
.commune-badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-cocody { background: #e3f2fd; color: #1565c0; }
.badge-abobo { background: #f3e5f5; color: #6a1b9a; }
.badge-yopougon { background: #fff3e0; color: #e65100; }
.badge-adjame { background: #e8f5e9; color: #2e7d32; }
.badge-koumassi { background: #fce4ec; color: #c2185b; }
.badge-marcory { background: #e0f2f1; color: #00695c; }
.badge-treichville { background: #fff3e0; color: #ef6c00; }
.badge-attecoube { background: #f3e5f5; color: #7b1fa2; }
.badge-port-bouet { background: #f3e5f5; color: #4a148c; }
.badge-bingerville { background: #fff9c4; color: #f57f17; }
.badge-songon { background: #e0f7fa; color: #006064; }
.badge-anyama { background: #f1f8e9; color: #33691e; }
.badge-plateau { background: #e1f5fe; color: #01579b; }
.badge-autre { background: #f5f5f5; color: #616161; }

/* Filtres Dropdown personnalisés */
.dropdown-filter { position: relative; display: inline-block; }
.dropdown-toggle { background: white; border: 1px solid #e0e0e0; padding: 8px 12px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-width: 200px; font-size: 13px; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: white; border: 1px solid #e0e0e0; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 10px; z-index: 100; min-width: 200px; max-height: 300px; overflow-y: auto; }
.dropdown-menu.show { display: block; }
.dropdown-menu label { display: flex; align-items: center; padding: 5px; cursor: pointer; font-size: 13px; }
.dropdown-menu input { width: auto; margin-right: 10px; height: auto; }

/* Tableaux Livraison */
.col-checkbox { width: 40px; text-align: center; }
.empty-state { text-align: center; padding: 40px; color: #999; }
.empty-state-icon { font-size: 3em; margin-bottom: 10px; }

/* Modales Livraison (Largeur spécifique) */
.modal-xl { max-width: 800px !important; width: 95%; }
/* Feuille de route : plus large sur ordinateur (10 colonnes) — reste responsive en 95% sur mobile. */
.fdr-modal-xl { max-width: 1250px !important; }
.preview-table { max-height: 300px; overflow-y: auto; margin: 15px 0; border: 1px solid #eee; }

/* Toast Notification */
.toast { position: fixed; bottom: 30px; right: 30px; padding: 15px 25px; border-radius: 8px; color: white; z-index: 3000; box-shadow: 0 5px 15px rgba(0,0,0,0.2); animation: slideIn 0.3s ease-out; }
.toast-success { background: #2ecc71; }
.toast-error { background: #e74c3c; }

/* --- STYLE CHECKBOX --- */
input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    margin: 0 5px 0 0;
    cursor: pointer;
    accent-color: var(--primary);
    vertical-align: middle;
    box-shadow: none !important;
}

/* --- BOUTON BACK-TO-TOP --- */
#backToTopBtn {
    display: none; /* Caché par défaut */
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 999;
    border: none;
    outline: none;
    background-color: var(--primary);
    color: white;
    cursor: pointer;
    padding: 0; /* Padding à zéro pour un cercle parfait */
    border-radius: 50%;
    width: 48px; /* Taille du bouton */
    height: 48px;
    font-size: 24px;
    line-height: 48px; /* Centrer l'icône verticalement */
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    transform: translateY(100px); /* Position initiale hors de l'écran */
}

#backToTopBtn.show {
    display: block;
    opacity: 1;
    transform: translateY(0); /* Apparition en glissant vers le haut */
}

#backToTopBtn:hover {
    background-color: var(--primary-hover);
}

/* --- BOUTON BACK-TO-TOP MODAL --- */
.modal-back-to-top {
    position: sticky;
    bottom: 20px;
    margin-left: auto;
    margin-right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
    display: block;
}

.modal-back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

/* --- AIDE & DESCRIPTION CONTEXTUELLE --- */
.tab-description {
    background-color: #f8fafc;
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}
.help-step {
    display: flex; gap: 15px; margin-bottom: 20px; align-items: flex-start;
}

/* --- CUSTOM APP MODALS (REMPLACEMENT ALERT/CONFIRM/PROMPT) --- */
.app-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px);
    z-index: 100000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-modal-overlay.active { opacity: 1; visibility: visible; }
.app-modal-box {
    background: #ffffff; border-radius: 20px; padding: 30px; width: 90%; max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: scale(0.9) translateY(20px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center; border: 1px solid rgba(255,255,255,0.2);
}
.app-modal-overlay.active .app-modal-box { transform: scale(1) translateY(0); }
/* Modale élargie (détail d'une catégorie de dépenses) : plus large sur
   ordinateur pour afficher confortablement le tableau. Sous 1024px, on garde
   la largeur responsive par défaut (width:90%). */
@media (min-width: 1024px) {
    .app-modal-box.app-modal-wide { max-width: 820px; }
}
.app-modal-icon { font-size: 52px; margin-bottom: 20px; animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.app-modal-title { margin: 0 0 12px 0; color: #0f172a; font-size: 20px; font-weight: 800; font-family: 'Comfortaa', sans-serif; }
.app-modal-message { margin: 0 0 25px 0; color: #475569; font-size: 15px; line-height: 1.6; }
.app-modal-input { width: 100%; padding: 12px 15px; border: 2px solid #e2e8f0; border-radius: 10px; margin-bottom: 25px; font-size: 16px; box-sizing: border-box; transition: all 0.2s; text-align: center; font-weight: bold;}
.app-modal-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79,70,229,0.1); }
.app-modal-actions { display: flex; justify-content: center; gap: 12px; }
.app-modal-btn { padding: 12px 20px; border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer; border: none; transition: all 0.2s; flex: 1; }
.app-modal-btn-cancel { background: #f1f5f9; color: #64748b; }
.app-modal-btn-cancel:hover { background: #e2e8f0; color: #0f172a; }
.app-modal-btn-confirm { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); color: white; box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2); }
.app-modal-btn-confirm:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3); }
.app-modal-btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2); }
.app-modal-btn-danger:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(239, 68, 68, 0.3); }
@keyframes bounceIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.help-icon {
    font-size: 20px; background: #e0f2fe; color: var(--primary);
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; flex-shrink: 0; font-weight: bold;
}
.help-content h4 { margin: 0 0 5px 0; color: var(--text-main); font-size: 14px; }
.help-content p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.help-arrow {
    text-align: center; font-size: 20px; color: #cbd5e1; margin-bottom: 10px;
}

/* ============================================
    SIDEBAR MODERNE (Global pour toutes les agences)
============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
    color: #ffffff;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding: 2px;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
    color: #ffffff;
}

.sidebar-header p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.sidebar-nav { padding: 20px 12px; }
.sidebar-category { margin-bottom: 12px; }

.sidebar-category-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7); padding: 8px 12px; font-weight: 700;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none;
}
.sidebar-category-title::after { content: "▼"; font-size: 10px; transition: transform 0.3s ease; }
.sidebar-category.collapsed .sidebar-category-title::after { transform: rotate(-90deg); }
.sidebar-category.collapsed .sidebar-item { display: none !important; }

.sidebar-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 10px; color: rgba(255, 255, 255, 0.9); text-decoration: none;
    font-size: 13px; font-weight: 500; transition: all 0.2s; margin-bottom: 2px; cursor: pointer;
}
.sidebar-item i { width: 20px; font-size: 14px; text-align: center; }
.sidebar-item:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-item.active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-weight: 700;
    border-left: 4px solid var(--accent);
    box-shadow: none;
    border-radius: 4px 12px 12px 4px;
}
.sidebar-item.active i { color: var(--accent); }

/* ============================================
    SIDEBAR RETRACTABLE (DESKTOP)
============================================ */
body.sidebar-collapsed .sidebar {
    width: 80px;
}
body.sidebar-collapsed .sidebar-header h2,
body.sidebar-collapsed .sidebar-header p,
body.sidebar-collapsed .sidebar-category-title,
body.sidebar-collapsed .sidebar-item span,
body.sidebar-collapsed .sidebar-item .badge {
    display: none !important;
}
body.sidebar-collapsed .sidebar-header {
    padding: 24px 10px;
    justify-content: center;
}
body.sidebar-collapsed .sidebar-logo {
    margin: 0;
}
body.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding: 15px 0;
}
body.sidebar-collapsed .sidebar-item i {
    width: auto;
    font-size: 20px;
}
body.sidebar-collapsed .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* --- MODALE PROGRAMME (Largeur étendue) --- */
#programDetailsModal .modal-content {
    max-width: 96% !important;
    width: 1360px;
}
/* ============================================================
   FEUILLE DE ROUTE — affichage ORDINATEUR amélioré (beaucoup de données).
   En-tête marine COLLANT (reste visible au défilement), lignes zébrées,
   survol, colonnes calibrées, champs éditables discrets. Charte AMT.
   Scopé à #programDetailsModal : ne change rien ailleurs.
   ============================================================ */
#programDetailsModal .preview-table { border: 1px solid #dbe3ec; border-radius: 12px; overflow: auto; }
#programDetailsModal #programDetailsTable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
#programDetailsModal #programDetailsTable thead th {
    position: sticky; top: 0; z-index: 5;
    background: #1A3553 !important; color: #fff;
    font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: .3px;
    padding: 10px 8px; text-align: left; white-space: nowrap;
    border-bottom: 3px solid #FDC615;
}
#programDetailsModal #programDetailsTable thead th.sortable { cursor: pointer; }
#programDetailsModal #programDetailsTable thead th.sortable:hover { background: #244a72 !important; }
#programDetailsModal #programDetailsTable tbody td { padding: 6px 8px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
#programDetailsModal #programDetailsTable tbody tr:nth-child(even) { background: #f7f9fc; }
#programDetailsModal #programDetailsTable tbody tr:hover { background: #fff7e0; }
#programDetailsModal #programDetailsTable tbody tr.delivered { background: #e9f8ee; }
#programDetailsModal #programDetailsTable tbody tr.delivered:hover { background: #dcf3e4; }
/* Largeurs : resserrer le petit, aérer l'utile (adresse & destinataire) */
#programDetailsModal #programDetailsTable th:nth-child(1),
#programDetailsModal #programDetailsTable td:nth-child(1) { width: 60px; }
#programDetailsModal #programDetailsTable td:nth-child(2) { font-weight: 700; color: #1A3553; white-space: nowrap; }
#programDetailsModal #programDetailsTable td:nth-child(3) { white-space: nowrap; }
#programDetailsModal #programDetailsTable th:nth-child(5),
#programDetailsModal #programDetailsTable td:nth-child(5) { min-width: 185px; }
#programDetailsModal #programDetailsTable th:nth-child(6),
#programDetailsModal #programDetailsTable td:nth-child(6) { min-width: 185px; }
#programDetailsModal #programDetailsTable th:nth-child(9),
#programDetailsModal #programDetailsTable td:nth-child(9) { width: 92px; }
#programDetailsModal #programDetailsTable th:nth-child(10),
#programDetailsModal #programDetailsTable td:nth-child(10) { width: 96px; text-align: center; }
#programDetailsModal #programDetailsTable th:nth-child(11),
#programDetailsModal #programDetailsTable td:nth-child(11) { width: 94px; }
/* Champs éditables : discrets dans la grille, nets au survol / focus */
#programDetailsModal #programDetailsTable .editable-cell { padding: 5px 7px; font-size: 12.5px; border-color: #e6ebf1; background: transparent; }
#programDetailsModal #programDetailsTable .editable-cell:hover { background: #fff; border-color: #cbd5e1; }
#programDetailsModal #programDetailsTable .editable-cell:focus { background: #fff; border-color: #F2A312; box-shadow: 0 0 0 2px rgba(242,163,18,.15); }
/* Sur très grand écran, on profite de la largeur */
@media (min-width: 1500px) { #programDetailsModal .modal-content { width: 1460px; } }
/* --- CLASSES SPÉCIFIQUES LIVRAISON REQUISES --- */
.search-filter { flex: 1; min-width: 250px; padding: 10px 15px; border: 2px solid #e0e0e0; border-radius: 6px; font-size: 14px; }
.search-filter:focus { outline: none; border-color: #667eea; }
select.search-filter { cursor: pointer; }
.dropdown-search { padding: 8px; border-bottom: 1px solid #e0e0e0; background: white; position: sticky; top: 0; z-index: 10; margin: -10px -10px 0 -10px; }
.dropdown-search input { width: 100%; padding: 8px; border: 1px solid #e0e0e0; border-radius: 4px; font-size: 13px; }
.dropdown-actions { padding: 8px 10px; border-bottom: 1px solid #e0e0e0; background: #f8f9fa; font-weight: 600; font-size: 12px; margin: 0 -10px; }
.dropdown-list-container { max-height: 200px; overflow-y: auto; margin: 0 -10px -10px -10px; padding: 5px 0; }
.table-container { overflow-x: auto; padding: 20px 30px; }
tbody tr.duplicate-row { background: #fff3cd; }
.duplicate-badge { color: #856404; font-weight: bold; font-size: 0.9em; }
tbody tr.delivered { background: #d4edda; }
tbody tr.delivered:hover { background: #c3e6cb; }
td.ref { font-weight: 600; color: #667eea; }
td.montant { font-weight: 600; color: #e74c3c; }
td.status { text-align: center; }
.actions { display: flex; gap: 5px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }
.loading { text-align: center; padding: 40px; color: #667eea; }
.loading-spinner { border: 4px solid #f3f3f3; border-top: 4px solid #667eea; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 20px; }
.editable-cell { width: 100%; padding: 6px; border: 1px solid #e0e0e0; border-radius: 4px; font-size: 13px; background-color: #fff; }
.editable-cell:focus { border-color: #667eea; outline: none; }

/* ============================================
    SIDEBAR MODERNE (Harmonisation Paris -> Abidjan)
============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
    color: #ffffff;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 20px rgba(0, 154, 68, 0.2);
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding: 2px;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
    color: #ffffff;
}

.sidebar-header p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.sidebar-nav { padding: 20px 12px; }
.sidebar-category { margin-bottom: 12px; }

.sidebar-category-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.sidebar-category-title::after {
    content: "▼";
    font-size: 10px;
    transition: transform 0.3s ease;
}

.sidebar-category.collapsed .sidebar-category-title::after {
    transform: rotate(-90deg);
}

/* ====== Badge "sessions non confirmées" (Confirmation + titre Entrées Caisse) ====== */
/* Pastille sur l'élément de menu « Confirmation » (span statique géré par app.js) */
#pendingSessionsBadge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: auto;
    box-shadow: 0 0 0 2px rgba(239,68,68,0.25);
}
#pendingSessionsBadge[data-count="0"] { display: none; }
/* Alerte sur le titre de section « Entrées Caisse » : ::before (libre — ::after = flèche accordéon),
   un pseudo-élément n'altère PAS title.textContent, donc app.js mappe toujours la catégorie. */
.sidebar-category-title[data-pending] { position: relative; }
.sidebar-category-title[data-pending]::before {
    content: attr(data-pending);
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

.sidebar-category.collapsed .sidebar-item {
    display: none !important;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
    cursor: pointer;
}

.sidebar-item i { width: 20px; font-size: 14px; text-align: center; }
.sidebar-item:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 700;
}

/* ── Menu latéral COMPACT (calé sur Yakri) ───────────────────────────────────
   Yakri : titre de catégorie 12px MAJ + item 13px (padding 7px 12px). On garde
   la charte marine mais on adopte cette densité. Le rendu réel dépend surtout de
   text-size-adjust (stop du gonflage mobile), déjà posé plus haut. */
.sidebar-header h2 { font-size: 16px; }
.sidebar-header p { font-size: 10px; }
.sidebar-nav { padding: 10px 8px; }
.sidebar-category { margin-bottom: 6px; }
.sidebar-category-title { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; padding: 7px 10px; }
.sidebar-category-title::after { font-size: 9px; }
.sidebar-item { font-size: 12.5px; font-weight: 500; padding: 7px 12px; gap: 10px; border-radius: 8px; }
.sidebar-item i { width: 18px; font-size: 12.5px; opacity: 0.9; }

/* ── Menu latéral MOBILE (hamburger) : encore plus compact ────────────────────
   Sur téléphone, on réduit nettement polices + espacements du menu (le réglage
   ci-dessus reste pour l'ordinateur). Ajuster ces valeurs pour + / - petit. */
@media (max-width: 768px) {
    .sidebar-header h2 { font-size: 14px; }
    .sidebar-header p { font-size: 8.5px; }
    .sidebar-nav { padding: 8px 8px; }
    .sidebar-category { margin-bottom: 4px; }
    .sidebar-category-title { font-size: 9.5px; letter-spacing: 0.03em; padding: 5px 10px; }
    .sidebar-category-title::after { font-size: 8px; }
    .sidebar-item { font-size: 11px; padding: 5px 10px; gap: 8px; border-radius: 7px; }
    .sidebar-item i { width: 15px; font-size: 11px; }
}

/* ============================================
    MAIN CONTENT & TOP BAR
============================================ */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s;
    width: calc(100% - 280px);
}

.top-bar {
    background: white; padding: 16px 30px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #e2e8f0; border-top: 4px solid var(--primary); position: sticky; top: 0; z-index: 200; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mobile-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: #1e293b; }
.page-title { font-size: 22px; font-weight: 700; color: #0f172a; letter-spacing: -0.3px; margin: 0; }

/* Barre du haut : disposition robuste indépendante de la jauge.
   La jauge (CBM) est masquée en mode aérien ; pour éviter que le bloc
   utilisateur (auparavant en position absolue) ne chevauche le titre, on
   le repasse en élément flex poussé à droite par margin-left:auto. Le
   titre reste à gauche, le bloc utilisateur à droite, avec OU sans jauge. */
.top-bar .user-info { position: static !important; right: auto !important; margin-left: auto; }
.top-bar .container-gauge-wrapper { margin-right: 0; }

.content-container { padding: 25px 30px; }

/* ── Densité globale du CONTENU (≈ -2 px sur le texte de toutes les pages) ────
   Les tailles de police sont écrites en px inline dans des centaines de vues :
   aucun réglage CSS unique ne se propage. On réduit donc l'ENSEMBLE du contenu
   via un léger zoom (le menu latéral et le bandeau, hors .content-container, ne
   sont PAS touchés). Pour ajuster : monter (0.92 = moins petit) / baisser
   (0.86 = plus petit) la valeur ci-dessous. Pour tout annuler : retirer ce bloc. */
.content-container { zoom: 0.9; }
/* Sur téléphone : réduction PLUS forte pour que les pages tiennent mieux à
   l'écran (les vues sont en px fixes = ne rétrécissent pas seules). Ajuster ici. */
@media (max-width: 768px) {
    .content-container { zoom: 0.82; }
}

/* Largeur des pages sur ordinateur : beaucoup de vues enveloppent leur
   contenu dans un cadre « max-width: 1200px; margin: 0 auto » qui, sur les
   grands écrans, laisse de larges marges vides autour des tableaux/listes.
   Sur écran large (>= 1024px) on libère cette contrainte pour exploiter
   toute la largeur disponible. Le bridage reste actif sous 1024px grâce au
   responsive existant, et l'aération vient du padding de .content-container. */
@media (min-width: 1024px) {
    /* CHARTE (pleine largeur) : on neutralise TOUT cadre étroit posé par une vue
       sur son conteneur de page — que ce soit via une classe (.xxx-page {max-width})
       ou un style inline. Le conteneur de page est l'enfant DIRECT de
       .content-container ; les modales (position:fixed, imbriquées plus bas, largeur
       gérée par .modal-content) ne sont donc PAS touchées. Marges de confort =
       padding de .content-container. Sous 1024px, le responsif reprend la main. */
    .content-container > div {
        max-width: none !important;
    }
}

/* Sidebar Overlay Mobile */
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 95; backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* Sélecteur de destination dans le tiroir hamburger : MASQUÉ sur ordinateur
   (le bandeau porte déjà le menu), AFFICHÉ uniquement sur mobile. */
.dest-filter-sidebar { display: none; }
.dest-filter-sidebar__lab { display: block; font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; margin-bottom: 6px; letter-spacing: .3px; }

/* Drapeaux auto-hébergés (image à la place de l'emoji, cf. window.flagImg) :
   la taille suit le font-size du parent, comme un caractère. */
img.flagimg { height: 1em; width: 1.34em; display: inline-block; vertical-align: -0.16em; object-fit: contain; border-radius: 3px; box-shadow: 0 0 0 .5px rgba(9,26,44,.06); }
/* Séparateur entre deux drapeaux d'une valeur combinée (ex. 🇨🇳/🇨🇮) */
.flagsep { display: inline-block; margin: 0 .05em; opacity: .5; font-weight: 700; transform: translateY(-.04em); }

/* Tuile « Agence active / Changer » du menu utilisateur (redesign) */
.agp-switch { transition: transform .18s cubic-bezier(.2,.8,.25,1), box-shadow .18s; }
.agp-switch:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(26,53,83,.9) !important; }
.agp-switch i.fa-arrow-right { transition: transform .18s; }
.agp-switch:hover i.fa-arrow-right { transform: translateX(3px); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    /* Le tiroir « Menu » doit passer AU-DESSUS des pages en plein écran mobile
       (Chat inter-agences / Chat client : position:fixed dans .content-container qui
       porte un zoom ; sous Blink, zoom ne crée PAS de contexte d'empilement -> leur
       z-index ~980/1000 « remonte » au niveau racine et recouvrait le tiroir, d'où
       le bouton « Menu » sans effet apparent). On l'élève au-dessus (1200 > 1000). */
    .sidebar { z-index: 1200; }
    .sidebar-overlay { z-index: 1199; }
    .main-content { margin-left: 0; width: 100%; }
    .mobile-toggle { display: block; }
    .content-container { padding: 15px 10px; }
    .top-bar { padding: 10px 15px; }
    /* Sur mobile : le sélecteur passe dans le menu hamburger, pas dans le bandeau. */
    .dest-filter-sidebar { display: block; padding: 12px 16px; border-bottom: 1px solid #eef2f7; background: #fff; }
    .mob-header .destination-filter, .top-bar .destination-filter { display: none; }
}

/* ============================================
    VUES SPÉCIFIQUES (Refactoring)
============================================ */

/* --- CHAUFFEURS LIST --- */
.chauffeurs-page { max-width: 1200px; margin: 0 auto; animation: fadeIn 0.3s ease-in-out; }
.chauffeurs-header { background: white; border-radius: 16px; padding: 20px 25px; margin-bottom: 24px; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.chauffeurs-header__content { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; }
.chauffeurs-header__left { display: flex; align-items: center; gap: 15px; }
.chauffeurs-header__icon { background: #eff6ff; color: #3b82f6; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 14px; font-size: 28px; }
.chauffeurs-header__title { margin: 0; font-size: 22px; font-weight: 800; color: #0f172a; }
.chauffeurs-header__subtitle { margin: 4px 0 0 0; font-size: 13px; color: #64748b; }
.status-badge span { background: #dcfce7; color: #166534; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; border: 1px solid #bbf7d0; }

.chauffeurs-filters { display: flex; flex-wrap: wrap; gap: 15px; background: white; padding: 20px; border-radius: 16px; border: 1px solid #e2e8f0; margin-bottom: 24px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
/* .filter-group existe déjà dans style.css */
.chauffeurs-table-card { background: white; border-radius: 16px; border: 1px solid #e2e8f0; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.chauffeurs-table-header { padding: 15px 20px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; display: flex; align-items: center; gap: 10px; }
.chauffeurs-table-title { margin: 0; font-size: 16px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.chauffeurs-table-count { background: #e2e8f0; color: #475569; padding: 2px 8px; border-radius: 12px; font-size: 12px; }

.chauffeurs-table { width: 100%; border-collapse: collapse; }
.chauffeurs-table th { text-align: left; padding: 16px 20px; background: white; font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; }
.chauffeurs-table td { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.chauffeurs-table tbody tr { cursor: pointer; transition: background 0.2s; }
.chauffeurs-table tbody tr:hover td { background: #f1f5f9; }

.driver-cell { display: flex; align-items: center; gap: 12px; }
.driver-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.driver-name { font-weight: 800; color: #0f172a; font-size: 14px; text-transform: uppercase; margin-bottom: 2px; }
.driver-id { font-size: 11px; color: #64748b; font-family: monospace; }

.rdv-cell { display: flex; flex-direction: column; gap: 4px; }
.rdv-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; display: inline-block; width: max-content; }
.rdv-badge--total { background: #f1f5f9; color: #475569; }
.rdv-badge--executed { background: #dcfce7; color: #16a34a; }

.perf-cell { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 200px; }
.perf-header { display: flex; justify-content: space-between; align-items: center; }
.perf-badge { font-size: 12px; font-weight: 800; color: #0f172a; }
.perf-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; width: 100%; }
.perf-bar__fill { height: 100%; border-radius: 4px; transition: width 0.5s ease-out; }

.money-cell { display: flex; flex-direction: column; }
.money-value { font-weight: 800; font-size: 15px; color: #0f172a; font-family: monospace; }
.money-label { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; }

/* --- MODALE DÉTAIL CHAUFFEUR --- */
.cd-modal { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; }
.cd-modal.active { display: flex; animation: fadeIn 0.2s; }
.cd-modal__overlay { position: absolute; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); }
.cd-modal__panel { position: relative; background: white; width: 95%; max-width: 800px; max-height: 90vh; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); z-index: 10000; }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.modal__title { font-size: 20px; font-weight: 800; color: #0f172a; }
.modal__sub { font-size: 12px; color: #64748b; margin-top: 4px; }
.modal__actions { display: flex; gap: 10px; align-items: center; }
.modal__body { padding: 25px; overflow-y: auto; flex: 1; }
.modal__foot { padding: 15px 25px; border-top: 1px solid #e2e8f0; background: #f8fafc; display: flex; justify-content: flex-end; }

.detailTop { display: flex; gap: 15px; align-items: center; margin-bottom: 25px; }
.avatar--lg { width: 56px; height: 56px; border-radius: 50%; font-size: 20px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.detailName { font-size: 18px; font-weight: 800; color: #1e293b; margin-bottom: 4px; }
.mono { font-family: monospace; }

.detailGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 25px; }
.dcard { background: #f8fafc; border: 1px solid #e2e8f0; padding: 15px; border-radius: 12px; }
.dcard__k { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; margin-bottom: 6px; }
.dcard__v { font-size: 20px; font-weight: 800; color: #0f172a; }

.detailBlocks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; }
@media (max-width: 768px) { .detailBlocks { grid-template-columns: 1fr; } }
.dblock { border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; }
.dblock__title { font-weight: 800; color: #1e293b; font-size: 15px; }

.barRow { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.barRow__date { width: 80px; font-size: 12px; color: #475569; }
.barRow__bars { flex: 1; height: 10px; background: #f1f5f9; border-radius: 5px; position: relative; overflow: hidden; }
.barFill { height: 100%; border-radius: 5px; position: absolute; left: 0; top: 0; }
.barFill--slate { background: #cbd5e1; }
.barFill--blue { background: #3b82f6; }
.pill { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: bold; }
.pill--slate { background: #f1f5f9; color: #475569; }
.pill--blue { background: #eff6ff; color: #1d4ed8; }
.pill--amber { background: #fffbeb; color: #d97706; }
.pill--green { background: #f0fdf4; color: #16a34a; }

/* --- SETTINGS AGENTS --- */
.am { max-width: 1200px; margin: 0 auto; animation: fadeIn 0.3s ease-in-out; }
.am__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; background: white; padding: 20px 25px; border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; flex-wrap: wrap; gap: 15px; }
.am__header-left { display: flex; align-items: center; gap: 15px; }
.am__icon-wrap { background: #eff6ff; color: #3b82f6; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 24px; }
.am__title { margin: 0; color: #0f172a; font-size: 22px; font-weight: 800; }
.am__subtitle { margin: 4px 0 0 0; color: #64748b; font-size: 13px; }
.am__kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 25px; }
.am__kpi { display: flex; align-items: center; gap: 15px; padding: 20px; border-radius: 16px; background: white; border: 1px solid #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.am__kpi-icon { font-size: 28px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.am__kpi--blue .am__kpi-icon { background: #eff6ff; color: #3b82f6; }
.am__kpi--green .am__kpi-icon { background: #dcfce7; color: #10b981; }
.am__kpi--red .am__kpi-icon { background: #fee2e2; color: #ef4444; }
.am__kpi--teal .am__kpi-icon { background: #ccfbf1; color: #06b6d4; }
.am__kpi-lbl { color: #64748b; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.am__kpi-val { font-size: 24px; font-weight: 800; color: #0f172a; line-height: 1; margin-bottom: 4px; }
.am__toolbar { margin-bottom: 20px; }
.am__search { width: 100%; max-width: 400px; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px; background: white; }
.am__search:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.am__table-wrap { background: white; border-radius: 16px; border: 1px solid #e2e8f0; overflow-x: auto; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.am__table { width: 100%; border-collapse: collapse; }
.am__table th { text-align: left; padding: 16px 20px; background: #f8fafc; font-size: 12px; font-weight: 600; color: #475569; border-bottom: 1px solid #e2e8f0; text-transform: uppercase; }
.am__table td { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
.am__table tr:hover td { background: #f8fafc; }
.am__agent-cell { display: flex; align-items: center; gap: 12px; }
.am__avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: white; font-size: 14px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.am__agent-name { font-weight: 700; color: #0f172a; font-size: 14px; }
.am__agent-id { font-size: 11px; color: #64748b; margin-top: 2px; }
.am__badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; }
.am__badge--admin { background: #fee2e2; color: #991b1b; }
.am__badge--manager { background: #fef3c7; color: #b45309; }
.am__badge--agent { background: #e0f2fe; color: #0369a1; }
.am__badge--chauf { background: #f3e8ff; color: #7e22ce; }
.am__toggle { width: 44px; height: 24px; border-radius: 12px; border: none; cursor: pointer; position: relative; transition: 0.3s; }
.am__toggle--on { background: #10b981; }
.am__toggle--off { background: #cbd5e1; }
.am__toggle-knob { width: 18px; height: 18px; background: white; border-radius: 50%; position: absolute; top: 3px; transition: 0.3s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.am__toggle--on .am__toggle-knob { left: 23px; }
.am__toggle--off .am__toggle-knob { left: 3px; }
.am__online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.am__online-dot--on { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.am__online-dot--off { background: #cbd5e1; }
.am__actions { display: flex; gap: 8px; }
.am__btn-sm { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e2e8f0; background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.am__btn-sm:hover { background: #f1f5f9; transform: scale(1.05); }
.am__cards { display: none; }
@media (max-width: 768px) {
    .am__table-wrap { display: none; }
    .am__cards { display: grid; grid-template-columns: 1fr; gap: 15px; }
    .am__card { background: white; border-radius: 16px; padding: 15px; border: 1px solid #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
    .am__card-top { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f1f5f9; position: relative; }
    .am__card-info { flex: 1; }
    .am__card-details { font-size: 13px; color: #475569; margin-bottom: 15px; line-height: 1.6; }
    .am__card-bottom { display: flex; justify-content: space-between; align-items: center; }
    .am__online-dot--card { position: absolute; top: 0; right: 0; }
}

/* --- TOUTES LES FACTURES --- */
.factures-header { background: white; border-radius: 16px; margin-bottom: 24px; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.factures-header__content { display: flex; align-items: center; gap: 20px; padding: 20px 24px; flex-wrap: wrap; }
.factures-header__icon { font-size: 32px; background: #fef3c7; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 14px; }
.factures-header__info { flex: 1; }
.factures-header__title { margin: 0; font-size: 22px; font-weight: 700; color: #0f172a; }
.factures-header__subtitle { margin: 4px 0 0; font-size: 13px; color: #64748b; }
.btn-create-invoice { background: #3b82f6; color: white; border: none; padding: 12px 20px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.btn-create-invoice:hover { background: #2563eb; transform: translateY(-2px); }
.factures-filters { display: flex; flex-wrap: wrap; gap: 16px; background: white; padding: 20px 24px; border-radius: 16px; border: 1px solid #e2e8f0; margin-bottom: 24px; }
.filter-group { flex: 1; min-width: 150px; }
.filter-group--wide { flex: 2; }
.filter-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: #64748b; margin-bottom: 6px; }
.filter-icon { margin-right: 4px; }
.filter-input, .filter-select { width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px; transition: all 0.2s; }
.filter-input:focus, .filter-select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.filter-actions-group { display: flex; gap: 10px; align-items: flex-end; }
.btn-export { padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.2s; border: none; }
.btn-export--excel { background: #10b981; color: white; }
.btn-export--pdf { background: #ef4444; color: white; }
.btn-export:hover { transform: translateY(-2px); filter: brightness(1.05); }
.factures-table-card { background: white; border-radius: 16px; border: 1px solid #e2e8f0; overflow: hidden; }
.factures-table-header { padding: 16px 24px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.factures-table-title { font-size: 14px; font-weight: 500; color: #475569; }
.factures-count-badge { background: #e2e8f0; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; margin-right: 8px; }
.table-wrap { overflow-x: auto; }
.factures-table { width: 100%; border-collapse: collapse; }
.factures-table th { text-align: left; padding: 11px 12px; background: #1A3553; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #e7edf6; border-bottom: none; cursor: default; user-select: none; }
.factures-table th.th-sort { cursor: pointer; }
.factures-table th.th-sort:hover { background: #22456b; color: #fff; }
.factures-table td { padding: 9px 12px; border-bottom: 1px solid #eef2f7; font-size: 13px; color: #334155; }
.factures-table tbody tr:nth-child(even) td { background: #f6f9fc; }
.factures-table tbody tr:hover td { background: #eaf1fb; }
.th-sort { position: relative; }
.th-sort__icon { display: inline-block; width: 0; height: 0; margin-left: 6px; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.th-sort--asc .th-sort__icon { border-bottom: 5px solid #FDC615; border-top: none; }
.th-sort--desc .th-sort__icon { border-top: 5px solid #FDC615; border-bottom: none; }
.col--amount { text-align: right; }
.cell--amount { text-align: right; font-weight: 700; }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge--paid { background: #dcfce7; color: #166534; }
.badge--unpaid { background: #fee2e2; color: #991b1b; }
.badge--deposit { background: #fef3c7; color: #92400e; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e2e8f0; background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.icon-btn:hover { background: #f1f5f9; transform: scale(1.05); }
.btn--view:hover { color: #3b82f6; border-color: #3b82f6; }
.btn--pay:hover { color: #10b981; border-color: #10b981; }
.btn--edit:hover { color: #F2A312; border-color: #F2A312; }
.btn--reuse:hover { color: #1A3553; border-color: #1A3553; }
.btn--del:hover { color: #E51F21; border-color: #E51F21; background: #fef2f2; }
.amount-link { background: none; border: none; font-weight: 700; color: #1A3553; cursor: pointer; font-size: 13px; padding: 1px 4px; border-radius: 5px; text-decoration: underline; text-decoration-color: rgba(26,53,83,.35); text-underline-offset: 2px; transition: background .15s, color .15s; }
.amount-link:hover { color: #F2A312; background: rgba(253,198,21,.16); text-decoration-color: #F2A312; }
.tooltip { position: relative; cursor: help; }
.tooltip[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 0; background: #1e293b; color: white; padding: 4px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; z-index: 10; }
@media (max-width: 768px) {
    .factures-header { margin-bottom: 12px; border-radius: 12px; }
    .factures-header__content { padding: 12px 15px; gap: 12px; }
    .factures-header__icon { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
    .factures-header__title { font-size: 18px; }
    .factures-header__subtitle { font-size: 11px; margin-top: 2px; }
    .btn-create-invoice { width: 100%; justify-content: center; padding: 10px; font-size: 13px; border-radius: 8px; }
    .factures-filters { padding: 12px 15px; gap: 10px; margin-bottom: 15px; border-radius: 12px; }
    .filter-group { min-width: calc(50% - 5px); flex: 1 1 auto; margin: 0; }
    .filter-group--wide { min-width: 100%; }
    .filter-label { margin-bottom: 4px; font-size: 10px; }
    .filter-input, .filter-select { padding: 8px 10px; font-size: 13px; height: 36px; border-radius: 8px; }
    .filter-actions-group { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 5px; }
    .btn-export { width: 100%; padding: 8px; font-size: 12px; border-radius: 8px; justify-content: center; display: flex; align-items: center; }
}

/* Modale Vue Détaillée Facture */
.modal--detail .modal-content { max-width: 900px; width: 95%; padding: 0; background: #f8fafc; overflow: hidden; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.modal__header--detail { background: white; padding: 25px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal__kicker { font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.modal__ref { font-size: 28px; font-weight: 900; color: #0f172a; margin-bottom: 8px; line-height: 1; }
.modal__detail-subline { font-size: 13px; color: #475569; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.modal__detail-head-actions { display: flex; gap: 15px; align-items: center; }
.modal__body--scroll { padding: 25px; overflow-y: auto; max-height: 75vh; }
.detail-card { background: white; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.02); margin-bottom: 20px; overflow: hidden; }
.detail-card__header { padding: 15px 20px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.detail-card__title { font-size: 16px; font-weight: 800; color: #1e293b; margin: 0; }
.bilan-row { display: flex; }
.bilan-pill { flex: 1; padding: 20px; border-right: 1px solid #e2e8f0; }
.bilan-pill:last-child { border-right: none; }
.bilan-pill__label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; margin-bottom: 8px; }
.bilan-pill__value { font-size: 20px; font-weight: 900; color: #0f172a; }
.bilan-pill--price .bilan-pill__value { color: #3b82f6; }
.bilan-pill--paid .bilan-pill__value { color: #10b981; }
.bilan-pill--remaining .bilan-pill__value { color: #ef4444; }
.bilan-pill--status .bilan-pill__value { font-size: 14px; }
.modal__grid { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 768px) { .modal__grid { grid-template-columns: 1fr; } .bilan-row { flex-wrap: wrap; } .bilan-pill { border-right: none; border-bottom: 1px solid #e2e8f0; min-width: 50%; } }
/* ----------------------------------------------------------------------------
   Modale « Voir facture » (.modal--detail) COMPACTE sur mobile (2026-08-08) :
   paddings réduits, polices nettement plus petites, Bilan en grille 2 colonnes →
   la modale devient beaucoup plus courte (demande maintainer). Desktop inchangé.
   ---------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .modal--detail .modal-content { width: 100%; max-width: 100%; border-radius: 12px; }
    .modal--detail .modal__header--detail { padding: 11px 14px; }
    .modal--detail .modal__kicker { font-size: 9px; margin-bottom: 2px; letter-spacing: .5px; }
    .modal--detail .modal__ref { font-size: 18px; margin-bottom: 3px; }
    .modal--detail .modal__detail-subline { font-size: 10px; gap: 4px; }
    .modal--detail .modal__detail-head-actions .badge { font-size: 10px !important; padding: 3px 8px !important; }
    .modal--detail .modal__body--scroll { padding: 10px; max-height: 82vh; }

    .modal--detail .detail-card { margin-bottom: 8px; border-radius: 10px; }
    .modal--detail .detail-card__header { padding: 8px 12px; }
    .modal--detail .detail-card__title { font-size: 13px; }

    /* Bilan : 2 colonnes serrées (box-sizing pour tenir vraiment à 50 %). */
    .modal--detail .bilan-row { display: grid; grid-template-columns: 1fr 1fr; }
    .modal--detail .bilan-pill { box-sizing: border-box; padding: 7px 10px; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; min-width: 0; }
    .modal--detail .bilan-pill__label { font-size: 8.5px; margin-bottom: 2px; }
    .modal--detail .bilan-pill__value { font-size: 14px; }
    .modal--detail .bilan-pill--status .bilan-pill__value { font-size: 11px; }

    /* Info client : blocs empilés, lignes serrées. */
    .modal--detail .modal__block { padding: 10px 12px; border-right: none; border-bottom: 1px solid #e2e8f0; }
    .modal--detail .modal__block:last-child { border-bottom: none; }
    .modal--detail .info-title { margin-bottom: 8px; gap: 6px; }
    .modal--detail .info-title__icon { padding: 4px; }
    .modal--detail .info-title__pill { font-size: 12px; }
    .modal--detail .info-rows { gap: 5px; }
    .modal--detail .info-row__value { font-size: 11.5px; line-height: 1.25; }

    /* En-têtes d'action + boutons compacts. */
    .modal--detail .row.detail-card__headerRow { padding: 8px 12px; gap: 8px; }
    .modal--detail .btn--doc { padding: 6px 9px; font-size: 11px; border-radius: 7px; gap: 4px; }
    .modal--detail .modal-actionsRow { gap: 6px; }
    .modal--detail .amt-btn { padding: 7px 10px !important; font-size: 12px !important; }

    /* Tableaux internes (description, suivi, historique) : police réduite. */
    .modal--detail .modal__body--scroll table { font-size: 11px; }
    .modal--detail .modal__body--scroll th, .modal--detail .modal__body--scroll td { padding: 5px 6px !important; }
}
.modal__block { padding: 20px; border-right: 1px solid #e2e8f0; }
.modal__block:last-child { border-right: none; }
.info-title { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; }
.info-title__icon { color: #3b82f6; background: #eff6ff; padding: 6px; border-radius: 8px; display: flex; }
.info-title__pill { font-size: 14px; font-weight: 700; color: #1e293b; }
.info-rows { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; align-items: flex-start; gap: 10px; }
.info-row__icon { color: #94a3b8; margin-top: 2px; }
.info-row__value { font-size: 13px; font-weight: 600; color: #334155; line-height: 1.4; }
.row.detail-card__headerRow { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; gap: 15px; }
.btn--doc { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.2s; }
.btn--doc-facture { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.btn--doc-facture:hover { background: #dbeafe; }
.btn--doc-etiquette { background: #fdf4ff; color: #9333ea; border: 1px solid #e9d5ff; }
.btn--doc-etiquette:hover { background: #f3e8ff; }
.btn--doc-attestation { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn--doc-attestation:hover { background: #fee2e2; }
.btn--doc-livraison { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.btn--doc-livraison:hover { background: #dcfce7; }
.modal-actionsRow { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-table-wrap { overflow-x: auto; }
.modal-table { width: 100%; border-collapse: collapse; }
.modal-table th { text-align: left; padding: 12px 20px; font-size: 11px; font-weight: 700; color: #64748b; background: #f8fafc; border-bottom: 1px solid #e2e8f0; text-transform: uppercase; white-space: nowrap; }
.modal-table td { padding: 15px 20px; font-size: 13px; color: #334155; border-bottom: 1px solid #f1f5f9; }
.modal-table__desc { font-weight: 700; color: #0f172a; }
.modal-sectionPill { display: inline-flex; align-items: center; gap: 8px; background: #f1f5f9; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; color: #1e293b; }
.modal-sectionPill__count { background: #3b82f6; color: white; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.photos-actions { display: flex; gap: 10px; }
.photos-input { display: none; }
.muted { color: #64748b; font-size: 13px; padding: 20px; font-style: italic; text-align: center; }
.colis-paris { background: #e0f2fe; color: #0284c7; }
.colis-transit { background: #fef3c7; color: #b45309; }
.colis-abidjan { background: #f3e8ff; color: #7e22ce; }
.colis-delivered { background: #dcfce7; color: #166534; }
.colis-pending { background: #f1f5f9; color: #475569; }

/* --- CLIENTS LIST --- */
.cd-header { display: flex; justify-content: space-between; align-items: center; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; flex-wrap: wrap; gap: 15px;}
.cd-header__icon { font-size: 32px; background: #f8fafc; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 12px; margin-right: 15px; }
.cd-header__content { display: flex; align-items: center; }
.cd-header__title { font-size: 24px; font-weight: 800; margin: 0; color: #0f172a; }
.cd-header__subtitle { color: #64748b; margin: 5px 0 0 0; font-size: 13px; }
.cd-pills { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;}
.cd-pill { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.cd-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.cd-kpi { display: flex; align-items: center; gap: 15px; padding: 20px; border-radius: 12px; background: white; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.cd-kpi__icon { font-size: 24px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.cd-kpi__label { font-size: 12px; color: #64748b; font-weight: 600; text-transform: uppercase; }
.cd-kpi__value { font-size: 20px; font-weight: 800; color: #0f172a; margin: 4px 0; }
.cd-kpi__hint { font-size: 11px; color: #94a3b8; }
.cd-tables-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media(max-width: 768px){ .cd-tables-row { grid-template-columns: 1fr; } }
@media(max-width: 768px) {
    .compact-row { padding: 0 !important; border: none !important; background: transparent !important; box-shadow: none !important; margin-bottom: 12px !important; }
    .compact-row td { padding: 0 !important; border: none !important; display: block !important; text-align: left !important; width: 100% !important; }
    .compact-row td::before { display: none !important; }
    /* Carte compacte « devis » (et autres listes .cmc-*) : structure existait mais
       n'était pas stylée -> rendu « mal compacté ». Style dense, charte AMT. */
    .compact-mob-card { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15,28,46,.04); }
    .cmc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
    .cmc-ref-group { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
    .cmc-ref { font-weight: 800; color: #1A3553; font-size: 13.5px; font-family: 'Comfortaa','Jost',sans-serif; }
    .cmc-date { font-size: 11px; color: #94a3b8; }
    .cmc-body { margin: 5px 0; }
    .cmc-route { font-size: 13px; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cmc-route strong { color: #0f172a; font-weight: 700; }
    .cmc-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
    .cmc-amount { font-weight: 800; font-size: 15px; color: #0f172a; font-variant-numeric: tabular-nums; }
    .cmc-actions { display: flex; gap: 6px; flex-shrink: 0; }
    .cmc-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; color: #64748b; font-size: 13px; cursor: pointer; padding: 0; transition: all .15s; }
    .cmc-btn:hover { background: #f1f5f9; color: #1A3553; border-color: #cbd5e1; }
    .cmc-btn-pay { color: #059669; border-color: #a7f3d0; }
    .cmc-btn-pay:hover { background: #ecfdf5; color: #047857; }
    .cmc-btn-del { color: #dc2626; border-color: #fecaca; }
    .cmc-btn-del:hover { background: #fef2f2; color: #b91c1c; }
}
.cl-filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 15px; margin: 0; }
@media (max-width: 768px) {
    .cl-filters { grid-template-columns: 1fr 1fr; }
    .cl-filters .form-group { margin: 0; }
    .cl-filters .cl-filter-search { grid-column: 1 / -1; }
    .cl-filters .cl-filter-export { grid-column: 1 / -1; }
    .cl-filters .cl-filter-export button { width: 100%; justify-content: center; }
}
.cd-table-card { background: white; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,0.02); padding: 20px; overflow: hidden;}
.cd-profile-grid { display: grid; grid-template-columns: 1fr; gap: 15px; background: white; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; }
tr.clickable-row { transition: background 0.2s; cursor: pointer; }
tr.clickable-row:hover { background: #f1f5f9 !important; }

/* --- LIVRAISON --- */
:root {
    --lv-blue:#3b82f6; --lv-blue-d:#1d4ed8;
    --lv-green:#10b981; --lv-green-d:#059669;
    --lv-amber:#f59e0b; --lv-red:#ef4444; --lv-red-d:#dc2626;
    --lv-purple:#8b5cf6; --lv-slate:#64748b;
    --lv-bg:#f8fafc; --lv-surface:#fff;
    --lv-border:#e2e8f0; --lv-border2:#cbd5e1;
    --lv-text:#1e293b; --lv-muted:#64748b;
    --lv-shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04);
    --lv-shadow2:0 4px 12px rgba(0,0,0,.1);
}
/* .toolbar reste masqué : il ne contient plus que la section "conteneur actif"
   (pont caché lu par setActiveContainer / la barre lv-command-bar). */
#livraison-content .toolbar { display:none!important; }
#livraison-content { padding:0; background:var(--lv-bg); }

/* ── Vue FICHES (onglet « En cours ») — charte AMT ── */
#livraison-content .lv-viewtoggle { display:inline-flex; background:#fff; border:1px solid rgba(11,37,64,.10); border-radius:10px; overflow:hidden; }
#livraison-content .lv-viewtoggle button { border:0; background:transparent; padding:8px 13px; font:inherit; font-weight:600; font-size:12.5px; color:#5A7088; cursor:pointer; }
#livraison-content .lv-viewtoggle button.on { background:#1A3553; color:#fff; }

#livraison-content .lv-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(340px, 100%),1fr)); gap:14px; padding:16px; }
#livraison-content .lv-card { position:relative; background:#fff; border:1px solid rgba(11,37,64,.10); border-left:5px solid #5A7088; border-radius:16px; padding:14px 16px; box-shadow:0 8px 20px -14px rgba(11,37,64,.25); transition:transform .18s, box-shadow .18s; }
#livraison-content .lv-card:hover { transform:translateY(-3px); box-shadow:0 18px 34px -18px rgba(11,37,64,.3); z-index:4; }
#livraison-content .lv-card:has(.act-menu-wrap.open) { z-index:30; }
#livraison-content .lv-card.s-attente { border-left-color:#F2A312; }
#livraison-content .lv-card.s-livre { border-left-color:#10B981; }
#livraison-content .lv-card.s-incident { border-left-color:#E51F21; }
#livraison-content .lv-c-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
#livraison-content .lv-c-ref { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:16px; color:#1A3553; text-decoration:none; letter-spacing:-.3px; }
#livraison-content .lv-c-ref:hover { text-decoration:underline; }
#livraison-content .lv-c-cont { font-size:11px; font-weight:700; color:#1A3553; background:#eef2f8; border:1px solid rgba(11,37,64,.10); padding:3px 9px; border-radius:7px; white-space:nowrap; }
#livraison-content .lv-c-name { font-weight:700; font-size:14.5px; margin-top:8px; color:#0B2540; }
#livraison-content .lv-c-meta { font-size:12.5px; color:#5A7088; margin-top:2px; }
#livraison-content .lv-c-desc { font-size:12.5px; color:#0B2540; margin-top:6px; background:#f8fafc; border:1px solid rgba(11,37,64,.10); border-radius:8px; padding:5px 9px; display:inline-block; }
#livraison-content .lv-c-money { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:17px; margin-top:9px; color:#0B2540; }
#livraison-content .lv-magas { font-size:11px; color:#9a3412; font-weight:700; }
#livraison-content .lv-partiel { display:inline-flex; align-items:center; gap:5px; background:linear-gradient(135deg,#fb923c,#c2410c); color:#fff; font-size:11px; font-weight:800; padding:3px 9px; border-radius:999px; margin-top:6px; }
#livraison-content .lv-complet { display:inline-flex; align-items:center; gap:5px; background:#FDF1DA; color:#B8780A; font-size:11px; font-weight:800; padding:3px 9px; border-radius:999px; border:1px solid rgba(242,163,18,.35); margin-top:6px; }
#livraison-content .lv-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
#livraison-content .lv-badge { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; padding:5px 11px; border-radius:999px; border:1px solid transparent; }
#livraison-content .lv-badge .k { opacity:.6; font-weight:600; }
#livraison-content .lv-badge.b-wait { background:#fff7e6; color:#b45309; border-color:#fcd9a3; }
#livraison-content .lv-badge.b-done { background:#dcfce7; color:#047857; border-color:#a7f3d0; }
#livraison-content .lv-badge.b-unpaid { background:#fee2e2; color:#B5181A; border-color:#fecaca; }
#livraison-content .lv-badge.b-paid { background:#dcfce7; color:#047857; border-color:#a7f3d0; }
#livraison-content .lv-edit { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:11px; padding:11px; background:#f8fafc; border:1px solid rgba(11,37,64,.10); border-radius:10px; }
#livraison-content .lv-edit label { display:flex; flex-direction:column; font-size:11px; font-weight:700; color:#5A7088; gap:3px; }
#livraison-content .lv-edit input { border:1px solid rgba(11,37,64,.18); border-radius:7px; padding:6px 8px; font:inherit; font-size:13px; }
#livraison-content .lv-edit input:focus { outline:0; border-color:#F2A312; box-shadow:0 0 0 3px rgba(242,163,18,.18); }
#livraison-content .lv-acts { display:flex; gap:8px; align-items:center; margin-top:12px; padding-top:11px; border-top:1px dashed rgba(11,37,64,.10); flex-wrap:wrap; }
#livraison-content .lv-a { border:0; border-radius:9px; padding:8px 12px; font:inherit; font-weight:700; font-size:12.5px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; transition:.15s; }
#livraison-content .lv-a:hover { filter:brightness(1.06); transform:translateY(-1px); }
#livraison-content .lv-a-livre { background:linear-gradient(135deg,#10B981,#047857); color:#fff; }
#livraison-content .lv-a-pay { background:linear-gradient(135deg,#F2A312,#B8780A); color:#1a0c08; }
#livraison-content .lv-a-edit, #livraison-content .lv-a-ghost { background:#eef2f8; color:#1A3553; }
#livraison-content .lv-more-slot { margin-left:auto; }
#livraison-content .lv-cards-empty { grid-column:1 / -1; text-align:center; color:#5A7088; padding:40px 20px; }
#livraison-content .lv-cards-empty h3 { margin:8px 0 4px; color:#1A3553; }
#livraison-content .lv-cards-more { grid-column:1 / -1; text-align:center; padding:6px; }

/* ── Mode LIVREUR (« Mon programme ») : page simplifiee ── */
#livraison-content.lv-driver .lv-command-bar,
#livraison-content.lv-driver .lv-toolbar,
#livraison-content.lv-driver .lv-filter-bar,
#livraison-content.lv-driver .lv-sel-bar,
#livraison-content.lv-driver .lv-ctx,
#livraison-content.lv-driver #currentContainerTitle,
#livraison-content.lv-driver #paris-info-banner { display:none !important; }
.lv-driver-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
    background:linear-gradient(135deg,#2C4E76,#0F2238); color:#fff; padding:14px 18px; position:sticky; top:0; z-index:60; }
.lv-driver-title { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:17px; }
.lv-driver-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.lv-driver-datelbl { display:inline-flex; align-items:center; gap:6px; font-weight:600; font-size:13px; }
.lv-driver-tools input[type=date] { border:0; border-radius:8px; padding:6px 10px; font:inherit; color:#1A3553; }
.lv-driver-count { font-weight:800; background:rgba(255,255,255,.18); padding:5px 12px; border-radius:999px; font-size:13px; }
.lv-driver-tools select { border:0; border-radius:8px; padding:6px 10px; font:inherit; color:#1A3553; max-width:200px; }
#livraison-content .lv-archived-note { font-size:12px; color:#5A7088; font-style:italic; padding:4px 2px; }

/* En mode livreur, on masque entierement l'ancien tableau */
#livraison-content.lv-driver .table-container { display:none !important; }

/* ── Mode LIVREUR : « Mon programme » sous forme de CALENDRIER ── */
.lvd-app { max-width:760px; margin:0 auto; padding:14px 12px 40px; }
.lvd-hero { background:linear-gradient(135deg,#1A3553,#0F2238); color:#fff; border-radius:16px;
    padding:18px 20px; margin-bottom:16px; box-shadow:0 8px 24px rgba(15,34,56,.28); position:relative; overflow:hidden; }
.lvd-hero::after { content:'🚚'; position:absolute; right:-6px; bottom:-14px; font-size:78px; opacity:.12; transform:rotate(-12deg); }
.lvd-hero-title { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:18px; }
.lvd-hero-sub { font-size:13px; opacity:.9; margin-top:4px; }

.lvd-cal-card { background:linear-gradient(180deg,#ffffff,#F4F8FD); border-radius:18px; padding:18px 6px 16px;
    box-shadow:0 12px 30px -12px rgba(26,53,83,.24), 0 2px 6px rgba(26,53,83,.06); border:1px solid #E6ECF3;
    position:relative; overflow:hidden; touch-action:pan-y; }
.lvd-cal-card::before { content:''; position:absolute; top:0; left:0; right:0; height:4px;
    background:linear-gradient(90deg,#1A3553,#FDC615 65%,#F2A312); }
.lvd-cal-nav { display:flex; align-items:center; justify-content:space-between; margin:2px 4px 16px; }
.lvd-cal-month { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:19px; color:#1A3553; text-transform:capitalize; letter-spacing:-.3px; }
.lvd-nav-arrow { width:40px; height:40px; border-radius:50%; border:1px solid #E1E9F2; background:#fff;
    color:#1A3553; font-size:22px; line-height:1; cursor:pointer; transition:.15s; box-shadow:0 2px 6px rgba(26,53,83,.08); }
.lvd-nav-arrow:hover { background:#1A3553; color:#FDC615; border-color:#1A3553; transform:translateY(-1px); }
.lvd-nav-arrow:active { transform:scale(.92); }
.lvd-weekdays { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; margin-bottom:8px; }
.lvd-weekdays span { text-align:center; font-size:12px; font-weight:800; color:#1A3553; text-transform:uppercase; letter-spacing:.5px; opacity:.7; }
.lvd-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.lvd-cell { position:relative; aspect-ratio:1/1; border-radius:14px; display:flex; align-items:center; justify-content:center;
    font-size:17px; font-weight:600; color:#334155; background:#EAF1F8; transition:transform .12s ease, box-shadow .15s ease; }
.lvd-empty { background:transparent; }
.lvd-has { background:linear-gradient(135deg,#FFB020,#E67E00); color:#fff; font-weight:800; cursor:pointer;
    box-shadow:0 5px 13px rgba(230,126,0,.4); }
.lvd-has:hover { transform:translateY(-3px); box-shadow:0 11px 22px rgba(230,126,0,.5); }
.lvd-has:active { transform:scale(.95); }
.lvd-today { box-shadow:inset 0 0 0 2.5px #FDC615, 0 2px 8px rgba(0,0,0,.06); }
.lvd-has.lvd-today { box-shadow:inset 0 0 0 2.5px #FDC615, 0 5px 13px rgba(0,0,0,.2); }
.lvd-sel { outline:3px solid #E51F21; outline-offset:2px; }
.lvd-num { line-height:1; }
.lvd-badge { position:absolute; top:4px; right:5px; background:#E51F21; color:#fff; font-size:11px; font-weight:800;
    min-width:19px; height:19px; padding:0 4px; border-radius:10px; display:flex; align-items:center; justify-content:center;
    box-shadow:0 1px 3px rgba(0,0,0,.25); border:1.5px solid rgba(255,255,255,.85); }
/* Badge « livrés/total » (ex. 3/7) : un peu plus large, chiffres serrés. */
.lvd-badge-frac { min-width:24px; padding:0 5px; font-size:10px; letter-spacing:-.3px; background:#1A3553; }
/* Statuts de journée : 🟢 tout livré (vert) · 🔵 à venir (marine). Priment sur
   .lvd-has (orange = à faire) grâce à l'ordre + !important. */
.lvd-done { background:linear-gradient(135deg,#16C784,#059669)!important; box-shadow:0 5px 13px rgba(5,150,105,.42)!important; }
.lvd-done:hover { transform:translateY(-3px); box-shadow:0 11px 22px rgba(5,150,105,.52)!important; }
.lvd-future { background:linear-gradient(135deg,#4C6FA0,#1A3553)!important; box-shadow:0 5px 13px rgba(26,53,83,.42)!important; }
.lvd-future:hover { transform:translateY(-3px); box-shadow:0 11px 22px rgba(26,53,83,.52)!important; }
/* 🟠🟢 Partiel : en partie livré (reste des colis à faire). Bicolore orange→vert
   avec cassure nette à 50 % = « en cours ». */
.lvd-partial { background:linear-gradient(135deg,#F2A312 50%,#0E9F6E 50%)!important; box-shadow:0 5px 13px rgba(230,126,0,.38)!important; }
.lvd-partial:hover { transform:translateY(-3px); box-shadow:0 11px 22px rgba(230,126,0,.5)!important; }
/* Jours SANS livraison : chiffre gris muet (bien distinct des jours marqués). */
.lvd-cell:not(.lvd-has) .lvd-num { color:#7C8DA0; }
/* Glissement du mois (swipe / flèches) : la grille arrive du côté opposé. */
@keyframes lvdGridInL { from { opacity:.35; transform:translateX(22px); } to { opacity:1; transform:translateX(0); } }
@keyframes lvdGridInR { from { opacity:.35; transform:translateX(-22px); } to { opacity:1; transform:translateX(0); } }
/* Légende + récap du mois. */
.lvd-legend { display:flex; flex-wrap:wrap; gap:8px 14px; justify-content:center; margin-top:12px; font-size:11px; color:#64748B; }
.lvd-legend span { display:inline-flex; align-items:center; gap:5px; }
.lvd-dot { width:11px; height:11px; border-radius:4px; display:inline-block; }
.lvd-dot.d-todo { background:linear-gradient(135deg,#F2A312,#E08600); }
.lvd-dot.d-partial { background:linear-gradient(135deg,#F2A312 50%,#0E9F6E 50%); }
.lvd-dot.d-done { background:#059669; }
.lvd-dot.d-future { background:#1A3553; }
.lvd-dot.d-none { background:#F6F9FC; border:1px solid #E2E8F0; }
.lvd-cal-summary { text-align:center; margin-top:10px; font-size:13px; color:#334155; font-weight:500; }

/* Modale du jour */
.lvd-modal { position:fixed; inset:0; z-index:1200; display:flex; align-items:flex-end; justify-content:center; }
.lvd-modal-backdrop { position:absolute; inset:0; background:rgba(15,34,56,.55); backdrop-filter:blur(2px); }
.lvd-modal-card { position:relative; background:#F6F9FC; width:100%; max-width:560px; max-height:88vh; overflow-y:auto;
    border-radius:20px 20px 0 0; padding:20px 16px 28px; box-shadow:0 -8px 30px rgba(15,34,56,.35);
    animation:lvdSlideUp .22s ease; }
@keyframes lvdSlideUp { from { transform:translateY(40px); opacity:.6; } to { transform:translateY(0); opacity:1; } }
.lvd-modal-close { position:absolute; top:12px; right:14px; width:34px; height:34px; border-radius:50%; border:0;
    background:#E6ECF3; color:#1A3553; font-size:22px; line-height:1; cursor:pointer; z-index:2; }
.lvd-modal-close:hover { background:#1A3553; color:#fff; }
.lvd-day-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; padding-right:40px; }
.lvd-day-title { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:16px; color:#1A3553; text-transform:capitalize; }
.lvd-day-sub { font-size:13px; color:#7C8DA0; margin-top:2px; }
.lvd-route-btn { background:linear-gradient(135deg,#1A3553,#2C4E76); color:#fff; border:0; border-radius:10px;
    padding:10px 16px; font-weight:700; font-size:13px; cursor:pointer; box-shadow:0 4px 12px rgba(26,53,83,.25); transition:.15s; }
.lvd-route-btn:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(26,53,83,.35); }
.lvd-cards { display:flex; flex-direction:column; gap:10px; }
.lvd-card { background:#fff; border:1px solid #E6ECF3; border-left:4px solid #F2A312; border-radius:12px;
    padding:12px 14px; box-shadow:0 2px 8px rgba(26,53,83,.06); }
.lvd-card.s-livre { border-left-color:#28A745; opacity:.85; }
.lvd-c-top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.lvd-c-ref { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:15px; color:#1A3553; }
.lvd-c-rest { font-size:13px; font-weight:800; padding:3px 10px; border-radius:8px; white-space:nowrap; }
.lvd-c-rest.due { background:#FDECEC; color:#E51F21; }
.lvd-c-rest.paid { background:#E8F6EC; color:#28A745; }
.lvd-c-dest { font-size:14px; font-weight:600; color:#2B3F55; }
.lvd-c-meta { font-size:12.5px; color:#5A7088; margin-top:3px; }
.lvd-c-desc { font-size:12.5px; color:#43586E; margin-top:5px; background:#F6F9FC; border-radius:8px; padding:6px 9px; }
.lvd-c-acts { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.lvd-c-acts .lv-a { border:0; border-radius:9px; padding:8px 12px; font-size:13px; font-weight:700; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:5px; }
.lvd-c-acts .lv-a-livre { background:#28A745; color:#fff; }
.lvd-c-acts .lv-a-ghost { background:#F6F9FC; color:#5A7088; border:1px solid #E6ECF3; }
.lvd-c-acts .lv-a-pay { background:#F2A312; color:#fff; }
.lvd-c-acts .lv-a-wa { background:#25D366; color:#fff; }
.lvd-c-acts .lv-a-call { background:#1A3553; color:#fff; }
.lvd-empty-msg { text-align:center; color:#7C8DA0; font-size:14px; padding:24px; }
/* Validation multi-photos : vignettes + bouton « Ajouter ». */
.lvd-thumbs { display:flex; flex-wrap:wrap; gap:10px; }
.lvd-thumb { position:relative; width:82px; height:82px; border-radius:12px; overflow:hidden; box-shadow:0 2px 8px rgba(26,53,83,.16); }
.lvd-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.lvd-thumb button { position:absolute; top:3px; right:3px; width:22px; height:22px; border-radius:50%; border:0; background:rgba(15,34,56,.78); color:#fff; font-size:15px; line-height:1; cursor:pointer; }
.lvd-add-photo { width:82px; height:82px; border-radius:12px; border:2px dashed #C3D2E2; background:#F6F9FC; color:#1A3553; font-size:24px; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
.lvd-add-photo span { font-size:11px; font-weight:700; }
.lvd-livre-tag { display:inline-flex; align-items:center; background:#E8F6EC; color:#1E7A34; font-weight:800; font-size:13px; padding:8px 12px; border-radius:9px; }
@media (max-width:520px) {
    .lvd-cell { font-size:16px; border-radius:12px; }
    .lvd-cal-card { padding:16px 5px 14px; }
    .lvd-grid, .lvd-weekdays { gap:4px; }
    .lvd-route-btn { width:100%; }
}
@media (min-width:560px) {
    .lvd-modal { align-items:center; }
    .lvd-modal-card { border-radius:20px; max-height:84vh; }
}

/* ══════════ Fiche du jour REFONTE (app livreur moderne, .lvd2-*) ══════════ */
/* MODE PAGE : la fiche du jour n'est PAS une fenêtre à défilement interne mais
   une vraie page dont le DOCUMENT défile. Décisif contre le « tirer pour
   actualiser » : tant que la page a un défilement interne (fenêtre fixe), le
   WebView croit être en permanence tout en haut → il déclenche l'actualisation
   au moindre glissement. En laissant le document défiler, le geste ne se
   déclenche plus (et overscroll-behavior reprend son effet). */
body.lvd-day-mode > .main-content,
body.lvd-day-mode > #bottomNav,
body.lvd-day-mode > #fabBtn,
body.lvd-day-mode > .sidebar,
body.lvd-day-mode > .sidebar-overlay { display:none !important; }
body.lvd-day-mode { background:#eef1f6; }
#lvd-modal { position:static; inset:auto; z-index:auto; background:#eef1f6; }
#lvd-modal .lvd-modal-backdrop { display:none; }
#lvd-modal .lvd-modal-close { display:none; }
#lvd-modal .lvd-modal-card { position:static; width:100%; max-width:none; height:auto; min-height:100dvh;
    max-height:none; border-radius:0; padding:0; background:#eef1f6; box-shadow:none; overflow:visible;
    display:block; animation:none; }
#lvd-day { display:block; font-family:'Manrope','Segoe UI',system-ui,sans-serif; }
/* Plus de scroller interne : c'est le document qui défile. */
.lvd2-scroll { overflow:visible; }
.lvd2-list { padding-bottom:96px; } /* espace pour le dock fixe en bas */
/* Coupe le tirer-pour-actualiser au niveau du document (désormais efficace car
   le document est bien le conteneur qui défile). */
html, body { overscroll-behavior-y:none; }

/* — Bandeau tournée — */
.lvd2-hero { position:sticky; top:0; z-index:20; color:#fff; padding:14px 18px 18px;
    background:linear-gradient(160deg,#1A3553 0%,#0F2238 100%);
    border-radius:0 0 22px 22px; box-shadow:0 10px 26px rgba(15,34,56,.28); }
.lvd2-hero-top { display:flex; align-items:center; gap:12px; }
.lvd2-ic { width:38px; height:38px; border-radius:12px; border:1px solid rgba(255,255,255,.16);
    background:rgba(255,255,255,.08); color:#fff; font-size:22px; line-height:1; cursor:pointer; flex:none; }
.lvd2-ic:active { transform:scale(.94); }
.lvd2-htitles { flex:1; min-width:0; }
.lvd2-kick { font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:#FDC615; font-weight:700; }
.lvd2-day { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:18px; line-height:1.15; margin-top:1px; text-transform:capitalize; }
.lvd2-driver { font-size:12.5px; color:#c3d2e4; margin-top:2px; }
.lvd2-prog { display:flex; align-items:center; gap:16px; margin-top:15px; }
.lvd2-ring { position:relative; width:76px; height:76px; flex:none; }
.lvd2-ring-val { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1; }
.lvd2-ring-val .n { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:19px; }
.lvd2-ring-val .n b { color:#FDC615; }
.lvd2-ring-val .l { font-size:9px; letter-spacing:.1em; text-transform:uppercase; color:#a9bbd0; margin-top:3px; }
.lvd2-stats { flex:1; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.lvd2-stat { background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.09); border-radius:14px; padding:9px 11px; }
.lvd2-stat .k { font-size:10px; letter-spacing:.04em; text-transform:uppercase; color:#a9bbd0; font-weight:600; }
.lvd2-stat .v { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:15px; margin-top:3px; font-variant-numeric:tabular-nums; }
.lvd2-stat.cash .v { color:#FDC615; }
.lvd2-pills { display:flex; gap:9px; margin-top:14px; }
.lvd2-pill { flex:1; display:flex; align-items:center; justify-content:center; gap:7px; font-family:inherit;
    background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.16); color:#fff;
    border-radius:13px; padding:10px; font-size:13px; font-weight:600; cursor:pointer; }
.lvd2-pill:active { transform:scale(.97); }
.lvd2-pill.solid { background:#FDC615; border-color:#FDC615; color:#0F2238; font-weight:700; }

/* — Filtres — */
.lvd2-seg { display:flex; gap:6px; padding:14px 16px 2px; }
.lvd2-seg button { flex:1; border:1px solid #e4e9f0; background:#fff; color:#6a7c92; font-family:inherit;
    border-radius:11px; padding:8px 6px; font-size:12.5px; font-weight:600; cursor:pointer;
    display:flex; align-items:center; justify-content:center; gap:6px; }
.lvd2-seg button .c { background:#eef1f6; color:#6a7c92; font-size:11px; font-weight:700; border-radius:8px; padding:1px 7px; min-width:20px; }
.lvd2-seg button.on { background:#1A3553; border-color:#1A3553; color:#fff; }
.lvd2-seg button.on .c { background:rgba(255,255,255,.2); color:#fff; }

/* — Liste des arrêts — */
.lvd2-list { padding:8px 14px 8px; display:flex; flex-direction:column; gap:11px; }
.lvd2-group { display:flex; align-items:center; gap:9px; margin:8px 2px 0; color:#6a7c92;
    font-size:11px; letter-spacing:.08em; text-transform:uppercase; font-weight:700; }
.lvd2-group::after { content:""; flex:1; height:1px; background:#e4e9f0; }
.lvd2-stop { position:relative; background:#fff; border-radius:18px; border:1px solid #eef2f7;
    box-shadow:0 2px 4px rgba(16,38,60,.06),0 8px 22px rgba(16,38,60,.07); overflow:hidden; }
.lvd2-main { display:flex; gap:12px; padding:13px 14px; align-items:flex-start; cursor:pointer; }
.lvd2-ord { width:30px; height:30px; border-radius:10px; flex:none; display:grid; place-items:center;
    font-family:'Comfortaa',sans-serif; font-weight:700; font-size:14px; background:#eef1f6; color:#1A3553; border:1.5px solid #e4e9f0; }
.lvd2-b { flex:1; min-width:0; }
.lvd2-r1 { display:flex; align-items:baseline; gap:8px; justify-content:space-between; }
.lvd2-ref { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:13.5px; color:#1A3553; }
.lvd2-amt { font-family:'Comfortaa',sans-serif; font-weight:700; font-size:14px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.lvd2-amt.due { color:#E51F21; }
.lvd2-paid { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:#1FA463;
    background:rgba(31,164,99,.1); padding:3px 9px; border-radius:20px; white-space:nowrap; }
.lvd2-done-tag { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:#1FA463; white-space:nowrap; }
.lvd2-client { font-weight:700; font-size:15px; margin-top:4px; color:#12263c; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lvd2-meta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:5px; font-size:12px; color:#6a7c92; }
.lvd2-chip { display:inline-flex; align-items:center; gap:4px; background:#eef1f6; border-radius:8px; padding:2px 8px; font-weight:600; color:#1A3553; }
.lvd2-desc { margin-top:8px; font-size:12.5px; color:#54657a; background:#eef2f7; border-radius:9px; padding:7px 10px; }
.lvd2-caret { color:#6a7c92; font-size:13px; transition:transform .2s; flex:none; align-self:center; }
.lvd2-acts { max-height:0; overflow:hidden; transition:max-height .28s ease; }
.lvd2-stop.open .lvd2-acts { max-height:320px; }
.lvd2-stop.open .lvd2-caret { transform:rotate(180deg); }
.lvd2-acts-in { padding:2px 14px 14px; display:flex; flex-direction:column; gap:9px; }
.lvd2-livrer { width:100%; border:none; border-radius:13px; padding:13px; font-family:inherit; font-weight:800; font-size:15px;
    color:#fff; background:linear-gradient(135deg,#1FA463,#178a53); cursor:pointer;
    display:flex; align-items:center; justify-content:center; box-shadow:0 6px 16px rgba(23,138,83,.3); }
.lvd2-livrer:active { transform:scale(.98); }
.lvd2-act-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(66px,1fr)); gap:8px; }
.lvd2-act { border:1px solid #e4e9f0; background:#fff; border-radius:12px; padding:9px 4px 7px; cursor:pointer; text-decoration:none;
    display:flex; flex-direction:column; align-items:center; gap:4px; font-size:10.5px; font-weight:600; color:#6a7c92; font-family:inherit; }
.lvd2-act:active { transform:scale(.96); }
.lvd2-act .ic { width:30px; height:30px; border-radius:10px; display:grid; place-items:center; font-size:15px; color:#fff; }
.lvd2-act.call .ic { background:#1A3553; }
.lvd2-act.wa .ic { background:#25D366; }
.lvd2-act.pay .ic { background:#F0A315; }
.lvd2-act.reassign .ic { background:#7688a0; }
.lvd2-reorder { display:flex; gap:8px; }
.lvd2-reorder button { flex:1; border:1px dashed #cbd5e1; background:#f8fafc; color:#6a7c92; border-radius:10px;
    padding:8px; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; }
.lvd2-reorder button:disabled { opacity:.4; cursor:default; }

/* Arrêt EN COURS (mis en avant) */
.lvd2-stop.current { border:2px solid #FDC615; box-shadow:0 10px 30px rgba(253,198,21,.22),0 8px 30px rgba(16,38,60,.14); }
.lvd2-stop.current .lvd2-ord { background:#FDC615; color:#0F2238; border-color:#FDC615; }
.lvd2-now { position:absolute; top:-1px; left:16px; background:#FDC615; color:#0F2238; font-size:10px; font-weight:800;
    letter-spacing:.06em; text-transform:uppercase; padding:3px 10px; border-radius:0 0 10px 10px; box-shadow:0 3px 8px rgba(253,198,21,.4); }
.lvd2-stop.current .lvd2-main { padding-top:20px; }

/* Arrêt LIVRÉ (estompé, compact) */
.lvd2-stop.done { box-shadow:none; border:1px solid #e4e9f0; background:#fafcfe; }
.lvd2-stop.done .lvd2-main { padding:11px 14px; }
.lvd2-stop.done .lvd2-ord { background:rgba(31,164,99,.12); color:#1FA463; border-color:transparent; }
.lvd2-stop.done .lvd2-client { color:#6a7c92; font-weight:600; font-size:13.5px; }
.lvd2-stop.done .lvd2-ref { color:#6a7c92; }

/* — Barre du bas : itinéraire (fixée en bas de l'écran en mode page) — */
.lvd2-dock { position:fixed; left:0; right:0; bottom:0; z-index:1300;
    padding:12px 16px calc(12px + env(safe-area-inset-bottom));
    background:#eef1f6; box-shadow:0 -6px 20px rgba(16,38,60,.10); }
.lvd2-maps { width:100%; border:none; border-radius:15px; padding:15px; font-family:'Comfortaa',sans-serif; font-weight:700; font-size:15px;
    color:#fff; background:linear-gradient(135deg,#1A3553,#0F2238); cursor:pointer;
    display:flex; align-items:center; justify-content:center; gap:10px; box-shadow:0 8px 30px rgba(16,38,60,.24); }
.lvd2-maps:active { transform:scale(.98); }
@media (prefers-reduced-motion:reduce) { .lvd2-acts,.lvd2-caret,.lvd2-ic,.lvd2-pill,.lvd2-act,.lvd2-livrer,.lvd2-maps { transition:none; } }

/* ── Mini-modales En cours (Programmer / Attribuer / Statut) charte AMT ── */
.lvmm .lvmm-card { padding:0; width:92%; max-width:440px; overflow:hidden; border-radius:18px; }
.lvmm-head { display:flex; align-items:center; justify-content:space-between; gap:10px;
    background:linear-gradient(135deg,#1A3553,#2C4E76); color:#fff; padding:16px 20px; }
.lvmm-head h2 { margin:0; font-family:'Comfortaa',sans-serif; font-weight:700; font-size:17px; color:#fff; }
.lvmm-x { background:rgba(255,255,255,.16); border:0; color:#fff; width:32px; height:32px; border-radius:50%;
    font-size:20px; line-height:1; cursor:pointer; flex:0 0 auto; transition:.15s; }
.lvmm-x:hover { background:rgba(255,255,255,.32); }
.lvmm-body { padding:20px; }
.lvmm-sub { margin:0 0 16px; font-size:13.5px; color:#5A7088; }
.lvmm-sub strong { color:#E51F21; font-weight:800; }
.lvmm-field { margin-bottom:14px; }
.lvmm-field label { display:block; font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:#1A3553; margin-bottom:6px; }
.lvmm-field input, .lvmm-field select { width:100%; height:44px; border:1px solid #D8E1EA; border-radius:10px;
    padding:0 12px; font-size:14px; color:#1A3553; background:#F8FAFC; box-sizing:border-box; }
.lvmm-field input:focus, .lvmm-field select:focus { outline:none; border-color:#F2A312; box-shadow:0 0 0 3px rgba(242,163,18,.18); background:#fff; }
.lvmm-foot { display:flex; gap:10px; padding:4px 20px 20px; }
.lvmm-btn { flex:1; height:46px; border:0; border-radius:11px; font-size:14px; font-weight:700; cursor:pointer; transition:.15s; }
.lvmm-save { background:linear-gradient(135deg,#F2A312,#E08600); color:#fff; box-shadow:0 4px 12px rgba(242,163,18,.3); }
.lvmm-save:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(242,163,18,.42); }
.lvmm-cancel { background:#EEF2F6; color:#5A7088; }
.lvmm-cancel:hover { background:#E1E8EF; }

/* ── Habillage AMT réutilisable pour les modales génériques (.amt-modal) ── */
.amt-modal .modal-content { border-radius:18px; position:relative; }
.amt-modal .modal-header { background:linear-gradient(135deg,#1A3553,#2C4E76) !important; border-bottom:0 !important; border-radius:16px 16px 0 0; }
.amt-modal .modal-header .icon-btn { color:#fff !important; }
.amt-modal .modal-header,
.amt-modal .modal-header h2,
.amt-modal .modal-header h3,
.amt-modal .modal-header .modal-header__title { color:#fff !important; }
.amt-modal .modal-header h2 { font-family:'Comfortaa',sans-serif; font-weight:700; }
.amt-modal .close-modal { color:rgba(255,255,255,.85); transition:.15s; }
.amt-modal .close-modal:hover { color:#fff; }
/* croix placée hors de l'en-tête (flottante) → calée sur la barre */
.amt-modal .modal-content > .close-modal { position:absolute; top:13px; right:18px; z-index:120; float:none !important; }
.amt-modal label { color:#1A3553; font-weight:600; }
.amt-modal input:focus, .amt-modal select:focus, .amt-modal textarea:focus {
    border-color:#F2A312 !important; box-shadow:0 0 0 3px rgba(242,163,18,.18) !important; }
.amt-modal .btn.btn-success { background:linear-gradient(135deg,#F2A312,#E08600) !important; border:0 !important; color:#fff !important; }
.amt-modal .btn.btn-success:hover { background:linear-gradient(135deg,#E08600,#C77400) !important; }
.amt-modal .btn.btn-warning { background:#fff !important; border:1.5px solid #F2A312 !important; color:#C77E00 !important; }
.amt-modal .btn.btn-warning:hover { background:#FFF6E6 !important; }
.amt-modal .btn.btn-danger { background:#E51F21 !important; border:0 !important; color:#fff !important; }
.amt-modal .btn.btn-danger:hover { background:#C81719 !important; }

/* ── COMMAND BAR ── */
.lv-command-bar { background:linear-gradient(120deg,#16304C 0%,#1A3553 45%,#274C72 100%); border-bottom:2px solid #F2A312; padding:0 16px; position:sticky; top:0; z-index:60; box-shadow:0 6px 18px -8px rgba(11,37,64,.45); }
.lv-toprow { display:flex; align-items:center; gap:12px; padding:8px 0 6px; border-bottom:1px solid var(--lv-border); flex-wrap:wrap; }
.lv-stat-chips { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.lv-chip { display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:999px; font-size:11.5px; font-weight:700; border:1px solid; white-space:nowrap; box-shadow:0 2px 6px -3px rgba(0,0,0,.35); }
.lv-chip .n { font-size:14px; font-weight:800; line-height:1; }
.lv-chip.total { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.lv-chip.attente { background:#fffbeb; color:#b45309; border-color:#fde68a; }
.lv-chip.livre { background:#f0fdf4; color:#166534; border-color:#bbf7d0; }
.lv-chip.partiel { background:#fff7ed; color:#c2410c; border-color:#fed7aa; }
.lv-toprow-right { margin-left:auto; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lv-container-badge { display:inline-flex; align-items:center; gap:5px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:6px; padding:4px 9px; font-size:12px; font-weight:700; color:#1565c0; cursor:pointer; transition:background .15s; white-space:nowrap; }
.lv-container-badge:hover { background:#dbeafe; }

/* Livraison : on masque l'ANCIENNE boîte "conteneur actif" (rectangle bleu
   pâle + champ + OK) au profit du nouveau badge/popup. !important pour
   neutraliser le style inline posé par switchTab. L'input #activeContainerInput
   reste dans le DOM (caché) car la nouvelle modale s'appuie dessus. */
#activeContainerSection { display:none !important; }

/* ── ONGLETS ── */
.lv-tabs { display:flex; align-items:center; gap:4px; padding:8px 0; overflow-x:auto; }
.lv-tab { padding:8px 15px; border:none; background:none; font-size:13px; font-weight:700; color:rgba(255,255,255,.72); cursor:pointer; border-radius:999px; white-space:nowrap; display:inline-flex; align-items:center; gap:6px; transition:all .18s; font-family:inherit; }
.lv-tab:not(.active):hover { background:rgba(255,255,255,.12); color:#fff; }
#lvT-EN_COURS:not(.active):hover,
#lvT-A_VENIR:not(.active):hover,
#lvT-PARIS:not(.active):hover,
#lvT-PROGRAMME:not(.active):hover { color:#fff; }
.lv-badge { background:rgba(255,255,255,.18); color:#fff; border-radius:999px; padding:1px 7px; font-size:10px; font-weight:800; }
.lv-tab.active { background:#fff; box-shadow:0 4px 12px -4px rgba(0,0,0,.4); }
#lvT-EN_COURS.active { color:#1d4ed8; }
#lvT-A_VENIR.active { color:#b45309; }
#lvT-PARIS.active { color:#B5181A; }
#lvT-PROGRAMME.active { color:#6d28d9; }
.lv-tab.active .lv-badge { background:rgba(15,23,42,.08); color:inherit; }
.lv-tabs-spacer { flex:1; min-width:8px; }
.lv-help-btn { padding:6px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.28); background:rgba(255,255,255,.06); color:#fff; font-size:12px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:4px; white-space:nowrap; transition:all .15s; font-family:inherit; }
.lv-help-btn:hover { background:rgba(255,255,255,.16); color:#fff; }

/* ── TOOLBAR ── */
.lv-toolbar { background:var(--lv-surface); border-bottom:1px solid var(--lv-border); padding:7px 16px; display:flex; align-items:center; gap:5px; flex-wrap:wrap; position:sticky; top:95px; z-index:99; }
.lv-grp { display:inline-flex; align-items:center; gap:1px; padding:2px; background:#f8fafc; border:1px solid var(--lv-border); border-radius:8px; flex-shrink:0; }
.lv-sep { width:1px; height:22px; background:var(--lv-border); margin:0 4px; flex-shrink:0; }
.lv-btn { display:inline-flex; align-items:center; gap:4px; padding:6px 11px; border-radius:8px; border:none; background:transparent; color:var(--lv-text); font-size:12px; font-weight:600; cursor:pointer; transition:all .15s; white-space:nowrap; font-family:inherit; line-height:1; }
.lv-btn:hover { background:#e8eef5; color:#1A3553; }
.lv-btn:active { transform:scale(.97); }
.lv-btn.ok { background:var(--lv-blue); color:#fff; }
.lv-btn.ok:hover { background:var(--lv-blue-d); }
.lv-btn.go { background:var(--lv-green); color:#fff; }
.lv-btn.go:hover { background:var(--lv-green-d); }
.lv-btn.rm { background:var(--lv-red); color:#fff; }
.lv-btn.rm:hover { background:var(--lv-red-d); }
.lv-btn.warn { background:var(--lv-amber); color:#fff; }
.lv-btn.purp { background:var(--lv-purple); color:#fff; }
.lv-btn.ghost { border:1px solid var(--lv-border2); }
.lv-btn.ghost:hover { background:#f1f5f9; border-color:var(--lv-blue); color:var(--lv-blue); }
.lv-import-lbl { display:inline-flex; align-items:center; gap:4px; padding:5px 9px; border-radius:6px; background:transparent; color:var(--lv-text); font-size:12px; font-weight:600; cursor:pointer; transition:background .15s; white-space:nowrap; }
.lv-import-lbl:hover { background:#e2e8f0; }

/* ── MORE MENU ── */
.lv-more { position:relative; }
.lv-more-drop { display:none; position:absolute; top:calc(100% + 4px); right:0; background:var(--lv-surface); border:1px solid var(--lv-border); border-radius:10px; box-shadow:var(--lv-shadow2); min-width:185px; z-index:300; padding:4px; overflow:hidden; }
.lv-more-drop.open { display:block; animation:lvSlide .12s ease-out; }
@keyframes lvSlide { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:none} }
.lv-mi { display:flex; align-items:center; gap:9px; padding:8px 11px; border-radius:6px; font-size:13px; font-weight:500; color:var(--lv-text); cursor:pointer; transition:background .1s; border:none; background:none; width:100%; text-align:left; font-family:inherit; }
.lv-mi:hover { background:#f1f5f9; }
.lv-mi.red { color:var(--lv-red); }
.lv-mi.red:hover { background:#fef2f2; }
.lv-mi-sec { padding:4px 11px 2px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--lv-muted); }
.lv-mi-div { height:1px; background:var(--lv-border); margin:3px 0; }

/* ── FILTRE BAR ── */
.lv-filter-bar { background:#fff; border-bottom:1px solid var(--lv-border); padding:9px 16px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; box-shadow:0 3px 8px -6px rgba(11,37,64,.25); }
.lv-search-w { position:relative; flex:1; min-width:160px; max-width:320px; }
.lv-search-w .ico { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--lv-muted); font-size:12px; pointer-events:none; }
.lv-search { width:100%; padding:7px 12px 7px 30px; border:1px solid var(--lv-border2); border-radius:999px; font-size:13px; background:#f8fafc; color:var(--lv-text); transition:all .15s; }
.lv-search:focus { outline:none; border-color:#F2A312; background:#fff; box-shadow:0 0 0 3px rgba(242,163,18,.18); }
.lv-cont-sec { display:inline-flex; align-items:center; gap:5px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:7px; padding:3px 7px; }
.lv-cont-label { font-size:11px; font-weight:700; color:#1565c0; white-space:nowrap; }
.lv-cont-input { padding:3px 7px; border:1px solid #bfdbfe; border-radius:5px; font-size:12px; font-weight:600; width:105px; background:#fff; color:#1565c0; }
.lv-cont-input:focus { outline:none; border-color:var(--lv-blue); }
.lv-cont-ok { padding:3px 7px; border-radius:5px; border:none; background:var(--lv-blue); color:#fff; font-size:11px; font-weight:700; cursor:pointer; transition:background .15s; }
.lv-cont-ok:hover { background:var(--lv-blue-d); }
.lv-fcb { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; color:#0284c7; cursor:pointer; }
.lv-filter-bar .dropdown-toggle { font-size:12px; padding:6px 13px; font-weight:700; border-radius:999px; border:1px solid var(--lv-border2); background:#f8fafc; color:#475569; transition:all .15s; min-width:auto; }
.lv-filter-bar .dropdown-toggle:hover { border-color:#1A3553; color:#1A3553; background:#eef2f7; }
.lv-filter-bar .dropdown-menu { border-radius:12px; border-color:var(--lv-border2); box-shadow:0 12px 28px -10px rgba(11,37,64,.3); padding:8px; margin-top:6px; }
.lv-filter-bar .dropdown-menu label { border-radius:7px; padding:6px 8px; }
.lv-filter-bar .dropdown-menu label:hover { background:#f1f5f9; }
/* Filtre ACTIF (au moins une case cochée) : pastille marine + liseré or pour le repérer d'un coup d'œil */
.lv-filter-bar .dropdown-toggle.lv-filter-on { background:#1A3553; color:#fff; border-color:#1A3553; box-shadow:0 0 0 2px rgba(242,163,18,.55); font-weight:800; }
.lv-filter-bar .dropdown-toggle.lv-filter-on:hover { background:#24466B; color:#fff; border-color:#24466B; }

/* ── BARRE DE SÉLECTION ── */
.lv-sel-bar { display:none; align-items:center; gap:8px; padding:5px 16px; background:#1e293b; color:#fff; font-size:12px; font-weight:600; border-bottom:1px solid #334155; flex-wrap:wrap; }
.lv-sel-bar.show { display:flex; }
.lv-sel-count { background:var(--lv-blue); border-radius:10px; padding:2px 7px; font-size:11px; font-weight:700; }
.lv-sel-sep { opacity:.3; }
.lv-sb { padding:3px 9px; border-radius:5px; border:1px solid rgba(255,255,255,.2); background:transparent; color:#fff; font-size:11px; font-weight:600; cursor:pointer; transition:background .15s; font-family:inherit; display:inline-flex; align-items:center; gap:3px; white-space:nowrap; }
.lv-sb:hover { background:rgba(255,255,255,.15); }
.lv-sb.red { color:#fca5a5; border-color:rgba(252,165,165,.4); }
.lv-sb.red:hover { background:rgba(239,68,68,.25); }
.lv-sb.green { color:#86efac; }
.lv-sel-x { margin-left:auto; opacity:.5; cursor:pointer; background:none; border:none; color:#fff; font-size:14px; line-height:1; }
.lv-sel-x:hover { opacity:1; }

/* ── MODALE CONTENEUR RAPIDE ── */
.lv-qmodal { position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:3000; display:none; align-items:center; justify-content:center; backdrop-filter:blur(2px); }
.lv-qmodal.active { display:flex; }
.lv-qbox { background:#fff; border-radius:14px; padding:22px; min-width:300px; max-width:90vw; box-shadow:0 20px 40px rgba(0,0,0,.15); }
.lv-qbox-title { font-size:18px; font-weight:800; color:var(--lv-blue); margin-bottom:20px; display:flex; align-items:center; justify-content:center; gap:8px; text-align:center; }

/* ── CONTEXT DESC ── */
.lv-ctx { background:linear-gradient(to right,#eff6ff,#f8fafc); border-left:3px solid var(--lv-blue); padding:7px 16px; font-size:12px; color:var(--lv-muted); border-bottom:1px solid var(--lv-border); display:none; }
.lv-ctx.show { display:block; }

/* ── MENU ACTIONS CONTEXTUEL ── */
.act-menu-wrap { position:relative; display:inline-block; }
.act-more-btn { background:#f1f5f9; color:#475569; border:1px solid #e2e8f0; padding:4px 8px; font-size:13px; border-radius:5px; cursor:pointer; transition:background .15s; }
.act-more-btn:hover { background:#e2e8f0; }
/* position:fixed -> le menu est placé à l'écran par JS (toggleActionMenu) pour ne
   JAMAIS être coupé par le bas du tableau (conteneur avec overflow). */
.act-dropdown { display:none; position:fixed; background:#fff; border:1px solid #e2e8f0; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.12); min-width:170px; z-index:9999; padding:4px; white-space:nowrap; }
.act-menu-wrap.open .act-dropdown { display:block; animation:lvSlide .1s ease-out; }
/* Menu « portalisé » dans le <body> (sorti du tableau) : visible où qu'il soit. */
.act-dropdown.act-floating { display:block; animation:lvSlide .1s ease-out; }
.act-mi { display:flex; align-items:center; gap:8px; width:100%; padding:7px 10px; border:none; background:none; font-size:12px; font-weight:600; color:#334155; cursor:pointer; border-radius:5px; transition:background .1s; font-family:inherit; text-align:left; }
.act-mi:hover { background:#f8fafc; }
.act-mi.act-green { color:#059669; }
.act-mi.act-green:hover { background:#f0fdf4; }
.act-mi.act-red { color:#dc2626; }
.act-mi.act-red:hover { background:#fef2f2; }
.act-mi.act-dark { color:#1e293b; }
.act-div { height:1px; background:#e2e8f0; margin:3px 0; }

@media(max-width:768px){
    .lv-toolbar{top:78px;padding:5px 8px;}
    .lv-btn .lv-l{display:none;}
    .lv-chip{padding:2px 6px;font-size:11px;}
}

/* ============================================================================
   DESIGN SYSTEM AMT — Cards style A "Premium AMT" + Boutons style B "Soleil"
   Triade officielle : Bleu de Prusse #1A3553 · Rouge #E51F21 · Or #F2A312
   ----------------------------------------------------------------------------
   ADDITIF : ces classes coexistent avec l'existant (stat-card, total-card…).
   Les pages migrent progressivement en remplaçant leurs classes inline par
   .amt-kpi / .amt-btn-* / .amt-row.
   ============================================================================ */
:root {
    --amt-blue: #1A3553;
    --amt-blue-deep: #0F2238;
    --amt-blue-soft: #2C4E76;
    --amt-red: #E51F21;
    --amt-red-deep: #B5181A;
    --amt-gold: #F2A312;
    --amt-gold-deep: #B8780A;
    --amt-gold-light: #FFD98A;
    --amt-gold-warm: #FDF1DA;
    --amt-ink: #0B2540;
    --amt-line: rgba(11,37,64,0.10);
    --amt-line-strong: rgba(11,37,64,0.18);
    --amt-text-dim: #4A6178;
}

/* ─── Cards KPI : style A Premium (gradients + watermark + ombres) ─────── */
.amt-kpi {
    position: relative; overflow: hidden;
    border-radius: clamp(13px, 1.5vw, 16px);
    /* Taille FLUIDE (clamp) : la carte se réduit en douceur sur petit écran,
       sans saut brusque, et garde le rendu actuel en grand écran. */
    padding: clamp(13px, 2vw, 18px) clamp(14px, 2.4vw, 22px);
    color: white;
    box-shadow: 0 10px 25px -8px rgba(11,37,64,0.25), 0 4px 8px -3px rgba(11,37,64,0.08);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s;
    min-height: clamp(94px, 11vw, 110px);
    display: flex; flex-direction: column; justify-content: space-between;
    border: none;
    text-align: left;
}
.amt-kpi:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 22px 40px -12px rgba(11,37,64,0.32);
}
.amt-kpi:hover .amt-kpi-mark { transform: rotate(0deg) scale(1.18); opacity: 0.26; }

.amt-kpi-title {
    font-size: clamp(10.5px, 1.25vw, 12px);
    opacity: 0.92;
    font-weight: 600;
    margin-bottom: clamp(6px, 0.9vw, 9px);
    letter-spacing: -0.2px;
    color: white;
}
.amt-kpi-value {
    font-weight: 800;
    font-size: clamp(19px, 2.3vw, 24px);
    letter-spacing: -0.6px;
    color: white;
    line-height: 1.1;
}
.amt-kpi-sub {
    font-size: 11.5px;
    opacity: 0.85;
    margin-top: 6px;
    font-weight: 500;
    color: white;
}
.amt-kpi-mark {
    position: absolute;
    right: -12px; bottom: -18px;
    font-size: 80px;
    line-height: 1;
    opacity: 0.16;
    transform: rotate(-15deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s;
    pointer-events: none;
}

/* Variantes de couleur — bleu (défaut), or, rouge, vert, indigo */
.amt-kpi-blue   { background: linear-gradient(135deg, #2C4E76 0%, #1A3553 100%); }
.amt-kpi-deep   { background: linear-gradient(135deg, #1A3553 0%, #0F2238 100%); }
.amt-kpi-gold   { background: linear-gradient(135deg, #F2A312 0%, #C9850A 100%); }
.amt-kpi-red    { background: linear-gradient(135deg, #E8332A 0%, #971517 100%); }
.amt-kpi-green  { background: linear-gradient(135deg, #10B981 0%, #047857 100%); }
.amt-kpi-purple { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.amt-kpi-orange { background: linear-gradient(135deg, #fb923c 0%, #c2410c 100%); }

/* Span double-largeur dans une grille .amt-kpi-grid */
.amt-kpi-grid {
    display: grid;
    /* min(210px,100%) : ne déborde jamais sur écran très étroit ; gap fluide. */
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    gap: clamp(10px, 1.6vw, 16px);
    margin-bottom: clamp(16px, 2.2vw, 24px);
}
.amt-kpi.amt-span-2 { grid-column: span 2; }
@media (max-width: 640px) {
    /* Téléphone : 2 colonnes au lieu d'une seule, cartes plus compactes */
    .amt-kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .amt-kpi {
        padding: 13px 14px;
        min-height: 88px;
        border-radius: 13px;
    }
    .amt-kpi-title { font-size: 11px; margin-bottom: 6px; }
    .amt-kpi-value { font-size: 21px; letter-spacing: -0.5px; }
    .amt-kpi-mark  { font-size: 56px; right: -8px; bottom: -12px; }
    .amt-kpi.amt-span-2 { grid-column: span 2; }
}

/* ─── Boutons : style B "Soleil chaleureux" (or marigold) ───────────────── */
.amt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    border: none;
    font-family: inherit;
    line-height: 1;
}
.amt-btn:active { transform: scale(0.97); }
.amt-btn i { font-size: 14px; }

/* Variant : primaire or marigold (action principale) */
.amt-btn-primary {
    background: linear-gradient(135deg, var(--amt-gold) 0%, var(--amt-gold-deep) 100%);
    color: #1a0c08;
    box-shadow: 0 6px 14px -4px rgba(242,163,18,0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}
.amt-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -6px rgba(242,163,18,0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Variant : outline doré (action secondaire) */
.amt-btn-outline {
    background: white;
    color: var(--amt-gold-deep);
    border: 1.5px solid var(--amt-gold);
}
.amt-btn-outline:hover {
    background: var(--amt-gold-warm);
    border-color: var(--amt-gold-deep);
    transform: translateY(-2px);
}

/* Variant : bleu de Prusse (action structurante) */
.amt-btn-blue {
    background: linear-gradient(135deg, var(--amt-blue-soft) 0%, var(--amt-blue) 100%);
    color: white;
    box-shadow: 0 6px 14px -4px rgba(26,53,83,0.4);
}
.amt-btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -6px rgba(26,53,83,0.5);
}

/* Variant : rouge (alerte / suppression) */
.amt-btn-danger {
    background: linear-gradient(135deg, var(--amt-red) 0%, var(--amt-red-deep) 100%);
    color: white;
    box-shadow: 0 6px 14px -4px rgba(229,31,33,0.4);
}
.amt-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -6px rgba(229,31,33,0.5);
}

/* Variant : ghost (action discrète) */
.amt-btn-ghost {
    background: transparent;
    color: var(--amt-blue);
    border: 1px solid var(--amt-line);
}
.amt-btn-ghost:hover {
    background: #f8fafc;
    border-color: var(--amt-line-strong);
}

/* Tailles */
.amt-btn-sm { padding: 7px 12px; font-size: 12px; }
.amt-btn-lg { padding: 14px 24px; font-size: 15px; }
.amt-btn-full { width: 100%; }

/* ─── Quick-action button (grille du dashboard) — style B chaleureux ──── */
.amt-quick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--amt-line);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 4px 10px -4px rgba(11,37,64,0.06);
    text-align: center;
    font-family: inherit;
}
.amt-quick:hover {
    transform: translateY(-3px);
    border-color: var(--amt-gold);
    box-shadow: 0 12px 22px -6px rgba(242,163,18,0.25);
}
.amt-quick .amt-quick-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--amt-gold-warm) 0%, rgba(242,163,18,0.18) 100%);
    color: var(--amt-gold-deep);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    border: 1px solid rgba(242,163,18,0.25);
}
.amt-quick:hover .amt-quick-icon {
    background: linear-gradient(135deg, var(--amt-gold) 0%, var(--amt-gold-deep) 100%);
    color: #1a0c08;
    border-color: var(--amt-gold-deep);
}
.amt-quick-label {
    font-size: 12px;
    color: var(--amt-blue);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.1px;
}

/* ─── Section label (titre de bloc) ─────────────────────────────────────── */
.amt-section-label {
    font-size: 11px;
    color: var(--amt-text-dim);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 10px;
}
.amt-section-label::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(to right, var(--amt-line), transparent);
}

/* ─── Card simple (panneaux génériques style B) ─────────────────────────── */
.amt-card {
    background: white;
    border-radius: 16px;
    padding: 22px 24px;
    border: 1px solid var(--amt-line);
    box-shadow: 0 6px 14px -8px rgba(11,37,64,0.08);
}
.amt-card-titled {
    border-left: 4px solid var(--amt-gold);
}

/* ─── Édition fantôme (inline) — page Livraison ─────────────────────────
   Un champ éditable ressemble à du texte ; il se révèle au survol, s'entoure
   de bleu en édition, et ressort en orange quand il est vide. */
.lv-ghost {
    border: 1px solid transparent;
    background: transparent;
    padding: 4px 6px;
    border-radius: 6px;
    font: inherit;
    color: #1e293b;
    width: 100%;
    box-sizing: border-box;
    transition: background .12s, border-color .12s;
    cursor: text;
}
.lv-ghost:hover { background: #f1f5f9; border-color: #e2e8f0; }
.lv-ghost:focus { outline: none; background: #eff6ff; border: 2px solid #3b82f6; padding: 3px 5px; }
/* La case active se DÉPLOIE pour montrer tout son contenu (tableau, colonnes étroites).
   Elle passe en absolu au-dessus des cases voisines ; la largeur est posée en JS. */
.lv-ghost-wrap { position: relative; display: block; min-height: 26px; }
td .lv-ghost:focus { position: absolute; left: 0; top: -1px; min-width: 220px; z-index: 30; box-shadow: 0 8px 20px -8px rgba(0,0,0,.35); }
/* Champ vide → « à compléter » (repère « ce qui manque ») */
.lv-ghost.lv-empty {
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    color: #b45309;
}
.lv-ghost.lv-empty::placeholder { color: #b45309; opacity: 1; }
/* Petit ✓ d'enregistrement (ajouté à côté du champ) */
.lv-saved-tick {
    color: #16a34a; font-size: 11px; font-weight: 700; margin-left: 6px;
    opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.lv-saved-tick.show { opacity: 1; }
/* Toast Annuler */
.lv-undo-toast {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    background: #1e293b; color: #fff; padding: 9px 14px; border-radius: 10px;
    display: flex; align-items: center; gap: 12px; font-size: 13px;
    box-shadow: 0 10px 25px -8px rgba(0,0,0,.35); z-index: 12000;
}
.lv-undo-toast button {
    background: #f59e0b; color: #1e293b; border: 0; padding: 5px 12px;
    border-radius: 7px; font-weight: 700; cursor: pointer; font-family: inherit;
}
/* Champs éditables (fantôme) empilés dans une fiche */
.lv-c-fields { margin: 6px 0; }
.lv-c-field { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.lv-c-field .lv-c-lbl { font-size: 14px; min-width: 20px; text-align: center; flex-shrink: 0; }
.lv-c-field .lv-ghost { font-size: 13px; flex: 1; min-width: 0; }

