/* ═══════════════════════════════════════════════════════════════════════════
   IT Manager — Design System
   Inspiré du mockup : sidebar claire, cards épurées, typographie propre
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg:           #f4f6f9;
  --surface:      #ffffff;
  --surface-2:    #f9fafb;
  --border:       #e5e7eb;
  --border-light: #f3f4f6;
  --text:         #111827;
  --text-2:       #374151;
  --text-muted:   #6b7280;
  --text-xs:      #9ca3af;

  --primary:      #6366f1;
  --primary-light:#eef2ff;
  --primary-dark: #4f46e5;

  --green:        #16a34a;
  --green-light:  #dcfce7;
  --orange:       #ea580c;
  --orange-light: #fff7ed;
  --red:          #dc2626;
  --red-light:    #fef2f2;
  --gray-light:   #f3f4f6;

  --sidebar-w:    220px;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-xs:    6px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
}

[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #263449;
  --border:       #334155;
  --border-light: #1e293b;
  --text:         #f1f5f9;
  --text-2:       #e2e8f0;
  --text-muted:   #94a3b8;
  --text-xs:      #64748b;
  --primary-light:#312e81;
  --green-light:  #14532d;
  --orange-light: #431407;
  --red-light:    #450a0a;
  --gray-light:   #1e293b;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

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

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-brand h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.sidebar-brand p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  padding-left: 1px;
}

.sidebar-nav { padding: 10px 10px; flex: 1; }

.nav-section {
  padding: 12px 8px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
  margin-bottom: 1px;
}
.nav-link:hover  { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-link .icon  { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border-light);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.user-role  { font-size: 11px; color: var(--text-muted); }
.btn-logout {
  width: 100%; padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer; font-size: 12px;
  transition: background .12s, color .12s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-logout:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* Copyright sidebar */
.sidebar-copyright {
  padding: 8px 14px 10px;
  font-size: 10px;
  color: var(--text-xs);
  text-align: center;
  border-top: 1px solid var(--border-light);
  letter-spacing: .02em;
}

