/* ═══════════════════════════════════════════════
   style.css — TransColis Design System
   ═══════════════════════════════════════════════ */

:root {
  --primary:     #1e3a5f;
  --primary-l:   #2563eb;
  --primary-lt:  #dbeafe;
  --accent:      #f59e0b;
  --success:     #10b981;
  --success-lt:  #d1fae5;
  --warning:     #f59e0b;
  --warning-lt:  #fef3c7;
  --danger:      #ef4444;
  --danger-lt:   #fee2e2;
  --info:        #6366f1;
  --info-lt:     #e0e7ff;
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-300:    #cbd5e1;
  --gray-400:    #94a3b8;
  --gray-600:    #475569;
  --gray-800:    #1e293b;
  --white:       #ffffff;
  --sidebar-w:   240px;
  --topbar-h:    60px;
  --radius:      10px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  min-height: 100vh;
  font-size: 14px;
}

/* Écran connecté — conteneur full-width flex (display:flex posé par JS) */
#app-screen {
  width: 100%;
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:var(--gray-100); }
::-webkit-scrollbar-thumb { background:var(--gray-300); border-radius:3px; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.logo-icon { font-size: 26px; }
.logo-title { color: #fff; font-weight: 700; font-size: 14px; line-height: 1.2; }
.logo-sub   { color: rgba(255,255,255,.5); font-size: 10px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  cursor: pointer;
  border-radius: 0 24px 24px 0;
  margin-right: 12px;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 500;
  transition: all .18s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color:#fff; }
.nav-item.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-weight: 600;
}
.nav-icon { font-size: 16px; min-width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.currency-toggle {
  display: flex;
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.curr-btn {
  flex: 1;
  padding: 6px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.6);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all .18s;
}
.curr-btn.active { background: #fff; color: var(--primary); }

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main {
  flex: 1;
  min-width: 0;          /* empêche le débordement de contenu en flex */
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray-600);
}
.topbar-title { font-weight: 700; font-size: 16px; flex: 1; }
.topbar-actions { display: flex; gap: 8px; }

.page-content { padding: 24px; flex: 1; }

/* ══════════════════════════════════════
   CARDS & STATS
══════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-lt); }
.stat-icon.green  { background: var(--success-lt); }
.stat-icon.yellow { background: var(--warning-lt); }
.stat-icon.red    { background: var(--danger-lt); }
.stat-icon.purple { background: var(--info-lt); }
.stat-icon.gray   { background: var(--gray-100); }

.stat-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--gray-800); line-height: 1.1; margin-top: 2px; }

/* ══════════════════════════════════════
   PANELS / CARDS
══════════════════════════════════════ */
.panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title { font-weight: 700; font-size: 14px; }
.panel-body  { padding: 16px 20px; }

/* ══════════════════════════════════════
   TABLES
══════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tr:hover td { background: var(--gray-50); }
tr:last-child td { border-bottom: none; }

.empty-row td { text-align:center; padding:32px; color:var(--gray-400); font-style:italic; }

/* ══════════════════════════════════════
   BADGES
══════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-enregistre   { background:var(--primary-lt); color:var(--primary-l); }
.badge-en_cours     { background:var(--warning-lt); color:#b45309; }
.badge-arrive_agence{ background:#ede9fe; color:#6d28d9; }
.badge-recupere     { background:var(--success-lt); color:#065f46; }
.badge-annule       { background:var(--danger-lt); color:#b91c1c; }
.badge-poids        { background:var(--gray-100); color:var(--gray-600); }
.badge-forfait      { background:var(--info-lt); color:var(--info); }
.badge-demenagement { background:var(--warning-lt); color:#b45309; }
.badge-sms          { background:#fef3c7; color:#b45309; }
.badge-email        { background:var(--primary-lt); color:var(--primary-l); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .18s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background:var(--primary-l); color:#fff; }
.btn-primary:hover { background:#1d4ed8; }
.btn-secondary { background:var(--gray-100); color:var(--gray-800); }
.btn-secondary:hover { background:var(--gray-200); }
.btn-success { background:var(--success); color:#fff; }
.btn-success:hover { background:#059669; }
.btn-danger { background:var(--danger); color:#fff; }
.btn-danger:hover { background:#dc2626; }
.btn-warning { background:var(--warning); color:#fff; }
.btn-warning:hover { background:#d97706; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }

.action-btns { display:flex; gap:4px; flex-wrap:wrap; }

/* ══════════════════════════════════════
   FORMS
══════════════════════════════════════ */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-grid.col-1 { grid-template-columns:1fr; }
.form-group { display:flex; flex-direction:column; gap:5px; }
.form-group.span-2 { grid-column: span 2; }
.form-group label { font-size:12px; font-weight:600; color:var(--gray-600); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .18s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-group textarea { resize:vertical; min-height:80px; }
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-l);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 0 6px;
  grid-column: span 2;
  border-top: 1px solid var(--gray-100);
  margin-top: 4px;
}
.form-section-title:first-child { border-top:none; padding-top:0; }

.price-display {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
  grid-column: span 2;
}

/* ══════════════════════════════════════
   SEARCH / FILTERS
══════════════════════════════════════ */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.search-input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary-l);
}
.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display:flex; }

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s ease;
}
.modal-lg { max-width: 780px; }
.modal-md { max-width: 540px; }
.modal-sm { max-width: 420px; }

