/* ====================================================================
   style.css — Feuille de style principale
   Thème SaaS moderne avec sidebar et couleurs dynamiques par compagnie
   ==================================================================== */

:root {
    --compagnie-couleur: #0d6efd;
    --sidebar-bg: #1e293b;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    margin: 0;
}

/* --- Sidebar --- */
.wrapper { display: flex; width: 100%; }

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h5 { font-weight: 700; }

.sidebar ul.components { padding: 15px 0; flex: 1; margin: 0; overflow-y: auto; }

.sidebar ul li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.sidebar ul li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar ul li.active a {
    background: rgba(255,255,255,0.12);
    border-left-color: var(--compagnie-couleur);
    color: #fff;
    font-weight: 600;
}

.sidebar ul li a i { margin-right: 10px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- Content --- */
.content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.navbar { border-radius: 0; }

/* --- Cartes de statistiques --- */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card .stat-icon {
    width: 50px; height: 50px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: #64748b;
    font-size: 0.85rem;
}

/* --- Tableaux --- */
.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.table tbody tr:hover { background: #f8fafc; }

/* --- Boutons action --- */
.btn-action {
    padding: 4px 8px;
    font-size: 0.85rem;
    margin-right: 2px;
}

/* --- Badges --- */
.badge { font-size: 0.75rem; padding: 5px 10px; }

/* --- Cartes --- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* --- Lignes de devis/factures --- */
.ligne-article {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

/* --- Zone de drag & drop --- */
.dropzone {
    border: 3px dashed #cbd5e1;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--compagnie-couleur);
    background: #f0f4ff;
}

/* --- Alertes retard --- */
.alert-retard {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

/* --- Bannière compagnie --- */
.banniere-compagnie {
    background: linear-gradient(135deg, var(--compagnie-couleur), color-mix(in srgb, var(--compagnie-couleur) 70%, #000));
    color: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

/* --- Responsive sidebar --- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .content { width: 100%; margin-left: 0; }
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
}

/* --- Facture PDF preview --- */
.facture-preview {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.facture-preview table { width: 100%; }
.facture-preview th { background: #f1f5f9; padding: 10px; }
.facture-preview td { padding: 10px; border-bottom: 1px solid #e2e8f0; }

/* --- Progress bar dépôt/solde --- */
.progress-depot {
    height: 25px;
    border-radius: 6px;
    overflow: hidden;
}

.progress-depot .progress-bar {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 25px;
}
