/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --sidebar-w:      244px;
  --sidebar-bg:     #0F172A;
  --sidebar-text:   rgba(148,163,184,.75);
  --sidebar-active: #3B82F6;
  --sidebar-hover:  rgba(59,130,246,.1);

  --bg:          #F1F5F9;
  --bg-card:     #FFFFFF;
  --bg-page:     #FFFFFF;
  --bg-hover:    #F8FAFC;
  --surface:     #FFFFFF;
  --border:      #E2E8F0;
  --border-light: #EFF3F8;
  --shadow:    0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.05);

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  --primary:   #2563EB;
  --primary-h: #1D4ED8;
  --success:   #16A34A;
  --danger:    #DC2626;
  --warning:   #D97706;
  --caution:   #CA8A04;
  --neutral:   #64748B;

  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
}

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

html { font-size: 15px; }

body {
  font-family: 'Inter Tight', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

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

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-icon { font-size: 1.8rem; }
.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #f1f5f9;
  letter-spacing: -.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-icon { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  font-size: .75rem;
  color: var(--sidebar-text);
  border-top: 1px solid rgba(255,255,255,.07);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.page-wrapper {
  padding: 32px 36px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.4px;
}

.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .92rem;
  font-weight: 500;
}
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; }
.alert-info    { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 22px; }

/* ============================================================
   STAT CARDS (dashboard)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-sub {
  font-size: .8rem;
  color: var(--text-secondary);
}

.stat-card.danger  { border-left: 4px solid var(--danger); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.primary { border-left: 4px solid var(--primary); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F8FAFC; }

.td-right { text-align: right; font-variant-numeric: tabular-nums; }
.td-center { text-align: center; }
.td-mono { font-size: .85em; }
.td-muted { color: var(--text-muted); font-size: .8rem; }

/* ============================================================
   BADGES (variations de prix)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-sm { padding: 2px 7px; font-size: .7rem; border-radius: 3px; }

.badge-danger  { background: #fef2f2; color: var(--danger);  border: 1px solid #fecaca; }
.badge-warning { background: #fffbeb; color: var(--warning); border: 1px solid #fed7aa; }
.badge-caution { background: #fefce8; color: var(--caution); border: 1px solid #fef08a; }
.badge-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.badge-neutral { background: #F1F5F9; color: var(--neutral); border: 1px solid #E2E8F0; }
.badge-primary { background: #EFF6FF; color: var(--primary); border: 1px solid #BFDBFE; }
.badge-offert  { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .9; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); opacity: 1; }

.btn-danger  { background: var(--danger);  color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-sm  { padding: 5px 12px; font-size: .8rem; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); opacity: 1; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: .875rem; font-weight: 600; color: var(--text-primary); }
.form-hint  { font-size: .78rem; color: var(--text-muted); }

.form-control {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

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

/* Zone drag-and-drop upload */
.upload-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 52px 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg-card);
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: #EFF6FF;
}
.upload-zone input[type=file] { display: none; }
.upload-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.upload-sub  { font-size: .85rem; color: var(--text-muted); }

/* ============================================================
   PRIX + VARIATIONS
   ============================================================ */
.price-up    { color: var(--danger);  font-weight: 700; }
.price-down  { color: var(--success); font-weight: 700; }
.price-same  { color: var(--neutral); }
.price-new   { color: var(--primary); font-style: italic; }

/* Ligne offerte dans un tableau */
.row-offert td { color: var(--text-muted); font-style: italic; }
.row-offert .badge-offert { font-style: normal; }

/* Tableau historique des prix */
.price-history { display: flex; flex-direction: column; gap: 0; }
.ph-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.ph-item:last-child { border-bottom: none; }
.ph-date  { color: var(--text-muted); width: 90px; flex-shrink: 0; }
.ph-price { font-weight: 700; font-variant-numeric: tabular-nums; flex: 1; }
.ph-fournisseur { color: var(--text-secondary); font-size: .82rem; }

/* ============================================================
   FAMILLE TAG
   ============================================================ */
.famille-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
}