/* ── Client form — toggle restriction ── */
.cf-toggle { position:relative; display:inline-block; width:38px; height:21px; cursor:pointer; flex-shrink:0; }
.cf-toggle input { opacity:0; width:0; height:0; position:absolute; }
.cf-toggle-track {
  position:absolute; inset:0;
  background:var(--gray-200); border-radius:21px;
  transition:background .2s ease;
}
.cf-toggle-track::after {
  content:''; position:absolute;
  left:3px; top:3px; width:15px; height:15px;
  background:#fff; border-radius:50%;
  transition:transform .2s ease;
  box-shadow:0 1px 3px rgba(0,0,0,.18);
}
.cf-toggle input:checked + .cf-toggle-track { background:#ef4444; }
.cf-toggle input:checked + .cf-toggle-track::after { transform:translateX(17px); }

@keyframes modalIn {
  from { opacity:0; transform:scale(.94) translateY(10px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top:0;
  background:#fff;
  z-index:5;
}
.modal-header h3 { font-size:16px; font-weight:700; }
.modal-close {
  background:none; border:none; font-size:18px; cursor:pointer;
  color:var(--gray-400); width:28px; height:28px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}
.modal-close:hover { background:var(--gray-100); color:var(--gray-800); }
.modal-body { padding: 20px 22px; }

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
  max-width: 300px;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--primary-l); }
.toast-warning { background: var(--warning); }
@keyframes toastIn {
  from { opacity:0; transform:translateX(30px); }
  to   { opacity:1; transform:translateX(0); }
}

/* ══════════════════════════════════════
   SCANNER
══════════════════════════════════════ */
.scanner-container {
  display:flex; flex-direction:column; align-items:center; gap:20px;
  max-width: 500px; margin: 0 auto;
}
.scanner-video-wrap {
  position:relative; width:100%; border-radius:14px; overflow:hidden;
  background:#000;
}
#scanner-video {
  width:100%; display:block; max-height:300px; object-fit:cover;
}
.scanner-overlay {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
}
.scanner-frame {
  width:180px; height:180px;
  border:3px solid #fff;
  border-radius:12px;
  box-shadow:0 0 0 9999px rgba(0,0,0,.4);
}
#scanner-result {
  width:100%; padding:20px; background:#fff; border-radius:12px;
  box-shadow:var(--shadow);
}

/* ══════════════════════════════════════
   STATUS TIMELINE
══════════════════════════════════════ */
.timeline { padding:4px 0; }
.timeline-item {
  display:flex; gap:12px; margin-bottom:14px;
}
.timeline-dot {
  width:10px; height:10px; border-radius:50%;
  background:var(--primary-l); margin-top:4px; flex-shrink:0;
  position:relative;
}
.timeline-dot::after {
  content:''; position:absolute; top:10px; left:4px;
  width:2px; height:calc(100% + 8px);
  background:var(--gray-200);
}
.timeline-item:last-child .timeline-dot::after { display:none; }
.timeline-text .status { font-weight:700; font-size:13px; }
.timeline-text .time   { font-size:11px; color:var(--gray-400); }
.timeline-text .note   { font-size:12px; color:var(--gray-600); margin-top:2px; }

