﻿/* ═══════════════════════════════════════════════════════════════════
   BizFlow — Design System
   Thème : Bleu sombre (#0d2137) + accents modernes
   Dark mode : [data-theme="dark"]
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables Light ─────────────────────────────────────────────── */
:root {
  /* Couleurs primaires */
  --air-900: #0a1929;
  --air-800: #0d2137;
  --air-700: #112840;
  --air-600: #163452;
  --air-500: #1d4570;
  --air-400: #2563a8;
  --air-300: #3b82d4;
  --air-200: #7fb4e8;
  --air-100: #bdd8f5;
  --air-50:  #e8f3fb;

  /* Accent */
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37,99,235,.1);

  /* Couleurs sémantiques */
  --success:      #10b981;
  --success-bg:   rgba(16,185,129,.1);
  --warning:      #f59e0b;
  --warning-bg:   rgba(245,158,11,.1);
  --danger:       #ef4444;
  --danger-bg:    rgba(239,68,68,.1);
  --info:         #3b82f6;
  --info-bg:      rgba(59,130,246,.1);

  /* Layout */
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-xs:    6px;

  /* Light mode surfaces */
   --bg-page:   #0f172a;
  --bg-card:   #1e293b;
  --bg-topbar: #1e293b;
  --bg-input:  #0f172a;
  --bg-hover:  #263346;
  --bg-sidebar: #0a1929;

  /* Light mode textes */
  --text-1:    #f1f5f9;
  --text-2:    #94a3b8;
  --text-3:    #475569;

  /* Light mode bordures */
  --border:    #2d3f55;
  --border-2:  #3d5166;

  /* Shadows */
   --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.4);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.6);

  /* Sidebar text */
  --sidebar-text:        rgba(255,255,255,.65);
  --sidebar-text-hover:  rgba(255,255,255,.9);
  --sidebar-text-active: #ffffff;
  --sidebar-item-hover:  rgba(255,255,255,.06);
  --sidebar-item-active: rgba(37,99,235,.25);

   --success-bg: rgba(16,185,129,.15);
  --warning-bg: rgba(245,158,11,.15);
  --danger-bg:  rgba(239,68,68,.15);
  --info-bg:    rgba(59,130,246,.15);
  --accent-light: rgba(37,99,235,.2);
}

/* ── Variables Dark ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-page:   #0f172a;
  --bg-card:   #1e293b;
  --bg-topbar: #1e293b;
  --bg-input:  #0f172a;
  --bg-hover:  #263346;
  --bg-sidebar: #0a1929;

  --text-1:    #f1f5f9;
  --text-2:    #94a3b8;
  --text-3:    #475569;

  --border:    #2d3f55;
  --border-2:  #3d5166;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.4);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.6);

  --success-bg: rgba(16,185,129,.15);
  --warning-bg: rgba(245,158,11,.15);
  --danger-bg:  rgba(239,68,68,.15);
  --info-bg:    rgba(59,130,246,.15);
  --accent-light: rgba(37,99,235,.2);
}

/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html.theme-no-transition, html.theme-no-transition * {
  transition-duration: 0ms !important;
  transition-delay: 0ms !important;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-page);
  color: var(--text-1);
  transition: background .2s ease, color .2s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Layout Principal ────────────────────────────────────────────── */
.air-layout {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════ SIDEBAR */
.air-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  scrollbar-width: none;
}
.air-sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.air-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.air-brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--air-300));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}

.air-brand-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.air-brand-name {
  display: block;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  letter-spacing: -.3px;
}
.air-brand-sub {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.4);
  font-weight: 400;
  margin-top: 1px;
}

/* Nav */
.air-nav {
  flex: 1; 
}

.air-nav-group-btn{
  width:100%;
  background: none;
  border: none;
  color: var(--sidebar-text);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor:pointer;
  transition: background .15s, color .15s;
  font-weight:600;
}
.air-nav-group-btn:hover{ background: var(--sidebar-item-hover); color: var(--sidebar-text-hover); }

.air-nav-group{
  display:block;
}

.air-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.air-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 450;
  transition: background .15s, color .15s;
  cursor: pointer;
}

.air-nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.air-nav-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-hover);
}

