/* =====================================================
   Boutique Collective — Style Premium
   Thème : Vert naturel/bio, dark mode, glassmorphism
===================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../../assets/fonts/inter-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../../assets/fonts/inter-500.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../../assets/fonts/inter-600.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../../assets/fonts/inter-700.ttf') format('truetype');
}

/* --- Variables & Reset --- */
:root {
  --bg: #f4f9f4;
  --bg2: #e8f0e8;
  --surface: #ffffff;
  --surface2: #fdfdfd;
  --border: rgba(0, 0, 0, 0.08);
  --primary: #2d7a4a;
  --primary-dim: #4caf6e;
  --accent: #689f38;
  --danger: #e74c3c;
  --text: #2d3a30;
  --text-dim: #5c7a65;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .06);
  --transition: all .18s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-dim);
  border-radius: 99px;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.gap-2 {
  gap: .5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-1 {
  gap: .25rem;
}

.flex-col {
  flex-direction: column;
}

/* =====================================================
   ÉCRAN DE LOGIN
===================================================== */
#login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, #c4e1cd 0%, #f4f9f4 70%);
  padding: 1rem;
  position: relative;
}

.login-version {
  position: absolute;
  bottom: 2rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  opacity: 0.5;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.login-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card .logo {
  font-size: 2.5rem;
  margin-bottom: .5rem;
}

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .25rem;
  color: var(--primary);
}

.login-card p {
  color: var(--text-dim);
  font-size: .9rem;
  margin-bottom: 2rem;
}

.form-group {
  text-align: left;
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}

.form-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  /* Augmenté pour l'accessibilité tactile */
  color: var(--text);
  font-size: 1rem;
  min-height: 48px;
  /* Standard Google 48px */
}

.form-group input:focus {
  border-color: var(--primary);
  background: rgba(76, 175, 110, 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem 1.5rem;
  /* Augmenté pour l'accessibilité */
  min-height: 48px;
  /* Standard Google 48px */
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(76, 175, 110, .4);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
}

.btn-danger {
  background: rgba(231, 76, 60, .18);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, .3);
}

.btn-danger:hover {
  background: rgba(231, 76, 60, .3);
}

.btn-sm {
  padding: .4rem .85rem;
  font-size: .85rem;
}

.error-msg {
  color: var(--danger);
  font-size: .85rem;
  margin-top: .75rem;
  text-align: center;
}

/* =====================================================
   LAYOUT PRINCIPAL
===================================================== */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Topbar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 110;
  /* Doit être supérieur à la catalogue-toolbar (100) */
  background: rgba(244, 249, 244, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar .brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.topbar .brand span {
  font-size: 1.25rem;
}

.topbar .user-info {
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.topbar .user-info strong {
  color: var(--text);
}

.cart-btn {
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .9rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
  transition: var(--transition);
}

.cart-btn:hover {
  border-color: var(--primary);
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  color: white;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-badge.hidden {
  display: none;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.burger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  width: 48px;
  /* Taille tactile minimale Google */
  height: 48px;
  /* Taille tactile minimale Google */
  align-items: center;
  justify-content: center;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  white-space: nowrap;
  /* Plus d'onglets sur 2 lignes */
}

.nav-tab:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-tab.active {
  background: var(--surface2);
  color: var(--primary);
  font-weight: 600;
}

/* Admin Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 1000;
  padding: 0.5rem;
  backdrop-filter: blur(20px);
}

.nav-dropdown:hover .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-dropdown-item:hover {
  background: var(--surface2);
  color: var(--primary);
}

/* =====================================================
   CATALOGUE (Unified Toolbar & Custom Dropdowns)
===================================================== */
.catalogue-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.catalogue-toolbar {
  display: flex;
  flex-wrap: nowrap;
  /* EMPÊCHE la 2ème ligne de se former ! */
  align-items: center;
  gap: 0.5rem;
  position: sticky;
  top: 64px;
  z-index: 100;
  background: var(--bg);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.filter-select-group {
  display: flex;
  gap: 0.5rem;
  flex: 1 1 auto;
  /* Peut rétrécir si besoin */
  min-width: 0;
  /* Permet à l'ellipsis de fonctionner */
}

/* LA BARRE DE RECHERCHE */
.search-input-group {
  flex: 1 1 140px;
  /* Prend tout l'espace libre, rétréci max 140px */
}

.search-input-group input {
  width: 100%;
  height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 1rem 0 2.2rem;
  color: var(--text);
  font-size: 0.9rem;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232d3a30' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'%3e%3c/line%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 0.6rem center;
  background-size: 1rem;
  transition: var(--transition);
}

.search-input-group input:focus {
  border-color: var(--primary);
  background-color: var(--surface);
  outline: none;
}

/* CUSTOM DROPDOWNS */
.custom-dropdown {
  position: relative;
}

.dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 0.5rem 0 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  height: 44px;
  flex: 1 1 auto;
  min-width: 0;
  /* Anti-débordement */
  max-width: 140px;
  /* Sur grand écran on n'abuse pas */
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-btn:hover,
.dropdown-btn:focus {
  border-color: var(--primary);
  outline: none;
}

.dropdown-btn::after {
  content: "";
  display: inline-block;
  min-width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  margin-left: 0.4rem;
  transition: transform 0.2s;
}

.custom-dropdown.show .dropdown-btn::after {
  transform: rotate(180deg);
}

.custom-dropdown.show .dropdown-btn {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76, 175, 110, 0.2);
}

.dropdown-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MENU DÉROULANT ENTIÈREMENT CONTRÔLÉ */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  /* Fond clair translucide */
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 180px;
  max-height: 50vh;
  overflow-y: auto;
  z-index: 200;
  padding: 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-dim) transparent;
}

.custom-dropdown.show .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 0.75rem 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  min-height: 44px;
  /* Accessibilité mobile (A+) */
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(0, 0, 0, 0.04);
  /* Effet Hover Premium Light */
  color: var(--text);
}