/* ══════════════════════════════════════
   REPORT CARDS
══════════════════════════════════════ */
.report-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr));
  gap:12px; margin-bottom:20px;
}
.report-stat {
  background:var(--gray-50); border-radius:10px; padding:14px 12px; text-align:center;
  border:1px solid var(--gray-100);
}
.report-stat .val { font-size:24px; font-weight:800; color:var(--primary); }
.report-stat .lbl { font-size:10px; color:var(--gray-400); text-transform:uppercase; letter-spacing:.5px; margin-top:4px; }

/* ══════════════════════════════════════
   RESPONSIVE — Base (sidebar + forms)
══════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main { margin-left:0; }
  .hamburger { display:flex; }
  .form-grid { grid-template-columns:1fr; }
  .form-group.span-2 { grid-column:span 1; }
  .form-section-title { grid-column:span 1; }
  .form-footer { grid-column:span 1; }
  .stat-grid { grid-template-columns:1fr 1fr; }
  .page-content { padding:14px; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE MOBILE — Améliorations UI/UX
══════════════════════════════════════════════════════════ */

/* ── stat-grid : 1 colonne sur très petits écrans ── */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ── 768px : topbar, tables, filtres, boutons ── */
@media (max-width: 768px) {

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

  /* Tables : taille compacte + scroll horizontal fluide */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table { font-size: 12px; min-width: 560px; }
  th { padding: 8px 10px; font-size: 10px; }
  td { padding: 8px 10px; }
  .badge { font-size: 10px; padding: 2px 7px; }

  /* Boutons d'action : empilés en colonne */
  .action-btns { flex-direction: column; gap: 3px; align-items: flex-start; }
  .btn-xs { padding: 4px 8px; }

  /* Panel header : wrappable */
  .panel-header { flex-wrap: wrap; gap: 6px; }

  /* Filters bar : champ de recherche pleine largeur */
  .filters-bar { gap: 6px; }
  .search-input { min-width: 100%; max-width: 100%; }
  .filter-select { flex: 1; min-width: 120px; }
}

/* ── 640px : modals bottom-sheet + toast + bandeau ── */
@media (max-width: 640px) {

  /* Modal → bottom sheet */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal, .modal-lg, .modal-sm {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    animation: modalUp .28s ease;
  }
  @keyframes modalUp {
    from { transform: translateY(40px); opacity: .5; }
    to   { transform: translateY(0);    opacity: 1;  }
  }
  /* Handle visuel (barre de glissement) */
  .modal::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin: 12px auto 0;
  }
  .modal-header { padding: 10px 18px 12px; }
  .modal-body   { padding: 14px 18px 28px; }

  /* Toast : pleine largeur mobile */
  #toast-container { right: 12px; left: 12px; bottom: 16px; }
  .toast { max-width: 100%; }

  /* Bandeau Mode Support : wrap sur mobile */
  #impersonation-banner {
    height: auto !important;
    min-height: 44px;
    flex-wrap: wrap !important;
    padding: 8px 14px !important;
    gap: 6px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }
}

/* ══════════════════════════════════════
   MISC UTILS
══════════════════════════════════════ */
.text-center { text-align:center; }
.text-right  { text-align:right; }
.text-muted  { color:var(--gray-400); }
.text-sm     { font-size:12px; }
.fw-bold     { font-weight:700; }
.mt-8  { margin-top:8px; }
.mt-16 { margin-top:16px; }
.mb-16 { margin-bottom:16px; }
.gap-8 { gap:8px; }
.flex  { display:flex; }
.flex-1{ flex:1; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.loading {
  text-align:center; padding:40px; color:var(--gray-400);
  font-size:13px;
}
.divider { height:1px; background:var(--gray-100); margin:16px 0; }
.info-row {
  display:flex; justify-content:space-between;
  padding:8px 0; border-bottom:1px solid var(--gray-100);
  font-size:13px;
}
.info-row:last-child { border-bottom:none; }
.info-label { color:var(--gray-400); font-size:12px; }

/* Notification bell badge */
.nav-badge {
  background:var(--danger);
  color:#fff;
  font-size:9px;
  font-weight:700;
  padding:1px 5px;
  border-radius:10px;
  margin-left:auto;
}

/* ══════════════════════════════════════════════════════
   LOGIN SCREEN — Layout deux panneaux
══════════════════════════════════════════════════════ */
#login-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background-color: #dde4f0;
  background-image:
    radial-gradient(rgba(37,99,235,.07) 1px, transparent 1px),
    radial-gradient(rgba(37,99,235,.04) 1px, transparent 1px);
  background-size: 28px 28px, 14px 14px;
  background-position: 0 0, 14px 14px;
}