.air-nav-item.active {
  background: var(--sidebar-item-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.air-nav-indicator {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}

/* Badge abonnement */
.air-abo-badge {
  margin: 0 10px 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.06);
}
.air-abo-badge.warning { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.2); }
.air-abo-badge.danger  { background: rgba(239,68,68,.15);  color: #f87171; border-color: rgba(239,68,68,.2); }

/* User bottom */
.air-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.air-user-avatar,
.air-user-avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}
.air-user-avatar { object-fit: cover; }
.air-user-avatar-placeholder {
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

.air-user-name {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.air-user-role { font-size: 11px; color: rgba(255,255,255,.35); }

/* ══════════════════════════════════════════ TOPBAR */
.air-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.air-topbar {
  height: var(--topbar-h);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: background .2s;
}

.air-page-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.air-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.air-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
}
.air-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: all .25s;
}

/* Theme button */
.air-theme-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all .15s;
}
.air-theme-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* Notif */
.air-notif-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  position: relative;
}
.air-notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--bg-topbar);
}

/* Profile button */
.air-profile-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px 5px 5px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-1);
}
.air-profile-btn:hover { background: var(--bg-hover); border-color: var(--border-2); }

.air-profile-avatar { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.air-profile-initiales {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.air-profile-name { font-size: 13px; font-weight: 500; }

/* Dropdown */
.air-dropdown {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  min-width: 200px;
  padding: 6px;
}
.air-dropdown-header {
  padding: 8px 12px 10px;
  pointer-events: none;
}
.air-dropdown-header div { font-weight: 600; font-size: 13px; color: var(--text-1); }
.air-dropdown-header small { color: var(--text-3); font-size: 12px; }
.air-divider { border-color: var(--border) !important; margin: 4px 0 !important; }
.air-dropdown-item {
  display: flex !important; align-items: center; gap: 8px;
  padding: 8px 12px !important;
  border-radius: var(--radius-xs) !important;
  color: var(--text-2) !important;
  font-size: 13px !important;
  transition: background .12s !important;
}
.air-dropdown-item:hover { background: var(--bg-hover) !important; color: var(--text-1) !important; }
.air-dropdown-danger { color: var(--danger) !important; }
.air-dropdown-danger:hover { background: var(--danger-bg) !important; color: var(--danger) !important; }

/* ══════════════════════════════════════════ CONTENU */
.air-content {
  flex: 1;
  padding: 24px;
  max-width: none;
  width: 100%;
  min-width: 0;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.air-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  transition: background .2s, border-color .2s;
}

.air-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.air-card-title {
  font-size: 15px; font-weight: 600; color: var(--text-1);
}

/* ── KPI Cards ───────────────────────────────────────────────────── */
.air-kpi {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.air-kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.air-kpi-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.air-kpi-value { font-size: 22px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.air-kpi-label { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ── Tables ──────────────────────────────────────────────────────── */
.air-table { width: 100%; border-collapse: collapse; }
.air-table th {
  background: var(--bg-page);
  color: var(--text-3);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  text-align: left; white-space: nowrap;
}
.air-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: middle;
}
.air-table tbody tr { transition: background .1s; }
.air-table tbody tr:hover { background: var(--bg-hover); }
.air-table tbody tr:last-child td { border-bottom: none; }

/* ── Formulaires ─────────────────────────────────────────────────── */
.air-form-group { margin-bottom: 18px; }
.air-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-2); margin-bottom: 6px;
}
.air-label .req { color: var(--danger); }

.air-input, .air-select, .air-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-1);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}
.air-input:focus, .air-select:focus, .air-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.air-input::placeholder, .air-textarea::placeholder { color: var(--text-3); }
/* Les <option> suivent le thème : le fond ET le texte s'adaptent ensemble,
   pour rester lisibles aussi bien en sombre qu'en clair (évite le texte
   blanc hérité du select sur fond blanc forcé → invisible en mode sombre). */
.air-select { color-scheme: dark; }
[data-theme="light"] .air-select { color-scheme: light; }
.air-select option {
  background-color: var(--bg-card) !important;
  color: var(--text-1) !important;
}
.air-select option:checked,
.air-select option:hover {
  background-color: var(--accent) !important;
  color: #ffffff !important;
}

/* ── Boutons ─────────────────────────────────────────────────────── */
.air-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.air-btn:active { transform: scale(.98); }
.air-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-xs); }

