/* ========================
   CSS VARIABLES & RESET
   ======================== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --dark: #0f172a;
  --dark2: #1e293b;
  --dark3: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --card-bg: #1e293b;
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--dark);
  color: var(--text);
  height: 100%;
  overflow-x: hidden;
}

/* ========================
   LOGIN PAGE
   ======================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: blobFloat 8s ease-in-out infinite;
}
.blob1 { width: 400px; height: 400px; background: var(--primary); top: -100px; left: -100px; animation-delay: 0s; }
.blob2 { width: 300px; height: 300px; background: var(--secondary); bottom: -50px; right: -50px; animation-delay: 4s; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}
.login-card {
  background: rgba(30,41,59,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 20px;
  padding: 48px 40px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
  z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { font-size: 48px; display: block; margin-bottom: 12px; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.login-logo h1 { font-size: 28px; font-weight: 800; background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-logo p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.login-hint { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.login-hint code { background: var(--dark3); padding: 2px 6px; border-radius: 4px; font-family: monospace; }

/* Quick login buttons */
.login-quick-btns { display: flex; gap: 8px; margin-top: 16px; }
.quick-login-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 10px; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(99,102,241,0.3); background: rgba(99,102,241,0.08);
  color: var(--primary-light); cursor: pointer; transition: all 0.25s ease;
}
.quick-login-btn:hover { background: rgba(99,102,241,0.2); border-color: var(--primary); transform: translateY(-2px); }

/* Sidebar seed button */
.sidebar-seed { padding: 8px 16px 16px; border-top: 1px solid rgba(255,255,255,0.05); }
.sidebar-seed .btn { width: 100%; justify-content: flex-start; }

/* Force dark inputs in modals */
.modal-body input, .modal-body select, .modal-body textarea {
  background: #1e293b !important; color: #e2e8f0 !important;
  border: 1px solid #334155;
}
.modal-body input::placeholder { color: #64748b; }

/* ========================
   LAYOUT
   ======================== */
.app { display: flex; height: 100vh; }
.hidden { display: none !important; }

/* ========================
   SIDEBAR
   ======================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  flex-shrink: 0;
  z-index: 100;
  overflow: hidden;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.sidebar-logo .logo-icon { font-size: 24px; }
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--dark3); color: var(--text); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: var(--dark3); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(14,165,233,0.1)); color: var(--primary-light); }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 8px var(--primary)); }
.nav-icon { font-size: 18px; flex-shrink: 0; }
.badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  margin-left: auto;
}
.badge:empty, .badge[data-count="0"] { display: none; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-details { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }
.btn-logout {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 16px; transition: var(--transition); flex-shrink: 0;
}
.btn-logout:hover { background: var(--danger); border-color: var(--danger); color: white; }

/* Collapsed sidebar */
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .user-details,
.sidebar.collapsed .badge { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-footer { justify-content: center; }

/* ========================
   MAIN CONTENT
   ======================== */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--dark);
  padding: 24px;
}

/* ========================
   PAGES
   ======================== */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 700; }

/* ========================
   STATS GRID
   ======================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { font-size: 32px; }
.stat-val { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-blue .stat-val { color: var(--secondary); }
.stat-orange .stat-val { color: var(--warning); }
.stat-purple .stat-val { color: var(--primary-light); }
.stat-green .stat-val { color: var(--success); }
.stat-red .stat-val { color: var(--danger); }
.stat-teal .stat-val { color: var(--info); }

/* ========================
   CHARTS
   ======================== */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); }

.dashboard-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.retards-list { padding: 8px 0; }
.retard-item {
  padding: 8px 16px;
  border-left: 3px solid var(--warning);
  margin-bottom: 8px;
  background: rgba(245,158,11,0.05);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}
.retard-item .retard-num { font-weight: 600; color: var(--warning); }

/* ========================
   CARDS & TABLES
   ======================== */