.dropdown-item.active {
  background: rgba(76, 175, 110, 0.15);
  /* var(--primary) avec transparence */
  color: var(--primary);
  font-weight: 600;
}


.catalogue-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  overflow-y: auto;
}

.results-info {
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  border-color: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

.product-card.in-cart {
  border-color: var(--primary);
  background: rgba(76, 175, 110, 0.05);
}

.product-img-wrapper {
  width: 100%;
  aspect-ratio: 4/3;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  position: relative;
}

.product-description-tooltip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 100%;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  font-size: 0.75rem;
  padding: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 5;
  line-height: 1.5;
  backdrop-filter: blur(8px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-dim) transparent;
  pointer-events: auto;
}

.product-img-wrapper:hover .product-description-tooltip {
  transform: translateY(0);
}

.product-card-ref {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text);
  z-index: 4;
  border: 1px solid var(--border);
  pointer-events: none;
  letter-spacing: 0.02em;
}

.badge-admin {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 15;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(45, 122, 74, 0.25);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.badge-admin:hover {
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 6px 18px rgba(45, 122, 74, 0.35);
  filter: brightness(1.1);
}

.badge-admin-recap {
  top: auto !important;
  left: auto !important;
  bottom: 0.4rem !important;
  right: 0.4rem !important;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(76, 175, 110, .05), transparent);
  pointer-events: none;
}

.product-card:hover {
  border-color: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

.product-card.in-cart {
  border-color: var(--primary);
  background: rgba(76, 175, 110, .08);
}

.product-name {
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.3;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .2rem;
}

.tag {
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-weight: 500;
}

.tag-bio {
  background: rgba(76, 175, 110, .2);
  color: var(--accent);
}

.tag-origin {
  background: rgba(0, 0, 0, .06);
  color: var(--text-dim);
}

.tag-dispo {
  background: rgba(76, 175, 110, .15);
  color: var(--primary);
}

.tag-indispo {
  background: rgba(231, 76, 60, .15);
  color: var(--danger);
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: auto;
}

.product-poids {
  font-size: .78rem;
  color: var(--text-dim);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .3rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: inherit;
}

.qty-btn:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
}

.qty-input {
  width: 48px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem;
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
}