/* Boutons Filtrer / Reset: taille au contenu */
.air-filter-actions .air-btn,
.air-filter-actions .air-btn:visited,
.air-filter-actions .air-btn:active {
  width: fit-content;
  max-width: 100%;
}

.air-filter-actions .air-btn .bi {
  flex-shrink: 0;
}

/* Petit espacement homogène entre les éléments de la barre de filtres
   (selects, boutons Filtrer/Reset) — évite qu'ils soient collés. */
/* Filtres compacts : champs regroupés à gauche, largeurs fixes, petit écart —
   au lieu de la grille 12 colonnes qui étire les champs sur toute la largeur. */
.air-filter-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  row-gap: 8px;
}
.air-filter-actions .col-auto,
.air-filter-actions [class*="col-md-"],
.air-filter-actions [class*="col-"] {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
  margin: 0 !important;
}
.air-filter-actions .air-input,
.air-filter-actions .air-select,
.air-filter-actions .air-searchable { width: 200px; }
.air-filter-actions .air-input[type="date"] { width: 165px; }
/* Certains filtres (produits) imbriquent une .row dans .air-filter-actions :
   on lui redonne un écart régulier entre les champs (sinon ils se collent). */
.air-filter-actions .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; width: 100%; }

/* Boutons de type filtre/reset (log, trocs, produits, sous-comptes, etc.) */
.air-filter-actions .air-btn.w-100,
.air-filter-actions .air-btn-outline.w-100 {
  width: fit-content !important;
}

.air-btn-primary   { background: var(--accent); color: #fff; }
.air-btn-primary:hover { background: var(--accent-hover); color: #fff; }

.air-btn-outline {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.air-btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.air-btn-danger  { background: var(--danger);  color: #fff; }
.air-btn-danger:hover { background: #dc2626; color: #fff; }
.air-btn-success { background: var(--success); color: #fff; }
.air-btn-ghost   { background: var(--bg-hover); color: var(--text-2); border: 1px solid var(--border); }
.air-btn-ghost:hover { background: var(--border); }

/* ── Badges ──────────────────────────────────────────────────────── */
.air-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.air-badge-success { background: var(--success-bg); color: var(--success); }
.air-badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.air-badge-warning { background: var(--warning-bg); color: var(--warning); }
.air-badge-info    { background: var(--info-bg);    color: var(--info); }
.air-badge-purple  { background: rgba(139,92,246,.1); color: #8b5cf6; }
.air-badge-gray    { background: var(--bg-hover); color: var(--text-2); border: 1px solid var(--border); }
.air-badge-secondary { background: var(--bg-hover); color: var(--text-2); border: 1px solid var(--border); }
.air-badge-waiting { background: rgba(245,158,11,.16); color: #b45309; border: 1px solid rgba(245,158,11,.28); }
.air-badge-closed  { background: rgba(100,116,139,.18); color: #475569; border: 1px solid rgba(100,116,139,.32); }

/* ── Avatars ─────────────────────────────────────────────────────── */
.air-avatar {
  width: 34px; height: 34px;
  border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.air-avatar-placeholder {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Alertes inline ──────────────────────────────────────────────── */
.air-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.air-alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(16,185,129,.2); }
.air-alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(239,68,68,.2); }
.air-alert-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(245,158,11,.2); }
.air-alert-info    { background: var(--info-bg);    color: var(--info);    border-color: rgba(59,130,246,.2); }

/* ── Page header ─────────────────────────────────────────────────── */
.air-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.air-page-header h1 {
  font-size: 20px; font-weight: 700; color: var(--text-1); margin: 0;
}
.air-page-header p {
  font-size: 13px; color: var(--text-3); margin: 4px 0 0;
}

/* ── Filtres ─────────────────────────────────────────────────────── */
.air-filters {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 20px;
  margin-bottom: 20px;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.air-pagination {
  display: flex; justify-content: center; gap: 4px;
  padding-top: 16px;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.air-empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-3);
}
.air-empty i { font-size: 40px; opacity: .3; display: block; margin-bottom: 12px; }
.air-empty p { font-size: 14px; margin-bottom: 16px; }

/* ══════════════════════════════════════════ TOASTS */
.air-toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.air-toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 300px; max-width: 420px;
  pointer-events: all;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
  position: relative; overflow: hidden;
  backdrop-filter: blur(8px);
}

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(120%); opacity: 0; }
}

.air-toast.removing { animation: toastOut .25s ease forwards; }

.air-toast-success { background: var(--bg-card); border-left: 4px solid var(--success); }
.air-toast-error   { background: var(--bg-card); border-left: 4px solid var(--danger); }
.air-toast-warning { background: var(--bg-card); border-left: 4px solid var(--warning); }
.air-toast-info    { background: var(--bg-card); border-left: 4px solid var(--info); }

.air-toast-icon { font-size: 18px; margin-top: 1px; flex-shrink: 0; }
.air-toast-success .air-toast-icon { color: var(--success); }
.air-toast-error   .air-toast-icon { color: var(--danger); }
.air-toast-warning .air-toast-icon { color: var(--warning); }
.air-toast-info    .air-toast-icon { color: var(--info); }

.air-toast-body { flex: 1; }
.air-toast-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.air-toast-msg   { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }

.air-toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 14px; padding: 2px;
  flex-shrink: 0; line-height: 1; margin-top: 1px;
  transition: color .12s;
}
.air-toast-close:hover { color: var(--text-1); }

.air-toast-progress {
  position: absolute; bottom: 0; left: 0;
  height: 3px; width: 100%;
  animation: toastProgress 4s linear forwards;
}
.air-toast-success .air-toast-progress { background: var(--success); }
.air-toast-error   .air-toast-progress { background: var(--danger); }
.air-toast-warning .air-toast-progress { background: var(--warning); }
.air-toast-info    .air-toast-progress { background: var(--info); }

@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ══════════════════════════════════════════ PAGE LOGIN */
.air-auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--air-900) 0%, var(--air-700) 50%, var(--air-500) 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  position: relative; overflow: hidden;
}
.air-auth-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(37,99,235,.15) 0%, transparent 60%),
              radial-gradient(circle at 70% 20%, rgba(59,130,246,.1) 0%, transparent 50%);
}