.login-container {
  display: flex;
  width: 100%;
  max-width: 1120px;
  min-height: 640px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15,30,60,.18), 0 4px 16px rgba(15,30,60,.08);
}

/* ── Panneau gauche ── */
.login-panel-left {
  width: 55%;
  background: linear-gradient(150deg, #0c1e38 0%, #1e3a5f 45%, #1a52a0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 44px;
  position: relative;
  overflow: hidden;
}
.login-panel-left::before {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.2) 0%, transparent 70%);
  top: -130px; right: -150px;
  pointer-events: none;
}
.login-panel-left::after {
  content: '';
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,.12) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  pointer-events: none;
}

.login-brand-hero {
  text-align: center;
  margin-bottom: 24px;
  z-index: 1;
}
.login-hero-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.35));
}
.login-hero-title {
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.5px;
  margin: 0 0 6px;
}
.login-hero-sub {
  color: rgba(255,255,255,.52);
  font-size: 13.5px;
  line-height: 1.65;
}

.login-illustration {
  width: 100%;
  max-width: 480px;
  z-index: 1;
}
.login-illustration svg { width: 100%; height: auto; }

.login-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  z-index: 1;
  align-self: flex-start;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}
.login-feature-icon {
  font-size: 15px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Panneau droit ── */
.login-panel-right {
  width: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: #f8fafc;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  font-size: 30px;
  display: none;
  margin-bottom: 8px;
}
.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 4px;
}
.login-logo p {
  color: var(--gray-400);
  font-size: 13px;
}

/* ── Input avec icône ── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}
.input-wrap input {
  padding-left: 38px !important;
}
.input-wrap .input-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-400);
  padding: 0;
  line-height: 1;
  z-index: 1;
  transition: color .18s;
}
.input-wrap .input-eye:hover { color: var(--primary); }

/* Focus amélioré avec barre gauche accent */
.login-card .form-group input:focus {
  border-color: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(37,99,235,.11), -3px 0 0 0 var(--primary-l);
  outline: none;
}

/* ── Options (remember + forgot) ── */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 16px;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-600);
  user-select: none;
}
.login-remember input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--primary-l);
  cursor: pointer;
  flex-shrink: 0;
}
.login-forgot {
  font-size: 13px;
  color: var(--primary-l);
  text-decoration: none;
  font-weight: 500;
}
.login-forgot:hover { text-decoration: underline; }

.login-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Bouton connexion ── */
.login-submit {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  box-shadow: 0 4px 14px rgba(37,99,235,.32);
  transition: all .22s;
}
.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.44);
  background: linear-gradient(135deg, #163050 0%, #1d4ed8 100%);
}
.login-submit:active { transform: translateY(0); }