/* Copyright login */
.login-copyright {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 20px;
  width: 100%;
}

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

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page-body { padding: 28px; flex: 1; max-width: 1000px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.card-body { padding: 20px; }

/* ── Stats dashboard ─────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}
.stat-value.green  { color: var(--green); }
.stat-value.orange { color: var(--orange); }
.stat-value.red    { color: var(--red); }
.stat-value.gray   { color: var(--text-muted); }
.stat-value.indigo { color: var(--primary); }

/* ── Tableaux ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green   { background: var(--green-light);  color: var(--green); }
.badge-orange  { background: var(--orange-light); color: var(--orange); }
.badge-red     { background: var(--red-light);    color: var(--red); }
.badge-gray    { background: var(--gray-light);   color: var(--text-muted); }
.badge-indigo  { background: var(--primary-light);color: var(--primary-dark); }

/* Badge avec point coloré */
.badge-dot::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Badges import historique */
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Barre de progression ────────────────────────────────────────────────── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}
.progress-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width .3s;
}
.progress-pct { font-size: 11px; color: var(--text-muted); width: 28px; text-align: right; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-2); border-color: #d1d5db; }
.btn-danger { background: var(--red-light); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 4px 9px; font-size: 11px; }
.btn-icon {
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* ── Formulaires ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input[type=text], input[type=email], input[type=password],
input[type=tel], input[type=date], input[type=number],
input[type=search], select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
select { cursor: pointer; }
textarea { min-height: 80px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Modales ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
  border: 1px solid var(--border);
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 820px; }

@keyframes modalIn {
  from { transform: translateY(-12px) scale(.98); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}

.modal-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
/* Le × de fermeture dans le header */
.modal-header .modal-close {
  background: none; border: none;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transition: background .12s;
  flex-shrink: 0;
}
.modal-header .modal-close:hover { background: var(--surface-2); color: var(--text); }

/* Les boutons "Annuler" dans le footer gardent leur style .btn */
.modal-footer .modal-close {
  /* hérite uniquement du comportement JS, pas du style icon */
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Checklist ───────────────────────────────────────────────────────────── */
.checklist { list-style: none; }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type=checkbox] {
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
}
.checklist-item.done .item-label {
  text-decoration: line-through;
  color: var(--text-muted);
}
.item-label { flex: 1; font-size: 13.5px; }
.item-meta  { font-size: 11px; color: var(--text-xs); white-space: nowrap; }

/* ── Filtres ─────────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.filters select, .filters input {
  width: auto;
  padding: 7px 10px;
  font-size: 13px;
}

/* ── Upload zone ─────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--text-muted);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.upload-zone input[type=file] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}
.upload-text { font-size: 14px; font-weight: 600; color: var(--text-2); }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.upload-hint a { color: var(--primary); text-decoration: underline; cursor: pointer; }

/* Fichier sélectionné */
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-xs);
  margin-top: 10px;
}
.file-info-icon { font-size: 20px; flex-shrink: 0; }
.file-info-name { font-size: 13px; font-weight: 600; color: var(--primary-dark); flex: 1; }
.file-info-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── Mapping colonnes ────────────────────────────────────────────────────── */
.mapping-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mapping-row {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.mapping-row:last-child { border-bottom: none; }
.mapping-col-csv {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 11px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.mapping-arrow {
  text-align: center;
  color: var(--text-xs);
  font-size: 16px;
}
.mapping-ignored {
  font-size: 12px;
  color: var(--text-xs);
  font-style: italic;
  padding: 7px 11px;
}
.mapping-row select {
  padding: 7px 10px;
  font-size: 13px;
}

/* ── Import stats ────────────────────────────────────────────────────────── */
.import-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.import-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.import-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 5px; }
.import-stat-value { font-size: 26px; font-weight: 800; line-height: 1; }

/* ── Historique import ───────────────────────────────────────────────────── */
.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}
.history-item:last-child { border-bottom: none; }
.history-date  { font-size: 13px; color: var(--text-muted); min-width: 140px; }
.history-badges { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.history-by    { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── Sélecteur produits ──────────────────────────────────────────────────── */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
}
.product-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  user-select: none;
}
.product-item:hover { border-color: var(--primary); background: var(--surface-2); }
.product-item.selected { border-color: var(--primary); background: var(--primary-light); }
.product-item .p-name { font-weight: 600; font-size: 13px; color: var(--text); }
.product-item .p-cat  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Sélecteur produit étendu — grille 2 colonnes avec couleur ───────────── */
.produits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.produits-cat-header {
  grid-column: 1 / -1;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
  padding: 8px 2px 3px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.produits-cat-header:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.product-item-ext {
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .13s, background .13s, box-shadow .13s;
  display: flex;
  flex-direction: column;
}
.product-item-ext:hover { border-color: var(--primary); border-left-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.product-item-ext.selected { background: var(--primary-light); grid-column: 1 / -1; }
.product-item-ext .p-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.product-item-ext .p-name { font-weight: 600; font-size: 13px; color: var(--text); line-height: 1.3; }
.product-item-ext .p-meta { display: flex; align-items: center; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.p-cat-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  background: var(--surface-2); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.p-opts-count { font-size: 11px; color: var(--text-muted); }
.p-check {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  transition: all .13s;
  margin-top: 1px;
}
.product-item-ext.selected .p-check { background: var(--primary); border-color: var(--primary); color: #fff; }
/* Options + couleur panel */
.produit-options-panel {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.opts-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 6px;
}
.opts-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.opts-fields-grid .opt-bool { grid-column: 1 / -1; }
/* Color swatches */
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent;
  outline: 2px solid transparent; outline-offset: 2px;
  transition: transform .1s, outline-color .1s;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active { outline-color: var(--text); transform: scale(1.1); }

/* ── Tags ────────────────────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.tag-remove { cursor: pointer; opacity: .6; }
.tag-remove:hover { opacity: 1; }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
#toasts {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 11px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn .2s ease;
  max-width: 300px;
  pointer-events: all;
  border: 1px solid transparent;
}
@keyframes toastIn {
  from { transform: translateX(10px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-success { background: var(--green-light);  color: var(--green);  border-color: #bbf7d0; }
.toast-error   { background: var(--red-light);    color: var(--red);    border-color: #fecaca; }
.toast-info    { background: var(--primary-light);color: var(--primary-dark); border-color: #c7d2fe; }

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 380px;
  box-shadow: var(--shadow-md);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 {
  font-size: 22px;
  color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-error {
  font-size: 13px;
  color: var(--red);
  background: var(--red-light);
  border: 1px solid #fecaca;
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  margin-bottom: 14px;
}

/* ── Catalogue catégories ────────────────────────────────────────────────── */
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .12s, color .12s, border-color .12s;
}
.cat-tab:hover  { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Produit cards ───────────────────────────────────────────────────────── */
.produit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.produit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s;
}
.produit-card:hover { box-shadow: var(--shadow-md); }
.produit-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.produit-nom  { font-size: 14px; font-weight: 700; color: var(--text); }
.produit-cat  { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.produit-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.options-list { border-top: 1px solid var(--border-light); padding-top: 10px; }
.option-item  {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--border-light);
}
.option-item:last-child { border-bottom: none; }
.option-label { color: var(--text-2); }
.option-type  {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}
.cat-sauvegarde { background: #dbeafe; color: #1e40af; }
.cat-firewall   { background: #fee2e2; color: #991b1b; }
.cat-poste      { background: #d1fae5; color: #065f46; }
.cat-serveur    { background: #ede9fe; color: #5b21b6; }
.cat-reseau     { background: #fef3c7; color: #78350f; }

/* ── Utilitaires ─────────────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.mt-1        { margin-top: 6px; }
.mt-2        { margin-top: 12px; }
.mt-3        { margin-top: 20px; }
.mb-1        { margin-bottom: 6px; }
.mb-2        { margin-bottom: 14px; }
.mb-3        { margin-bottom: 20px; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1       { gap: 6px; }
.gap-2       { gap: 10px; }
.flex-1      { flex: 1; }
.hidden      { display: none !important; }
.divider     { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid, .import-stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .import-stats-row { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px; }
}