.air-auth-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,.05);
}

.air-auth-logo {
  text-align: center; margin-bottom: 28px;
}
.air-auth-logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent), var(--air-300));
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
}
.air-auth-logo h1 {
  font-size: 24px; font-weight: 800; color: var(--text-1);
  letter-spacing: -.5px; margin: 0;
}
.air-auth-logo p { font-size: 13px; color: var(--text-3); margin: 4px 0 0; }

/* ── Input avec icône ────────────────────────────────────────────── */
.air-input-group { position: relative; }
.air-input-group .air-input-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3); font-size: 15px; pointer-events: none;
}
.air-input-group .air-input { padding-left: 38px; }
.air-input-group .air-input-eye {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 15px; padding: 0;
  transition: color .12s;
}
.air-input-group .air-input-eye:hover { color: var(--text-1); }

/* ══════════════════════════════════════════ OVERLAY & MOBILE */
.air-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 150;
  backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
  .air-sidebar { transform: translateX(-100%); }
  .air-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .air-overlay.open { display: block; }
  .air-main { margin-left: 0; }
  .air-burger { display: flex; }
  .air-content { padding: 16px; }
  .air-topbar { padding: 0 16px; }
  .air-page-title { font-size: 14px; }
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Utilitaires ─────────────────────────────────────────────────── */
.text-muted { color: var(--text-3) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }

.w-100 { width: 100%; }
.mt-0 { margin-top: 0 !important; }

/* Input file stylisé */
.air-file-label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-2); font-size: 13px;
  transition: all .15s;
}
.air-file-label:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Preview image */
.air-img-preview {
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px dashed var(--border-2);
  background: var(--bg-page);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
  transition: border-color .15s;
}
.air-img-preview:hover { border-color: var(--accent); }
.air-img-preview img { width: 100%; height: 100%; object-fit: cover; }