/* ── Divider & footer ── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
  color: var(--gray-300);
  font-size: 11px;
}
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

.login-footer { text-align: center; }
.login-footer a {
  font-size: 12px;
  color: var(--gray-400);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  transition: all .18s;
}
.login-footer a:hover {
  background: var(--gray-100);
  color: var(--primary);
  border-color: var(--gray-300);
}

/* ── Super Admin mode ── */
#login-card[data-mode="super"] .login-logo h1 { color: #5b21b6; }
#login-card[data-mode="super"] .login-submit {
  background: linear-gradient(135deg, #3b0764 0%, #7c3aed 100%);
  box-shadow: 0 4px 14px rgba(124,58,237,.32);
}
#login-card[data-mode="super"] .login-submit:hover {
  box-shadow: 0 6px 20px rgba(124,58,237,.44);
}
#login-card[data-mode="super"] .form-group input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,.11), -3px 0 0 0 #7c3aed;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .login-container   { max-width: 800px; min-height: 560px; }
  .login-panel-left  { width: 46%; padding: 40px 28px; }
  .login-panel-right { width: 54%; }
}
@media (max-width: 640px) {
  #login-screen { padding: 0; align-items: stretch; }
  .login-container   { flex-direction: column; border-radius: 0; min-height: 100vh; }
  .login-panel-left  { width: 100%; padding: 28px 20px; min-height: auto; }
  .login-illustration { display: none; }
  .login-features    { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .login-brand-hero  { margin-bottom: 14px; }
  .login-hero-title  { font-size: 22px; }
  .login-hero-sub    { display: none; }
  .login-panel-right { width: 100%; padding: 20px 16px; }
  .login-card        { padding: 28px 22px 20px; }
  .login-logo-icon   { display: block; }
}

/* ── User info in sidebar ── */
.user-info {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 0;
  border-top:1px solid rgba(255,255,255,.1);
  margin-bottom:8px;
}
.user-avatar {
  width:34px;
  height:34px;
  border-radius:50%;
  background:var(--primary-l);
  color:#fff;
  font-size:14px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.user-details { overflow:hidden; }
.user-name {
  font-size:12px;
  font-weight:600;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-role {
  font-size:10px;
  color:rgba(255,255,255,.6);
  text-transform:uppercase;
  letter-spacing:.5px;
}
.btn-logout {
  width:100%;
  background:rgba(255,255,255,.1);
  color:rgba(255,255,255,.7);
  border:none;
  padding:8px;
  border-radius:8px;
  font-size:12px;
  cursor:pointer;
  transition:.2s;
}

/* ══════════════════════════════════════
   DRIVER.JS TOUR — styles complets intégrés
   (remplace le CSS CDN pour éviter tout conflit)
══════════════════════════════════════ */
.driver-overlay {
  z-index: 99998 !important;
}
.driver-popover {
  position: fixed !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  color: #1e293b !important;
  border-radius: 10px !important;
  padding: 18px 20px 14px !important;
  box-shadow: 0 12px 40px rgba(0,0,0,.24) !important;
  min-width: 260px !important;
  max-width: 360px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  word-wrap: break-word !important;
}
.driver-popover * {
  box-sizing: border-box !important;
}
.driver-popover-title {
  display: block !important;
  color: #1e3a5f !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  margin: 0 24px 8px 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}
.driver-popover-description {
  display: block !important;
  color: #475569 !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.driver-popover-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 14px 0 0 0 !important;
  padding: 0 !important;
  gap: 8px !important;
}
.driver-popover-progress-text {
  display: block !important;
  flex: 1 !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.driver-popover-prev-btn,
.driver-popover-next-btn,
.driver-popover-done-btn {
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
  transition: opacity .15s !important;
}
.driver-popover-prev-btn {
  background: transparent !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}
.driver-popover-next-btn,
.driver-popover-done-btn {
  background: #1e3a5f !important;
  color: #ffffff !important;
  border: none !important;
}
.driver-popover-close-btn {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  background: none !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 0 !important;
}
.driver-popover-arrow {
  position: absolute !important;
  z-index: 99999 !important;
}
.btn-logout:hover {
  background:rgba(255,255,255,.2);
  color:#fff;
}

/* ── Super Admin badge ── */
.nav-item-admin {
  border-top:1px solid rgba(255,255,255,.1);
  margin-top:8px;
  padding-top:8px;
}

/* ── Plan badge ── */
.plan-badge {
  display:inline-block;
  padding:2px 8px;
  border-radius:20px;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
}
.plan-starter  { background:#e0f2fe; color:#0369a1; }
.plan-pro      { background:#d1fae5; color:#065f46; }
.plan-enterprise { background:#ede9fe; color:#5b21b6; }
.org-status-active    { background:#d1fae5; color:#065f46; }
.org-status-trial     { background:#fef3c7; color:#92400e; }
.org-status-suspended { background:#fee2e2; color:#b91c1c; }
.org-status-cancelled { background:#f1f5f9; color:#64748b; }

/* ── Sélecteur type d'agence (Interne / Externe) ── */
.branch-type-toggle {
  display: flex;
  gap: 8px;
}
.branch-type-option {
  flex: 1;
  cursor: pointer;
}
.branch-type-option input[type="radio"] {
  display: none;
}
.branch-type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  width: 100%;
  box-sizing: border-box;
}
.branch-type-btn:hover {
  border-color: var(--primary-l);
  color: var(--primary-l);
}
.branch-type-btn.active {
  border-color: var(--primary-l);
  background: var(--primary-lt);
  color: var(--primary-l);
  font-weight: 600;
}

/* ── Badges type d'agence dans le tableau ── */
.badge-filiale    { background: #dbeafe; color: #1d4ed8; }
.badge-partenaire { background: #fef3c7; color: #92400e; }