.card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}
.card-header h3 { font-size: 15px; font-weight: 600; color: #f8fafc; }

.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: transparent;
}
.table thead tr { background: rgba(255, 255, 255, 0.03); }
.table th {
  padding: 14px 20px; text-align: left; font-weight: 700; font-size: 12px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap;
}
.table td {
  padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle; color: #f1f5f9; transition: background 0.2s;
}
.table tbody tr { transition: all 0.2s ease; }
.table tbody tr:hover { background: rgba(99, 102, 241, 0.05); }
.table tbody tr:last-child td { border-bottom: none; }

/* ========================
   BADGES / STATUS
   ======================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-enregistre { background: rgba(148,163,184,0.15); color: #94a3b8; }
.status-en_transit { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-en_livraison { background: rgba(99,102,241,0.15); color: #818cf8; }
.status-livre { background: rgba(16,185,129,0.15); color: #10b981; }
.status-echec { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-retour { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-perdu { background: rgba(239,68,68,0.2); color: #f87171; }
.status-planifiee { background: rgba(148,163,184,0.15); color: #94a3b8; }
.status-en_cours { background: rgba(99,102,241,0.15); color: #818cf8; }
.status-livree { background: rgba(16,185,129,0.15); color: #10b981; }
.status-disponible { background: rgba(16,185,129,0.15); color: #10b981; }
.status-inactif { background: rgba(148,163,184,0.1); color: #64748b; }
.status-ouvert { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-resolu { background: rgba(16,185,129,0.15); color: #10b981; }

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all 0.25s ease;
  text-decoration: none; position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary { 
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); 
  color: white; 
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.btn-success:hover { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 6px 20px rgba(16,185,129,0.4); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; box-shadow: 0 4px 12px rgba(239,68,68,0.3); }
.btn-danger:hover { background: linear-gradient(135deg, #f87171, #ef4444); box-shadow: 0 6px 20px rgba(239,68,68,0.4); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: rgba(255,255,255,0.1); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); border-color: rgba(255,255,255,0.2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 6px 8px; }
.action-btns { display: flex; gap: 4px; }

/* ========================
   FILTERS
   ======================== */
.filters-bar {
  display: flex; gap: 12px; margin-bottom: 16px;
  flex-wrap: wrap;
}
.filters-bar input, .filters-bar select {
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--card-bg); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-family: inherit;
}
.filters-bar input { flex: 1; min-width: 200px; }
.filters-bar input:focus, .filters-bar select:focus {
  outline: none; border-color: var(--primary);
}

/* ========================
   FORMS
   ======================== */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px; border-radius: 10px;
  background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary-light); background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), inset 0 2px 5px rgba(0,0,0,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section { background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; border: 1px solid var(--border); }
.form-section h4 { font-size: 13px; font-weight: 600; color: var(--primary-light); margin-bottom: 12px; }
.error-msg { color: var(--danger); font-size: 12px; min-height: 16px; }
.hint-text { color: var(--text-muted); font-size: 11px; }
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; }

/* ========================
   MODALS
   ======================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.02);
  animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-lg { max-width: 780px; }
@keyframes modalIn { from { opacity:0; transform:scale(0.92) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.modal-header h3 { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.modal-close {
  background: rgba(255,255,255,0.05); border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; width: 32px; height: 32px;
  border-radius: 50%; transition: all 0.3s ease;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(239, 68, 68, 0.15); color: var(--danger); transform: rotate(90deg); }
.modal-body { flex: 1; overflow-y: auto; padding: 24px 32px; }
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.modal-footer {
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 20px 32px; border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.1); border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
}

/* ========================
   LIVREURS
   ======================== */
.livreurs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.livreur-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: var(--transition);
}
.livreur-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.livreur-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.livreur-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.livreur-name { font-weight: 600; font-size: 15px; }
.livreur-tel { color: var(--text-muted); font-size: 12px; }
.livreur-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 12px; }
.livreur-meta span { background: var(--dark3); padding: 3px 8px; border-radius: 6px; }
.livreur-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.livreur-actions { display: flex; gap: 8px; }

/* ========================
   TRACKING PAGE
   ======================== */