.air-modal-backdrop {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.5);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index: 9999;
}
.air-modal {
  background: var(--background-card, #fff);
  border-radius: 12px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
}
.air-modal-header {
  padding: 15px;
  color: var(--text-1);
}
.air-modal-header h3 { color: inherit; margin: 0; }
.air-modal-header-warning {
  background-color: var(--danger, #ef4444);
  color: #fff;
}
.air-modal-body {
  padding: 20px;
  font-size: 14px;
  color: var(--text, #333);
}
.air-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px;
}
.air-modal-footer .air-btn {
  min-width: 80px;
}

/* ══════════════════════════════════════════ SEARCHABLE SELECT */
.air-search-select { position: relative; }
.air-search-dropdown::-webkit-scrollbar { width: 4px; }
.air-search-dropdown::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* ══════════════════════════════════════════ PAGINATION AMÉLIORÉE */
.air-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 4px;
}
.air-pagination .air-btn-sm {
  min-width: 34px;
  justify-content: center;
}
.air-pagination-info {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 6px;
}

/* ══════════════════════════════════════════ BADGE TROC/REPARATION */
.air-badge-purple2 { background: rgba(99,102,241,.1); color: #6366f1; }
.air-badge-teal    { background: rgba(20,184,166,.1);  color: #0d9488; }

/* ══════════════════════════════════════════════════════════════════
   BizFlow — Extensions v2.0 (dark mode, nouvelles composantes)
   ══════════════════════════════════════════════════════════════════ */

/* ── Light Mode Variables ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-page:   #f1f5f9;
  --bg-card:   #ffffff;
  --bg-topbar: #ffffff;
  --bg-input:  #f8fafc;
  --bg-hover:  #f1f5f9;
  --bg-sidebar: #0a1929;
  --text-1:    #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.12);
  --success-bg: rgba(16,185,129,.1);
  --warning-bg: rgba(245,158,11,.1);
  --danger-bg:  rgba(239,68,68,.1);
  --info-bg:    rgba(59,130,246,.1);
  --accent-light: rgba(37,99,235,.1);
}

/* ── Bannière abonnement ──────────────────────────────────────────── */
.air-banner-abo {
  padding: 10px 20px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  position: relative;
}
.air-banner-abo.warning { background: var(--warning); color: #fff; }
.air-banner-abo.danger  { background: var(--danger);  color: #fff; }
.air-banner-abo a { color: #fff; text-decoration: underline; }
.air-banner-abo .air-banner-close { margin-left:auto; background:none; border:none; color:#fff; font-size:18px; cursor:pointer; line-height:1; padding:0 4px; }

/* ── Sélecteur boutique sidebar ───────────────────────────────────── */
.air-shop-switcher { padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.air-shop-select { width:100%; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); color:#fff; border-radius:6px; padding:6px 10px; font-size:12px; cursor:pointer; }
.air-shop-select option { background:#1e293b; color:#fff; }

/* ── Notifications panel ──────────────────────────────────────────── */
.air-notif-wrapper { position: relative; }
.air-notif-btn { background:none; border:none; color:var(--text-2); font-size:18px; cursor:pointer; padding:6px; border-radius:8px; transition:background .15s; position:relative; }
.air-notif-btn:hover { background:var(--bg-hover); color:var(--text-1); }
.air-notif-count { position:absolute; top:-4px; right:-4px; background:var(--danger); color:#fff; font-size:10px; font-weight:700; border-radius:10px; min-width:18px; height:18px; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.air-notif-panel { position:absolute; right:0; top:calc(100% + 8px); width:340px; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-lg); z-index:1000; max-height:400px; overflow:hidden; display:flex; flex-direction:column; }
.air-notif-header { padding:12px 16px; font-weight:600; font-size:13px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.air-notif-mark { background:none; border:none; color:var(--accent); font-size:12px; cursor:pointer; }
.air-notif-list { overflow-y:auto; flex:1; }
.air-notif-item { padding:12px 16px; display:flex; gap:10px; cursor:pointer; transition:background .1s; border-bottom:1px solid var(--border); }
.air-notif-item:hover { background:var(--bg-hover); }
.air-notif-item.unread { background:var(--accent-light); }
.air-notif-dot-wrap { flex-shrink:0; padding-top:4px; }
.air-notif-dot-info    { width:8px; height:8px; border-radius:50%; background:var(--info); }
.air-notif-dot-alerte  { width:8px; height:8px; border-radius:50%; background:var(--warning); }
.air-notif-dot-succes  { width:8px; height:8px; border-radius:50%; background:var(--success); }
.air-notif-dot-erreur  { width:8px; height:8px; border-radius:50%; background:var(--danger); }
.air-notif-dot-ticket  { width:8px; height:8px; border-radius:50%; background:#8b5cf6; }
.air-notif-dot-stock   { width:8px; height:8px; border-radius:50%; background:var(--danger); }
.air-notif-dot-creance { width:8px; height:8px; border-radius:50%; background:var(--warning); }
.air-notif-dot-marketplace { width:8px; height:8px; border-radius:50%; background:var(--accent); }
.air-notif-content { flex:1; min-width:0; }
.air-notif-del { flex-shrink:0; align-self:center; background:none; border:none; color:var(--text-3); cursor:pointer; font-size:13px; padding:4px 6px; border-radius:6px; opacity:0; transition:opacity .1s, color .1s, background .1s; }
.air-notif-item:hover .air-notif-del { opacity:1; }
.air-notif-del:hover { color:var(--danger); background:var(--bg-hover); }
.air-notif-title { font-weight:600; font-size:13px; }
.air-notif-msg { font-size:12px; color:var(--text-2); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.air-notif-time { font-size:11px; color:var(--text-3); margin-top:4px; }
.air-notif-empty, .air-notif-loading { padding:30px; text-align:center; color:var(--text-3); font-size:13px; }
.air-notif-empty i, .air-notif-loading i { font-size:28px; display:block; margin-bottom:8px; }

/* ── Multi-images preview ─────────────────────────────────────────── */
.air-img-previews { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.air-img-preview-item { position:relative; width:90px; height:90px; border-radius:8px; overflow:hidden; border:2px solid var(--border); }
.air-img-preview-item img { width:100%; height:100%; object-fit:cover; }
.air-img-remove { position:absolute; top:4px; right:4px; background:var(--danger); color:#fff; border:none; border-radius:50%; width:20px; height:20px; font-size:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; line-height:1; }

/* ── Galerie photos ───────────────────────────────────────────────── */
.air-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; }
.air-gallery-item { aspect-ratio:1; border-radius:10px; overflow:hidden; cursor:pointer; border:2px solid var(--border); transition:border-color .15s; }
.air-gallery-item:hover { border-color:var(--accent); }
.air-gallery-item.principal { border-color:var(--success); }
.air-gallery-item img { width:100%; height:100%; object-fit:cover; }

/* ── Modal ────────────────────────────────────────────────────────── */
.air-modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:10000; display:flex; align-items:center; justify-content:center; padding:20px; animation:fadeIn .15s; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.air-modal { background:var(--bg-card); border-radius:16px; box-shadow:var(--shadow-lg); width:100%; max-width:520px; overflow:hidden; animation:slideUp .2s; }
.air-modal-lg { max-width:800px; }
.air-modal-xl { max-width:1000px; }
@keyframes slideUp { from { transform:translateY(20px); opacity:0; } to { transform:translateY(0); opacity:1; } }
.air-modal-header { padding:20px 24px; font-size:16px; font-weight:700; border-bottom:1px solid var(--border); }
.air-modal-header-danger  { background:var(--danger-bg);  color:var(--danger); }
.air-modal-header-warning { background:var(--warning-bg); color:var(--warning); }
.air-modal-header-success { background:var(--success-bg); color:var(--success); }
.air-modal-body   { padding:24px; max-height:70vh; overflow-y:auto; }
.air-modal-footer { padding:16px 24px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }

/* ── Page pagination ──────────────────────────────────────────────── */
.air-pagination { list-style:none; display:flex; gap:4px; padding:0; margin:0; }
.air-page-btn { padding:7px 12px; background:var(--bg-card); border:1px solid var(--border); border-radius:8px; color:var(--text-2); cursor:pointer; font-size:13px; font-weight:500; transition:all .15s; }
.air-page-btn:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
.air-page-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ── Paiement tranches ────────────────────────────────────────────── */
.air-tranche-badge { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.air-tranche-badge.en_cours { background:var(--warning-bg); color:var(--warning); }
.air-tranche-badge.soldee   { background:var(--success-bg); color:var(--success); }
.air-tranche-badge.en_retard{ background:var(--danger-bg);  color:var(--danger); }
.air-tranche-badge.comptant { background:var(--info-bg);    color:var(--info); }

/* ── Barre progression versements ────────────────────────────────── */
.air-progress-wrap { background:var(--border); border-radius:20px; height:8px; margin:6px 0; overflow:hidden; }
.air-progress-bar  { height:100%; border-radius:20px; background:var(--accent); transition:width .4s; }

/* ── Spin animation ───────────────────────────────────────────────── */
.spin { animation:spin 1s linear infinite; display:inline-block; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Theme button ─────────────────────────────────────────────────── */
.air-theme-btn { background:none; border:none; color:var(--text-2); font-size:18px; cursor:pointer; padding:6px; border-radius:8px; transition:background .15s; }
.air-theme-btn:hover { background:var(--bg-hover); color:var(--text-1); }

/* ── Chat / Tickets ───────────────────────────────────────────────── */
.air-chat-bubble { max-width:72%; padding:10px 14px; border-radius:12px; font-size:13px; line-height:1.5; margin-bottom:8px; }
.air-chat-bubble.sent     { background:var(--accent); color:#fff; border-bottom-right-radius:4px; margin-left:auto; }
.air-chat-bubble.received { background:var(--bg-hover); border-bottom-left-radius:4px; }
.air-chat-meta { font-size:11px; color:var(--text-3); margin-bottom:2px; }

/* ── Timeline ─────────────────────────────────────────────────────── */
.air-timeline { position:relative; padding-left:24px; }
.air-timeline::before { content:''; position:absolute; left:8px; top:0; bottom:0; width:2px; background:var(--border); }
.air-timeline-item { position:relative; padding-bottom:20px; }
.air-timeline-dot { position:absolute; left:-20px; top:4px; width:12px; height:12px; border-radius:50%; background:var(--accent); border:2px solid var(--bg-card); }
.air-timeline-dot.success { background:var(--success); }
.air-timeline-dot.danger  { background:var(--danger); }
.air-timeline-dot.warning { background:var(--warning); }
.air-timeline-content { background:var(--bg-hover); border-radius:8px; padding:10px 14px; font-size:13px; }
.air-timeline-title { font-weight:600; margin-bottom:4px; }
.air-timeline-date { font-size:11px; color:var(--text-3); }

/* ── KPI amélioré ─────────────────────────────────────────────────── */
.air-kpi { display:flex; align-items:center; gap:14px; padding:18px; background:var(--bg-card); border-radius:14px; box-shadow:var(--shadow-sm); border:1px solid var(--border); }
.air-kpi-icon { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:22px; }
.air-kpi-value { font-size:24px; font-weight:800; line-height:1; }
.air-kpi-label { font-size:12px; color:var(--text-3); margin-top:4px; }
.air-kpi-trend { font-size:11px; margin-top:4px; }
.air-kpi-trend.up   { color:var(--success); }
.air-kpi-trend.down { color:var(--danger); }

/* ── Status badge troc/rachat ─────────────────────────────────────── */
.air-op-type { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; }
.air-op-type.troc    { background:rgba(139,92,246,.15); color:#7c3aed; }
.air-op-type.rachat  { background:rgba(16,185,129,.15);  color:#059669; }
.air-op-type.reprise { background:rgba(245,158,11,.15);  color:#d97706; }

/* ── Marketplace cards ────────────────────────────────────────────── */
.air-plan-card { background:var(--bg-card); border:2px solid var(--border); border-radius:16px; padding:24px; transition:all .2s; cursor:pointer; position:relative; overflow:hidden; }
.air-plan-card:hover, .air-plan-card.selected { border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-light); }
.air-plan-card.featured { border-color:var(--accent); }
.air-plan-badge { position:absolute; top:12px; right:12px; background:var(--accent); color:#fff; font-size:10px; font-weight:700; padding:3px 8px; border-radius:20px; }
.air-plan-price { font-size:32px; font-weight:800; color:var(--accent); margin:12px 0; }
.air-plan-price small { font-size:14px; font-weight:400; color:var(--text-3); }
.air-plan-feature { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-2); padding:4px 0; }
.air-plan-feature i { color:var(--success); font-size:12px; width:16px; }

/* ── Upload zone ──────────────────────────────────────────────────── */
.air-upload-zone { border:2px dashed var(--border-2); border-radius:12px; padding:30px; text-align:center; cursor:pointer; transition:all .2s; }
.air-upload-zone:hover, .air-upload-zone.dragover { border-color:var(--accent); background:var(--accent-light); }
.air-upload-zone i { font-size:36px; color:var(--text-3); display:block; margin-bottom:10px; }
.air-upload-zone p { font-size:13px; color:var(--text-2); }

/* ── Responsive amélioré ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .air-notif-panel { width:calc(100vw - 32px); right:-16px; }
  .air-modal { margin:10px; max-width:calc(100vw - 20px); }
  .air-kpi-value { font-size:20px; }
}