.famille-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 500px;
  margin: 20px;
  animation: modalIn .15s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--text-muted); line-height: 1;
}
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-icon  { font-size: 3.5rem; margin-bottom: 14px; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub   { font-size: .88rem; }

/* ============================================================
   PROGRESS / SPINNER
   ============================================================ */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  z-index: 2000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.loading-overlay.active { display: flex; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 8px;
  flex-wrap: wrap;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.page-link:hover { background: var(--bg); text-decoration: none; }
.page-link.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   RECHERCHE / FILTRES
   ============================================================ */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filters-bar .form-control { width: auto; min-width: 180px; }
.search-wrap { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center; }
.search-wrap input { padding-left: 36px; padding-right: 80px; flex: 1; }
.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: .95rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}
.search-clear-btn {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: var(--border);
  border: none;
  border-radius: 3px;
  width: 20px; height: 20px;
  cursor: pointer;
  font-size: .7rem;
  color: var(--text-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.search-clear-btn:hover { background: #cbd5e1; }
.search-live-counter {
  position: absolute;
  right: 34px; top: 50%;
  transform: translateY(-50%);
  font-size: .72rem;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  display: none;
}

/* ============================================================
   COLOR PICKER (familles)
   ============================================================ */
.color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.color-preset {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.color-preset:hover, .color-preset.selected {
  transform: scale(1.15);
  border-color: var(--text-primary);
}

/* ============================================================
   MOBILE TOPBAR (hamburger)
   ============================================================ */
.mobile-topbar {
  display: none;
  background: var(--sidebar-bg);
  padding: 0 16px;
  height: 54px;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 900;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.mobile-topbar .brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: #f1f5f9;
  flex: 1;
}
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1.35rem;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.hamburger:hover { background: rgba(255,255,255,.1); color: #f1f5f9; }

/* Overlay backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  z-index: 1050;
  cursor: pointer;
}
.sidebar-backdrop.open { display: block; }

/* Bouton ✕ dans la sidebar (mobile only) */
.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: auto;
  line-height: 1;
  transition: background .15s, color .15s;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,.1); color: #f1f5f9; }

/* ============================================================
   SIDEBAR — NAVIGATION COLLAPSIBLE
   ============================================================ */
.sidebar-sep {
  padding: 20px 16px 4px;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(148,163,184,.32);
}

.nav-section { display: flex; flex-direction: column; margin-bottom: 5px; }

/* Bouton-carte de catégorie */
.nav-cat-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  color: #e8eef8;
  letter-spacing: .01em;
  text-align: left;
  transition: filter .2s, box-shadow .2s;
}
.nav-cat-btn:hover {
  filter: brightness(1.22);
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.nav-cat-btn[aria-expanded="true"] {
  filter: brightness(1.1);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 4px 14px rgba(0,0,0,.18);
}

.nav-cat-card-icon { font-size: 1.3rem; flex-shrink: 0; }
.nav-cat-label { flex: 1; }
.nav-cat-arrow {
  font-size: .72rem;
  color: rgba(255,255,255,.38);
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.4,0,.2,1), color .2s;
  line-height: 1;
}
.nav-cat-btn[aria-expanded="true"] .nav-cat-arrow {
  transform: rotate(90deg);
  color: rgba(255,255,255,.65);
}

/* Items collapsibles — animation max-height */
.nav-cat-items {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s cubic-bezier(.4,0,.2,1);
}
.nav-cat-items.open { max-height: 500px; }

/* Sous-items */
.nav-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 22px;
  font-size: .84rem;
  font-weight: 400;
  color: rgba(203,213,225,.58);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.nav-sub:hover { background: var(--sidebar-hover); color: #e2e8f0; text-decoration: none; }
.nav-sub.active { background: var(--sidebar-active); color: #fff; font-weight: 500; }
.nav-sub .nav-icon { font-size: .9rem; width: 18px; text-align: center; flex-shrink: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .mobile-topbar   { display: flex; }
  .sidebar-close-btn { display: flex; }

  .app-layout { flex-direction: column; }

  /* Sidebar = tiroir latéral */
  .sidebar {
    position: fixed;
    top: 0;
    left: -288px;
    width: 288px;
    height: 100vh;
    min-width: unset;
    z-index: 1100;
    transition: left .26s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 6px 0 32px rgba(0,0,0,.28);
  }

  .page-wrapper { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hb-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   HAUSSE / BAISSE CARDS (dashboard)
   ============================================================ */
.hb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}
.hb-card {
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.hb-card::after {
  content: '';
  position: absolute;
  top: -28px; right: -28px;
  width: 130px; height: 130px;
  border-radius: 50%;
  opacity: .07;
  background: #fff;
}
.hb-hausse {
  background: linear-gradient(135deg, #7F1D1D 0%, #B91C1C 100%);
  border: 1px solid rgba(220,38,38,.4);
  box-shadow: 0 4px 16px rgba(185,28,28,.2);
}
.hb-baisse {
  background: linear-gradient(135deg, #14532D 0%, #15803D 100%);
  border: 1px solid rgba(22,163,74,.4);
  box-shadow: 0 4px 16px rgba(21,128,61,.2);
}
.hb-icon   { font-size: 1.7rem; margin-bottom: 4px; }
.hb-count  { font-size: 3.6rem; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.hb-label  { font-size: 1rem; font-weight: 700; opacity: .95; margin-top: 2px; }
.hb-since  { font-size: .73rem; opacity: .6; margin-top: 2px; }
.hb-list {
  list-style: none;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hb-list li {
  font-size: .81rem;
  opacity: .88;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.hb-list li .art-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.hb-list li .art-pct {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255,255,255,.15);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: .78rem;
}
.hb-empty {
  font-size: .88rem;
  opacity: .55;
  font-style: italic;
  margin-top: 10px;
}

/* ============================================================
   FILTER DROPDOWN (multi-select avec cases à cocher)
   ============================================================ */
.filter-dropdown {
  position: relative;
}
.filter-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-primary);
  white-space: nowrap;
  font-family: inherit;
  transition: border-color .15s, background .15s, color .15s;
}
.filter-dropdown-btn:hover {
  border-color: #94a3b8;
}
.filter-dropdown-btn.has-filter {
  border-color: var(--primary);
  color: var(--primary);
  background: #eef2ff;
}
.fdd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--primary);
  color: #fff;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}
.filter-dropdown-btn.has-filter .fdd-badge {
  background: var(--primary);
}
.filter-dropdown-arrow {
  font-size: .65rem;
  color: var(--text-muted);
  transition: transform .15s;
}
.filter-dropdown.open .filter-dropdown-arrow {
  transform: rotate(180deg);
}
.filter-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 230px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px 0;
}
.filter-dropdown.open .filter-dropdown-panel {
  display: block;
}
.fdd-group-label {
  padding: 8px 14px 3px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.fdd-group-label:first-child {
  border-top: none;
  margin-top: 0;
}
.fdd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text-primary);
  transition: background .1s;
  user-select: none;
}
.fdd-item:hover { background: var(--bg); }
.fdd-item input[type=checkbox] { cursor: pointer; flex-shrink: 0; }
.fdd-item-color {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.fdd-panel-actions {
  padding: 6px 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  display: flex;
  gap: 8px;
}
.fdd-panel-actions button {
  font-size: .78rem;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
}
.fdd-panel-actions button:hover { text-decoration: underline; }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: .8rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-2  { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