.tracking-search-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  text-align: center; margin-bottom: 24px;
}
.tracking-search-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.tracking-input-row { display: flex; gap: 12px; max-width: 600px; margin: 0 auto 12px; }
.tracking-input {
  flex: 1; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--dark3); border: 2px solid var(--border);
  color: var(--text); font-size: 15px; font-family: 'Inter', monospace;
  transition: var(--transition);
}
.tracking-input:focus { outline: none; border-color: var(--primary); }
.tracking-examples { color: var(--text-muted); font-size: 13px; }
.tracking-examples code {
  background: var(--dark3); padding: 2px 8px; border-radius: 6px;
  cursor: pointer; margin: 0 4px; font-family: monospace;
  transition: var(--transition);
}
.tracking-examples code:hover { background: var(--primary); color: white; }

.tracking-result { margin-top: 16px; }
.tracking-info-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
}
.tracking-number { font-size: 22px; font-weight: 800; font-family: monospace; color: var(--primary-light); margin-bottom: 8px; }
.tracking-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; }
.tracking-meta-item label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.tracking-meta-item span { font-size: 14px; font-weight: 500; }

.timeline { padding: 0; }
.timeline-item {
  display: flex; gap: 16px; padding: 12px 0;
  border-left: 2px solid var(--border); margin-left: 12px;
  position: relative;
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--dark3); border: 2px solid var(--border);
  position: absolute; left: -11px; top: 14px;
  flex-shrink: 0;
}
.timeline-dot.active { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 12px rgba(99,102,241,0.5); }
.timeline-dot.done { background: var(--success); border-color: var(--success); }
.timeline-content { padding-left: 20px; }
.timeline-status { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.timeline-desc { font-size: 13px; color: var(--text-muted); }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ========================
   MAP
   ======================== */
.map-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.map-legend { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.map-legend h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.map-livreur-item { padding: 10px; background: var(--dark3); border-radius: 8px; margin-bottom: 8px; font-size: 13px; cursor: pointer; transition: var(--transition); }
.map-livreur-item:hover { background: rgba(99,102,241,0.1); }
.map-livreur-name { font-weight: 600; }
.map-livreur-coords { font-size: 11px; color: var(--text-muted); }

/* ========================
   NOTIFICATIONS
   ======================== */
.notifications-list { padding: 8px; }
.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius-sm);
  margin-bottom: 4px; transition: var(--transition);
  border-left: 3px solid transparent;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-icon { font-size: 20px; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-type { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.notif-msg { font-size: 13px; }
.notif-num { font-weight: 600; color: var(--primary-light); font-size: 12px; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-colis_expedie { border-color: var(--primary); }
.notif-statut_en_livraison { border-color: var(--warning); }
.notif-statut_livre { border-color: var(--success); }
.notif-otp { border-color: var(--info); }

/* ========================
   PAGINATION
   ======================== */
.pagination {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.pagination button {
  padding: 6px 12px; border-radius: 6px;
  background: var(--dark3); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 13px;
  transition: var(--transition);
}
.pagination button:hover { background: var(--primary); border-color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); }
.pagination-info { color: var(--text-muted); font-size: 13px; }

/* ========================
   REPORTS
   ======================== */
.reports-filters { padding: 20px; margin-bottom: 16px; }
.filters-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }

/* ========================
   COLIS DETAIL
   ======================== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-section { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 16px; border: 1px solid var(--border); }
.detail-section h4 { color: var(--primary-light); margin-bottom: 12px; font-size: 13px; font-weight: 600; text-transform: uppercase; }
.detail-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.detail-row label { color: var(--text-muted); }
.detail-row span { font-weight: 500; }

/* ========================
   TOAST
   ======================== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--dark2); border: 1px solid var(--border);
  box-shadow: var(--shadow); min-width: 280px; max-width: 400px;
  animation: toastIn 0.3s ease; font-size: 14px;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
@keyframes toastIn { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateX(100%); } }
.toast.out { animation: toastOut 0.3s ease forwards; }

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 900px) {
  .charts-grid, .dashboard-bottom { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .nav-text, .sidebar .logo-text, .sidebar .user-details, .sidebar .badge { display: none; }
  .sidebar .nav-item { justify-content: center; }
  .sidebar .sidebar-logo { justify-content: center; }
  .sidebar .sidebar-footer { justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .tracking-input-row { flex-direction: column; }
}
