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

:root {
  --bg:      #121016;
  --surface: #1c1924;
  --border:  #4b3061; /* Violet chaud */
  --text:    #ffffff;
  --muted:   #9489a1;
  --accent:  #d670ff; /* Violet néon / Rose fuchsia */
  --tag-bg:  #2b2336;
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);
  --radius:    10px;
  --sidebar-w: 220px;
  --transition: 0.22s ease;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 20px;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}
.sidebar-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 48px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  padding: 15px;
  justify-content: center;
}
.logo-img {
    max-width: 100%;         /* Ne dépasse jamais la largeur de la sidebar */
    height: auto;            /* Garde les proportions */
    max-height: 150px;        /* Ajustez cette valeur selon la hauteur de votre header/sidebar */
    transition: transform 0.3s ease; /* Petit effet au survol si désiré */
}
.logo-img:hover {
    transform: scale(1.05);  /* Le logo grossit légèrement au survol */
}
.sidebar-logo span { color: var(--muted); font-weight: 300; }
.nav-section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  padding-left: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
  user-select: none;
}
.nav-item:hover { background: var(--tag-bg); color: var(--text); }
.nav-item.active { background: var(--tag-bg); color: var(--text); font-weight: 500; }
.nav-item svg { flex-shrink: 0; opacity: 0.6; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }
.nav-item .badge {
  margin-left: auto;
  font-size: 10px;
  background: var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 2px 7px;
}
.nav-divider { height: 1px; background: var(--border); margin: 16px 0; }
.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  padding-left: 10px;
  line-height: 1.6;
}

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

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  min-height: 56px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-username {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.topbar-username span {
  color: var(--muted);
  font-weight: 400;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { opacity: 0.85; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1); /* Optionnel : rend le bouton gris */
  pointer-events: none; /* Empêche tout clic */
}

/* ── Auth modal ── */
.modal.auth-modal {
  flex-direction: column;
  max-width: 400px;
  width: 90vw;
  padding: 36px 32px 32px;
  position: relative;
  border-radius: 16px;
}
.auth-modal .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: all var(--transition);
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.auth-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-field input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
}
.auth-field input:focus { border-color: var(--accent); }
.auth-error {
  font-size: 12px;
  color: #c0392b;
  min-height: 18px;
  margin-bottom: 8px;
}
.auth-submit {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
  margin-top: 4px;
}
.auth-submit:hover { opacity: 0.85; }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 16, 0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  overflow: hidden;
  max-width: 820px;
  width: 90vw;
  max-height: 90vh;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tag-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* ── States ── */
.state-placeholder { text-align: center; padding: 60px 20px; color: var(--muted); }
.state-placeholder svg { margin-bottom: 12px; opacity: 0.3; }
.state-placeholder p { font-size: 14px; }

.loader { display: flex; justify-content: center; padding: 48px; }
.loader-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  margin: 0 3px;
  animation: bounce 0.9s infinite ease-in-out;
}
.loader-dot:nth-child(2) { animation-delay: 0.15s; }
.loader-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}


.add-col-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.add-col-quantity-wrapper input {
    width: 100%;
    text-align: center;
    padding: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius);
    -moz-appearance: textfield; /* Cache les flèches par défaut */
}

.add-col-quantity-wrapper input::-webkit-outer-spin-button,
.add-col-quantity-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-btn {
    width: 25%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition);
}

.qty-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Foil toggle button (dans modal ajout) ── */
.add-col-foil-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--tag-bg);
}
.foil-btn {
  position: relative;
  overflow: hidden;
  padding: 6px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.04em;
}
.foil-btn.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #ffd700, #ff69b4, #00bfff, #9b59b6);
  background-size: 300% 300%;
  animation: foil-badge-shift 2s linear infinite;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.foil-hint {
  font-size: 12px;
  color: var(--muted);
}