.add-btn {
  width: 100%;
  margin-top: .5rem;
  padding: .5rem;
  background: rgba(76, 175, 110, .15);
  border: 1px solid var(--primary-dim);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.add-btn:hover {
  background: var(--primary);
  color: white;
}

.add-btn.in-cart {
  background: var(--primary);
  color: white;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-btn {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: .4;
  cursor: default;
}

/* =====================================================
   VUE COMMANDE VALIDÉE
===================================================== */
#view-order {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.order-card .order-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(76, 175, 110, .2), transparent);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.incomplete-row {
  background: rgba(231, 76, 60, 0.05);
}

.order-table th,
.order-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.order-card .order-header .check {
  font-size: 3rem;
  margin-bottom: .5rem;
}

.order-card .order-header h2 {
  color: var(--primary);
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  table-layout: auto;
}

.order-table th:first-child,
.order-table td:first-child {
  width: 100%;
}

.order-table th:not(:first-child),
.order-table td:not(:first-child) {
  white-space: nowrap;
}

.order-table th {
  padding: .6rem 1rem;
  text-align: left;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.order-table td {
  padding: .65rem 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.order-table tbody tr:hover {
  background: var(--surface2);
}

.order-total-row td {
  font-weight: 700;
  padding: 1rem;
  color: var(--primary);
  font-size: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

/* =====================================================
   PAGE ADMIN
===================================================== */
#view-admin {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

#view-admin h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.admin-grid-users {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.panel-header h3 {
  font-size: 1rem;
}

.panel-body {
  padding: 1.25rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  table-layout: auto;
}

.admin-table th:first-child,
.admin-table td:first-child {
  width: 100%;
}

.admin-table th:not(:first-child),
.admin-table td:not(:first-child) {
  white-space: nowrap;
}

.admin-table th {
  padding: .5rem .75rem;
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: var(--surface2);
}

.user-row td:last-child {
  text-align: right;
}

/* toast */
.toast {
  position: fixed;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%) translateY(200%);
  background: var(--surface2);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 99px;
  padding: .65rem 1.75rem;
  font-size: .9rem;
  font-weight: 500;
  z-index: 2000;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.toast.success {
  border-color: var(--primary);
  color: var(--primary);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

/* Loading spinner */
.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem;
}

.spinner::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive & Burger */
.desktop-only {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 1rem;
}

@media (max-width: 992px) {
  .nav-tabs.desktop-only {
    gap: 0.5rem;
  }

  .nav-tab {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .burger-btn {
    display: flex;
  }

  .topbar {
    padding: 0.6rem 1rem;
  }

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

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  visibility: visible;
  opacity: 1;
  transition: opacity .3s ease;
}

.mobile-drawer.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.drawer-content {
  position: relative;
  width: 280px;
  height: 100%;
  background: rgba(244, 249, 244, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  z-index: 2;
}

.mobile-drawer.hidden .drawer-content {
  transform: translateX(100%);
}

.drawer-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.drawer-header .brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

.close-btn {
  background: var(--surface);
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.mobile-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-tabs .nav-tab {
  text-align: left;
  padding: 1rem 1.25rem;
  width: 100%;
  font-size: 1rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
}

.mobile-nav-tabs .nav-tab.active {
  background: var(--surface2);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
}

.drawer-divider {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
  opacity: 0.5;
}

.drawer-user-info {
  margin-top: auto;
  padding-bottom: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-dim);
}

.btn-block {
  width: 100%;
}

.priority-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  /* Couleur ambre foncée (plus lisible sur fond blanc) */
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 600;
  display: inline-block;
}

/* --- Nouvelles classes pour suppression Inline (Security) --- */
.install-banner {
  background: #1a1a1a;
  color: #ffffff;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.8rem;
  border-bottom: 2px solid #5d9b58;
  line-height: 1.5;
  position: relative;
}

.install-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 48px;
  /* Taille tactile minimale Google */
  height: 48px;
  /* Taille tactile minimale Google */
  display: flex;
  align-items: center;
  justify-content: center;
}

.container-wide {
  max-width: 100%;
  margin: 2rem 0.5rem;
  padding: 0 0.5rem;
}

.section-title {
  font-size: 1.5rem;
  color: var(--primary);
}

.section-subtitle {
  color: var(--text-dim);
  font-size: .9rem;
}

.overflow-x-auto {
  overflow-x: auto;
}

.panel-title-small {
  font-size: 0.9rem;
  opacity: 0.8;
}

.panel-subtitle-small {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.admin-table-foot {
  border-top: 2px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
  font-weight: 700;
}

.form-select {
  width: 100%;
  padding: 0.8rem;
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text);
  border: 1.5px solid var(--border);
  font-size: 0.9rem;
  outline: none;
}

.form-select:focus {
  border-color: var(--primary);
}

/* --- Styles pour le Catalogue (Extrait du JS) --- */
.tag-primary-dim {
  background: var(--primary-dim);
  color: white;
  opacity: 0.9;
}

.colisage-card {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
  display: block;
}

.colisage-title-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.progress-bg {
  height: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-svg {
  display: block;
  border-radius: 4px;
}

.progress-fill-rect {
  fill: var(--primary);
  transition: width 0.3s ease;
  /* Note: transitions on attributes are limited but supported for width in some contexts */
}

.status-msg-complete {
  color: var(--primary);
  font-weight: 600;
}

.price-large {
  font-size: 1.6rem;
}

.price-subtext {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: -0.4rem;
  margin-bottom: 0.5rem;
}

/* ── FORMULAIRES ADMIN ── */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.span-2 {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.form-select,
.admin-form-grid input:not([type="checkbox"]):not([type="radio"]),
.admin-form-grid textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%232d7a4a' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-select:focus,
.admin-form-grid input:focus,
.admin-form-grid textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(45, 122, 74, 0.1);
  background: #ffffff;
}

.price-my-part-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  margin-bottom: 0.8rem;
}

.qty-selector-container {
  margin-top: 0.5rem;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.qty-colis-cell {
  text-align: center;
}

.qty-colis-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.qty-colis-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.qty-divider {
  height: 2rem;
  width: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.qty-pieces-label {
  font-size: 0.65rem;
  margin-top: 0.3rem;
  opacity: 0.7;
}

.order-tag-danger {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.order-header-check {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.incomplete-row {
  background: rgba(231, 76, 60, 0.03);
}

.qty-input-selection {
  width: 50px !important;
}

.cell-colisage-header {
  left: auto !important;
  z-index: 1 !important;
  border-left: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.w-100 {
  width: 100% !important;
}

.color-danger {
  color: var(--danger) !important;
}

.color-primary {
  color: var(--primary) !important;
}

/* --- Tableaux Admin Complexes (Récap) --- */
.recap-table-wrapper {
  overflow: auto;
  max-height: 80vh;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.sticky-col {
  position: sticky;
  left: 0;
  background: var(--bg2);
  z-index: 2;
}

.sticky-header-level1 {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.sticky-header-level2 {
  position: sticky;
  top: 53px;
  /* Hauteur de l'en-tête level1 */
  z-index: 9;
  background: var(--bg2);
}

.sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--bg2) !important;
  /* bg1 n'existait pas, cela causait le problème de transparence */
  border-top: 2px solid var(--border);
}

.bg-danger-soft {
  background: rgba(231, 76, 60, 0.08) !important;
}

.cell-highlight {
  background: rgba(0, 0, 0, 0.03);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.fw-600 {
  font-weight: 600;
}

.opacity-60 {
  opacity: 0.6;
}

.opacity-20 {
  opacity: 0.2;
}

.admin-tools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
}

.vertical-divider {
  height: 12px;
  width: 1px;
  background: var(--border);
  display: inline-block;
  margin: 0 0.75rem;
}

.admin-tools-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  font-weight: 700;
}

/* --- Utilitaires de Design (CSP Friendly) --- */
.color-dim {
  color: var(--text-dim) !important;
}

.color-white {
  color: white !important;
}

.color-primary-bold {
  color: var(--primary);
  font-weight: 700;
}

.bg-transparent {
  background: transparent !important;
}

.border-none {
  border: none !important;
}

.p-1 {
  padding: 1rem !important;
}

.p-1-5 {
  padding: 1.5rem !important;
}

.p-2 {
  padding: 2rem !important;
}

.pr-1 {
  padding-right: 1rem !important;
}

.border-t {
  border-top: 1px solid var(--border) !important;
}

.flex-1 {
  flex: 1 !important;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-gap-1 {
  display: flex;
  gap: 1rem;
}

.justify-center {
  justify-content: center !important;
}

.lh-1-6 {
  line-height: 1.6 !important;
}

.text-1-1 {
  font-size: 1.1rem !important;
}

.text-08 {
  font-size: 0.8rem !important;
}

.text-075 {
  font-size: 0.75rem !important;
}

.text-07 {
  font-size: 0.7rem !important;
}

.fade-out {
  opacity: 0;
  transition: opacity 1s ease-out;
  pointer-events: none;
}

.no-scroll {
  overflow: hidden !important;
}

/* Utility for accessibility (W3C/SEO) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Footer Récapitulatif double ligne */
.sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 100 !important;
  background: var(--surface);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.sticky-footer td {
  border-top: 1px solid var(--border);
  background: inherit;
}

.row-basket {
  background: var(--bg) !important;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.row-validated {
  background: white !important;
  border-top: 2px solid var(--border) !important;
}

.color-success-bold {
  color: var(--primary);
  font-weight: 800;
}

.color-primary-bold {
  color: var(--primary);
  font-weight: 700;
}

.cell-final-total {
  padding-right: 1rem !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.color-white {
  color: #fff !important;
}

/* Styles pour le panier personnel (Double-Total) */
.order-table tfoot .row-basket td {
  background: var(--bg-soft) !important;
  color: var(--text-dim) !important;
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.order-table tfoot .row-validated td {
  background: var(--surface) !important;
  font-weight: 700;
  border-top: 2px solid var(--border) !important;
}

.order-table tfoot .row-validated td:last-child {
  color: var(--primary);
  font-size: 1.1rem;
}

.row-validated-item {
  background-color: rgba(39, 174, 96, 0.03) !important;
}

.row-validated-item td:first-child {
  border-left: 3px solid var(--primary);
}