/* ═══════════════════════════════════════
   variables.css — Design tokens partagés
   FleetTrack · Gouvernance des Transports
   ═══════════════════════════════════════ */

   :root {
    --bg-main: #0f111a;
    --bg-sidebar: #161925;
    --bg-card: #1c2030;
    --bg-input: #121420;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    --accent: #00e699;
    --accent-hover: #00b377;
    --info: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font); }
body { background-color: var(--bg-main); color: var(--text-main); }

/* ── Boutons ── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.15s ease;
}
.btn-primary { background: var(--accent); color: var(--text-dark); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.08); }
.btn-danger { background: rgba(239,64,64,0.1); color: var(--danger); border: 1px solid rgba(239,64,64,0.2); }
.btn-driver { background: rgba(59,130,246,0.1); color: var(--info); border: 1px solid rgba(59,130,246,0.25); }
.btn-driver:hover { background: rgba(59,130,246,0.18); }

/* ── Formulaires ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group input,
.form-group select {
    width: 100%; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 10px 12px; font-size: 13px;
    color: var(--text-main); outline: none; transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--accent); }

.form-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--accent); margin: 18px 0 10px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.form-section-title:first-child { margin-top: 0; }

/* ── Toasts ── */
.toast-wrap {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--bg-card); border: 1px solid var(--border-hover);
    border-radius: var(--radius-md); padding: 12px 18px; font-size: 13px;
    display: flex; align-items: center; box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* ── Modals ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px); z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
    background: var(--bg-card); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg); width: min(540px, 100%);
    max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column;
}
.modal-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px; background: rgba(0,0,0,0.1);
}

/* ══════════════════════════════════════════════════════════
   Badge imprimable — Format Carte Bancaire CR-80 (85.6 x 54 mm)
   Paysage, recto seul. Dimensions PHYSIQUES réelles pour une
   impression à l'échelle 1:1 (pas de redimensionnement navigateur).
   ══════════════════════════════════════════════════════════ */

:root {
    --card-w: 85.6mm;
    --card-h: 54mm;
    --card-pad: 3mm;
}

.badge-printable {
    width: var(--card-w);
    height: var(--card-h);
    background: #ffffff; color: #000000;
    border: 1px solid #d0d5dd;
    border-radius: 3mm; /* coins arrondis façon carte réelle */
    padding: var(--card-pad);
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    font-family: Arial, Helvetica, sans-serif;
}

/* Bandeau d'identité en haut */
.badge-print-header {
    display: flex; align-items: center; gap: 2.5mm;
    border-bottom: 0.3mm solid #e2e8f0; padding-bottom: 1.5mm;
    flex-shrink: 0;
}
.badge-print-img {
    width: 13mm; height: 13mm; border-radius: 50%;
    object-fit: cover; border: 0.4mm solid #00b377; background: #eee;
    flex-shrink: 0;
}
.badge-print-title { min-width: 0; overflow: hidden; }
.badge-print-title h4 {
    font-size: 9.5px; font-weight: 700; color: #1a202c;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.badge-print-title p {
    font-size: 7.5px; color: #00b377; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge-print-title span {
    font-size: 7px; font-family: monospace; color: #718096;
}

/* Corps : infos clés à gauche, QR à droite */
.badge-print-body {
    display: flex; align-items: center; gap: 2mm;
    flex: 1; min-height: 0; margin-top: 1.5mm;
}
.badge-print-grid {
    flex: 1; min-width: 0;
    display: grid; grid-template-columns: 1fr; gap: 0.8mm;
    font-size: 6.5px;
}
.badge-print-cell {
    background: #f7fafc; border: 0.2mm solid #edf2f7;
    padding: 0.6mm 1.2mm; border-radius: 0.8mm;
    overflow: hidden;
    display: flex; align-items: baseline; gap: 1.5mm;
}
.badge-print-label {
    font-size: 5.3px; color: #718096; text-transform: uppercase;
    font-weight: 700; letter-spacing: 0.2px;
    flex-shrink: 0; width: 13mm;
}
.badge-print-value {
    font-weight: 600; color: #2d3748;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1;
}
.badge-print-qrcode {
    flex-shrink: 0; width: 22mm; height: 22mm;
    display: flex; justify-content: center; align-items: center;
    background: #fff; padding: 0.8mm; border: 0.2mm solid #edf2f7; border-radius: 1mm;
}
.badge-print-qrcode img, .badge-print-qrcode canvas, .badge-print-qrcode svg {
    width: 100% !important; height: 100% !important;
    image-rendering: pixelated; /* garde les modules QR nets à l'agrandissement */
}

/* Pied de carte */
.badge-print-footer {
    flex-shrink: 0; text-align: center; margin-top: 1mm;
    border-top: 0.3mm solid #e2e8f0; padding-top: 1mm;
}
.badge-print-caption {
    font-size: 5.5px; font-weight: 700; color: #4a5568;
    letter-spacing: 0.4px;
}

/* ── Impression : la carte sort à l'échelle 1:1, jamais redimensionnée ── */
@media print {
    body { background: #ffffff !important; color: #000 !important; }
    .badge-printable {
        border: 0.3mm solid #cbd5e0 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        box-shadow: none !important;
    }
    .no-print { display: none !important; }
}

/* ══════════════════════════════════════════════════════════
   Fiche de consultation détaillée — Modal "Voir le profil"
   Format libre (PAS lié aux dimensions physiques de la carte).
   Affiche toutes les infos ; le badge imprimé, lui, n'affiche
   que l'essentiel (voir .badge-printable ci-dessus).
   ══════════════════════════════════════════════════════════ */
.profile-detail {
    background: #ffffff; color: #000000; border-radius: 12px;
    padding: 16px; width: 100%; max-width: 400px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 12px; box-sizing: border-box;
}
.profile-detail-header { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; }
.profile-detail-img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid #00b377; background: #eee; }
.profile-detail-title h4 { font-size: 15px; font-weight: 700; color: #1a202c; }
.profile-detail-title p { font-size: 12px; color: #00b377; font-weight: 600; }
.profile-detail-title span { font-size: 11px; font-family: monospace; color: #718096; }
.profile-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; }
.profile-detail-cell { background: #f7fafc; border: 1px solid #edf2f7; padding: 6px 8px; border-radius: 6px; }
.profile-detail-label { font-size: 9px; color: #718096; text-transform: uppercase; font-weight: 700; }
.profile-detail-value { font-weight: 600; color: #2d3748; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-detail-footer { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #f7fafc; padding: 10px; border-radius: 8px; border: 1px solid #edf2f7; }
.profile-detail-qrcode { display: flex; justify-content: center; align-items: center; width: 110px; height: 110px; margin: 0 auto; }
.profile-detail-caption { font-size: 10px; color: #718096; text-align: center; line-height: 1.3; }