.setup-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 30px; width: 100%; max-width: 400px; margin-top: 40px; }
.setup-logo { text-align: center; margin-bottom: 30px; }
.setup-logo img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; margin-bottom: 10px; }
.setup-logo .title { font-size: 18px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.setup-label { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; display: block; margin: 16px 0 8px; }
.setup-input { width: 100%; background: var(--bg); border: 1px solid var(--border2); color: var(--text); padding: 12px; border-radius: 6px; font-family: var(--font); font-size: 14px; outline: none; transition: border .2s; -webkit-appearance: none; color-scheme: dark; }
.setup-input:focus { border-color: var(--accent); }
.setup-btn { width: 100%; margin-top: 24px; background: var(--accent); color: var(--bg); padding: 12px; border-radius: 6px; border: none; font-weight: 700; cursor: pointer; transition: opacity .2s; }
.setup-btn:active { opacity: 0.8; }
.setup-err { color: var(--red); font-size: 12px; margin-top: 10px; display: none; text-align: center; }

.spinner { width: 30px; height: 30px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.alerte-badge { background: var(--red); border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; color: #fff; font-weight: 700; display: none; align-items: center; justify-content: center; cursor: pointer; position: absolute; top: -6px; right: -6px; z-index: 10; }
.alerte-badge:hover { opacity: 0.85; }

.user-menu { position: relative; display: inline-block; }
.user-dropdown { position: absolute; top: 100%; right: 0; margin-top: 0; padding-top: 8px; background: transparent; border: none; box-shadow: none; display: none; flex-direction: column; min-width: 200px; z-index: 100; }
.user-dropdown-inner { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); display: flex; flex-direction: column; }
.user-dropdown.show { display: flex; }
.user-dropdown.show .user-dropdown-inner { display: flex; }

.nav-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; transition: color .2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; }
.nav-btn.active { color: var(--accent); border-radius: 4px; background: #6d5f3d; }

.bnav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 500; transition: all .2s; margin: 4px 2px; border-radius: 8px; }
.bnav-btn.active { color: var(--accent); background-color: #6d5f3d; }

.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.card-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin-bottom: 16px; }
.kpi-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.kpi-val { font-size: 24px; font-weight: 700; color: var(--accent); margin: 8px 0 4px; white-space: nowrap; }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }

.cmd-tab { flex: 1; background: var(--bg2); border: none; padding: 14px; color: var(--muted); font-family: var(--font); font-weight: 700; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; text-transform: uppercase; transition: all .2s; }
.cmd-tab:hover { color: var(--text); }
.cmd-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.loader-txt { text-align: center; padding: 16px; color: var(--muted); font-size: 12px; display: none; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.tbl-wrapper { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.tbl th { padding: 12px 16px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 500; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; cursor: pointer; transition: transform 0.2s; }
.dot:hover { transform: scale(1.2); }
.dot-red { background: var(--red); box-shadow: 0 0 8px rgba(224,80,80,0.4); }
.dot-green { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,0.4); }

.badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.b-rouge { background: rgba(224,80,80,0.1); color: #e05050; }
.b-blanc { background: rgba(234,179,8,0.1); color: #eab308; }
.b-rose { background: rgba(233,30,99,0.1); color: #e91e63; }
.b-petillant { background: rgba(74,222,128,0.1); color: var(--green); }
.b-devis { background: rgba(79,107,237,0.15); color: #7b97f5; }
.dot-devis { background: #7b97f5; box-shadow: 0 0 8px rgba(79,107,237,0.4); }

.btn-p { background: #6d5f3d; color: #d1c5c8; padding: 8px 16px; border-radius: 6px; border: none; font-weight: 700; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-o { background: transparent; border: 1px solid var(--border2); color: var(--text); padding: 8px 16px; border-radius: 6px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-o:hover { border-color: var(--muted); }
.btn-icon { background: transparent; border: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; transition: all .2s; }
.btn-icon:hover { color: var(--accent); background: var(--border2); }
.btn-icon.edit { color: #fb923c; } .btn-icon.edit:hover { background: rgba(251,146,60,0.1); color: #fdba74; }
.btn-icon.danger { color: #f87171; } .btn-icon.danger:hover { background: rgba(248,113,113,0.1); color: #fca5a5; }
.btn-icon.plus { color: var(--accent); } .btn-icon.plus:hover { background: rgba(189,189,189,0.1); }
.btn-icon.minus { color: var(--accent); } .btn-icon.minus:hover { background: rgba(189,189,189,0.1); }

.inp { background: #141212; border: 1px solid var(--border2); color: var(--text); padding: 10px 12px; border-radius: 6px; font-family: var(--font); font-size: 13px; width: 100%; outline: none; color-scheme: dark; }
.inp:focus { border-color: var(--accent); }

.modal { background: #100f0fe3; border: 1px solid var(--border); border-radius: 8px; padding: 24px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-title { font-size: 15.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px; display:flex; align-items:center; gap:8px; padding-right: 28px; }
.modal-close-btn { position: absolute; top: 16px; right: 16px; background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.15s; line-height: 1; }
.modal-close-btn:hover { color: #fff; }
.modal { position: relative; }
.fg { margin-bottom: 16px; }
.fg label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.fg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

#notif { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -44%) scale(0.96); z-index: 300; padding: 16px 28px; border-radius: 10px; font-size: 14px; font-weight: 500; background: var(--bg3); border: 1px solid var(--border); color: var(--text); box-shadow: 0 16px 48px rgba(0,0,0,0.6); opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; max-width: 380px; text-align: center; line-height: 1.5; }
#notif.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }

/* --- ANIMATION ASSISTANT VOCAL --- */
.voice-pulse {
  width: 80px; height: 80px;
  background: rgba(74,222,128,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74,222,128, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(74,222,128, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74,222,128, 0); }
}

/* --- STYLE POUR L'IMPRESSION --- */
@media print {
  /* Masquer tout sauf la zone d'impression */
  body > *:not(.modal-ov) { display: none !important; }
  .modal-ov { display: none !important; }
  .modal-ov.modal-visible { display: flex !important; position: static !important; background: white !important; }
  .modal-ov.modal-visible .modal { box-shadow: none !important; border: none !important; max-width: 100% !important; padding: 0 !important; opacity: 1 !important; transform: none !important; }
  #print-zone { display: block !important; background: white !important; color: black !important; padding: 0 !important; }
  #print-zone * { color: black !important; visibility: visible !important; }
  .no-print { display: none !important; }
  @page { margin: 15mm; }
}

@media(max-width: 768px) {
  .kpi-card { padding: 16px 12px; }
  .kpi-val { font-size: 18px; }
}

@media(max-width: 480px) {
  #display-user-name { display: none !important; }
}

@media(min-width: 769px) {
  .modal { max-width: 750px; padding: 32px; }
  .modal-title { font-size: 18.7px; margin-bottom: 24px; }
  .nav-btn { font-size: 13px; padding: 10px 16px; }
  .nav-btn svg { width: 20px; height: 20px; }
  .card-title { font-size: 13px; }
  .kpi-val { font-size: 28px; }
  .kpi-label { font-size: 13px; }
  .tbl { font-size: 15px; }
  .tbl th { font-size: 13px; padding: 16px 20px; }
  .tbl td { padding: 16px 20px; }
  .inp { font-size: 15px; padding: 12px 14px; }
  .btn-p, .btn-o { font-size: 14px; padding: 10px 18px; }
  .fg label { font-size: 12px; }
  .cmd-tab { font-size: 14px; padding: 16px; }
  .badge { font-size: 11px; padding: 5px 10px; }
  .btn-icon { width: 32px; height: 32px; }
  .dot { width: 14px; height: 14px; }
  .setup-box { max-width: 500px; padding: 40px; }
  .setup-logo img { width: 48px; height: 48px; }
  .setup-logo .title { font-size: 22px; }
  .user-menu:hover .user-dropdown { display: flex; } /* hover sur desktop */
}

/* Hover dropdown desktop — pont invisible + délai de fermeture */
@media(min-width: 769px) {
  .user-menu:hover .user-dropdown { display: flex !important; }
  .user-dropdown-inner {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
  }
  .user-menu:hover .user-dropdown-inner,
  .user-dropdown.show .user-dropdown-inner {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* --- PAVÉ NUMÉRIQUE (VENDANGES) --- */
.numpad-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 12px; 
  margin-top: 20px; 
}
.btn-numpad { 
  background: var(--bg3); 
  border: 1px solid var(--border2); 
  color: var(--text); 
  font-size: 26px; 
  font-weight: 700; 
  padding: 24px 10px; 
  border-radius: 12px; 
  cursor: pointer; 
  transition: all 0.1s; 
  user-select: none;
}
.btn-numpad:active { 
  background: var(--accent); 
  color: var(--bg); 
  transform: scale(0.95); 
}
.btn-numpad.action { 
  background: rgba(74,222,128,0.1); 
  color: var(--green); 
  border-color: rgba(74,222,128,0.3); 
}
.btn-numpad.action:active { 
  background: var(--green); 
  color: var(--bg); 
}
.numpad-display { 
  background: #000; 
  border: 2px solid var(--border); 
  border-radius: 12px; 
  font-size: 42px; 
  font-weight: 700; 
  text-align: right; 
  padding: 16px 24px; 
  margin-bottom: 10px; 
  color: var(--accent); 
  letter-spacing: 2px;
}

/* ── SETTINGS ───────────────────────────────────────────────────────────────*/
.settings-group { background:var(--bg2); border:1px solid var(--border2); border-radius:10px; padding:20px; margin-bottom:16px; }
.settings-group-title { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:var(--text); text-transform:uppercase; letter-spacing:.06em; margin-bottom:16px; }

.settings-presets { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.preset-btn { display:flex; align-items:center; gap:6px; padding:7px 12px; border-radius:20px; border:1px solid var(--border2); background:transparent; color:var(--text); font-size:12px; cursor:pointer; transition:border-color .15s, background .15s; }
.preset-btn:hover, .preset-btn.active { border-color:var(--accent); background:var(--bg3); }
.preset-swatch { display:inline-block; width:14px; height:14px; border-radius:50%; flex-shrink:0; }

.settings-colors { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:12px; }
.settings-color-item { display:flex; flex-direction:column; gap:6px; }
.settings-color-item label { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.color-input-wrap { display:flex; align-items:center; gap:8px; }
.color-input-wrap input[type="color"] { width:36px; height:36px; border-radius:6px; border:1px solid var(--border2); padding:2px; background:var(--bg3); cursor:pointer; }
.color-hex { font-size:12px; color:var(--muted); font-family:monospace; }

.settings-toggles { display:flex; flex-direction:column; gap:2px; }
.toggle-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); cursor:pointer; font-size:13px; color:var(--text); }
.toggle-row:last-child { border-bottom:none; }
.toggle-row input[type="checkbox"] { width:36px; height:20px; accent-color:var(--accent); cursor:pointer; }

/* Mode compact */
body.compact .tbl td, body.compact .tbl th { padding:8px 12px; }
body.compact .kpi-card { padding:10px; }
body.compact .card { padding:12px; }
body.compact .inp { padding:7px 10px; }

/* ── USERS TABLE ─────────────────────────────────────────────────────────── */
.role-badge-admin   { background:rgba(224,80,80,.12);  color:#e05050; padding:3px 9px; border-radius:10px; font-size:11px; font-weight:700; }
.role-badge-vendeur { background:rgba(189,189,189,.12); color:#bdbdbd; padding:3px 9px; border-radius:10px; font-size:11px; font-weight:700; }
.role-badge-lecteur { background:rgba(100,100,120,.15); color:#888;    padding:3px 9px; border-radius:10px; font-size:11px; font-weight:700; }

/* Matrice droits */
#rights-matrix tr { border-bottom:1px solid var(--border); }
#rights-matrix td { padding:8px 10px; color:var(--muted); font-size:12px; }
#rights-matrix td:first-child { color:var(--text); font-weight:500; }
.right-yes { color:#4ade80; font-size:14px; }
.right-no  { color:var(--border2); font-size:14px; }
.right-own { color:#eab308; font-size:11px; font-weight:600; }

/* ── SCANNER HTML5 QRCODE — override boutons en français ─────────────────── */
#reader { color: var(--text) !important; background: var(--bg3) !important; }

/* Tous les éléments interactifs générés par la lib */
#reader button.html5-qrcode-element,
#reader a.html5-qrcode-element {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--bg2) !important;
  border: 1px solid var(--border2) !important;
  color: var(--text) !important;
  border-radius: 6px !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin: 4px 2px !important;
  text-decoration: none !important;
  transition: border-color 0.15s !important;
}
#reader button.html5-qrcode-element:hover,
#reader a.html5-qrcode-element:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* Select de caméra */
#reader select.html5-qrcode-element {
  background: var(--bg2) !important;
  border: 1px solid var(--border2) !important;
  color: var(--text) !important;
  border-radius: 6px !important;
  padding: 7px 10px !important;
  font-size: 12px !important;
  width: 100% !important;
  margin: 6px 0 !important;
}

/* Zone de scan */
#reader__scan_region { background: var(--bg3) !important; }
#reader__scan_region video { border-radius: 6px !important; }

/* Masquer l'icône info peu utile */
#reader img[alt="Info icon"] { display: none !important; }

/* Section dashboard */
#reader__dashboard { padding: 8px 0 !important; }
#reader__dashboard_section { padding: 6px 0 !important; }

/* ── DOUANES ─────────────────────────────────────────────────────────────── */
.douanes-nav { display:flex; gap:0; padding:0; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; background:var(--bg2); border-bottom:2px solid var(--border2); border-radius:0; }
.douanes-nav::-webkit-scrollbar { display:none; }
.douanes-tab { display:inline-flex; align-items:center; gap:7px; padding:12px 18px; border:none; border-bottom:3px solid transparent; background:transparent; color:var(--muted); font-size:12px; font-weight:600; cursor:pointer; transition:color .15s, border-color .15s, background .15s; white-space:nowrap; flex-shrink:0; margin-bottom:-2px; }
.douanes-tab:hover { color:var(--text); background:var(--bg3); }
.douanes-tab.active { color: #dfdbd5; background: #6d5f3d; border-bottom:3px solid var(--accent); font-weight:700; }
.douanes-panel { display:none; }
.douanes-panel.active { display:block; }

/* KPIs DRM */
.drm-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin-bottom:20px; }
.drm-kpi { background:var(--bg2); border:1px solid var(--border2); border-radius:8px; padding:14px 16px; text-align:center; }
.drm-kpi-val { font-size:22px; font-weight:700; color:var(--accent); }
.drm-kpi-label { font-size:11px; color:var(--muted); margin-top:4px; text-transform:uppercase; letter-spacing:.04em; }

/* DRM sections */
.drm-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.drm-section { background:var(--bg2); border:1px solid var(--border2); border-radius:8px; padding:16px; margin-bottom:12px; }
.drm-section-title { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:var(--text); text-transform:uppercase; letter-spacing:.06em; margin-bottom:12px; }
.drm-verification { border-color:var(--green); background:rgba(74,222,128,.04); }

/* Calendrier */
.cal-list { display:flex; flex-direction:column; gap:8px; }
.cal-item { display:flex; align-items:center; gap:12px; padding:12px 16px; background:var(--bg2); border:1px solid var(--border2); border-radius:8px; cursor:pointer; transition:border-color .15s; }
.cal-item:hover { border-color:var(--accent); }
.cal-item.cal-urgent { border-color:var(--red); background:rgba(224,80,80,.05); }
.cal-item.cal-past { opacity:.5; }
.cal-dot { font-size:16px; flex-shrink:0; width:24px; text-align:center; }
.cal-info { flex:1; min-width:0; }
.cal-title { font-size:13px; font-weight:700; color:var(--text); }
.cal-date { font-size:11px; color:var(--muted); margin-top:2px; }

/* SQL hint */
.sql-hint { background:var(--bg); padding:10px; border-radius:6px; font-size:11px; overflow-x:auto; margin-top:8px; color:var(--muted); font-family:monospace; }

@media(max-width:768px) {
  .douanes-nav { gap:0; padding:0; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; border-bottom:1px solid var(--border2); }
  .douanes-nav::-webkit-scrollbar { display:none; }
  .douanes-tab { font-size:11px; padding:10px 12px; border-radius:0; white-space:nowrap; flex-shrink:0; border-bottom:2px solid transparent; }
  .douanes-tab.active { border-bottom:2px solid var(--accent); background:var(--bg3); }
  .douanes-tab svg { display:none; } /* masquer icônes sur mobile pour gagner de l'espace */
  .douanes-panel > div { padding:12px 0 !important; }
  /* Tableaux scrollables horizontalement */
  .drm-section .tbl, .drm-section table { min-width:500px; }
  .drm-section { overflow-x:auto; -webkit-overflow-scrolling:touch; padding:12px; }
  /* DAI table */
  #dtab-dai .tbl-wrapper { overflow-x:auto; }
  #dtab-dai .tbl { min-width:600px; }
  /* Récolte table */
  #dtab-recolte .card { overflow-x:auto; }
  #dtab-recolte table { min-width:550px; }
  /* Comptabilité matière */
  #dtab-matiere .tbl { min-width:580px; }
  .drm-kpis { grid-template-columns:repeat(2,1fr); gap:8px; }
  .drm-kpi { padding:10px; }
  .drm-kpi-val { font-size:18px; }
  .drm-header { flex-direction:column; align-items:stretch; }
  .drm-header > div:last-child { display:flex; gap:6px; flex-wrap:wrap; }
  .drm-header button { flex:1; justify-content:center; }
}

/* ── NOTIFICATIONS ───────────────────────────────────────────────────────── */
.notif-filter { display:inline-flex; align-items:center; gap:4px; padding:5px 11px; border-radius:16px; border:1px solid var(--border2); background:transparent; color:var(--muted); font-size:11px; font-weight:600; cursor:pointer; transition:all .15s; }
.notif-filter:hover { border-color:var(--accent); color:var(--text); }
.notif-filter.active { background:var(--accent); color:var(--bg); border-color:var(--accent); }
.notif-item { display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.notif-item:last-child { border-bottom:none; }
.notif-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; }
.notif-body { flex:1; min-width:0; }
.notif-title { font-size:13px; font-weight:700; color:var(--text); line-height:1.3; }
.notif-desc  { font-size:12px; color:var(--muted); margin-top:3px; line-height:1.4; }
.notif-action { font-size:11px; color:var(--accent); cursor:pointer; margin-top:5px; display:inline-block; text-decoration:underline; }
.notif-age { font-size:10px; color:var(--muted2); white-space:nowrap; flex-shrink:0; margin-top:2px; }

#drm-month-display {
  border-radius: 6px;
  border: 1px solid #333333;
  padding: 11px;
  background: #141212;
}

/* ── SOUS-MENU NAV DESKTOP "Menu" ────────────────────────────────────────── */
.nav-more { position:relative; display:inline-block; }
.nav-more-dropdown {
  position:absolute; top:100%; left:0;
  background:var(--bg2); border:1px solid var(--border);
  border-radius:8px; padding:6px; min-width:200px;
  box-shadow:0 10px 30px rgba(0,0,0,.6);
  z-index:200; display:none; flex-direction:column; gap:2px;
  /* pont invisible pour ne pas perdre le hover entre bouton et menu */
  margin-top:0;
}
/* Pont invisible de 8px entre le bouton et le dropdown */
.nav-more::after {
  content:''; position:absolute; top:100%; left:0;
  width:100%; height:8px; background:transparent;
}
.nav-more:hover .nav-more-dropdown,
.nav-more-dropdown:hover,
.nav-more-dropdown.show { display:flex; }
.nav-more-item {
  display:flex; align-items:center; gap:8px;
  padding:9px 12px; border-radius:6px; border:none;
  background:transparent; color:var(--muted); font-size:12px;
  font-weight:600; cursor:pointer; text-align:left; width:100%;
  text-transform:uppercase; letter-spacing:.04em;
  transition:background .12s, color .12s;
}
.nav-more-item:hover { background:var(--bg3); color:var(--text); }
.nav-more-item.active { color:#dfdbd5; background:#6d5f3d; }

/* ── TITRE MOBILE HEADER ─────────────────────────────────────────────────── */
.mobile-brand-title { display:none; font-size:15px; font-weight:700; color:var(--text); letter-spacing:.5px; }

/* ── STOCK TOOLBAR MOBILE ────────────────────────────────────────────────── */
.stock-toolbar { display:flex; flex-direction:column; gap:8px; }
.stock-search-row { display:flex; gap:8px; width:100%; }
.stock-actions-row { display:flex; align-items:center; gap:8px; width:100%; }

@media(max-width:768px) {
  .mobile-brand-title { display:inline; }
  .stock-search-row { flex:1; }
  .stock-actions-row { flex-wrap:nowrap; }
  .clients-toolbar { flex-direction:column; align-items:stretch !important; }
  .clients-toolbar > div:first-child { min-width:0 !important; width:100%; }
  .clients-toolbar input { width:100%; }
}

/* ── MODALE PESÉE (NUMPAD) MOBILE — réduire de 20% ─────────────────────── */
@media(max-width:768px) {
  #m-numpad .modal { max-width:305px !important; padding:14px !important; }
  #m-numpad .numpad-grid button { height:48px; font-size:18px; }
  #m-numpad .numpad-display { font-size:28px; padding:10px; }
  #m-numpad .modal-title { font-size:13px; margin-bottom:6px !important; }
}

#auth-screen {
  background: url('/bg-login.jpg') center/cover no-repeat, linear-gradient(135deg,rgba(20,18,18,.9) 0%,rgba(20,18,18,.7) 100%);
  background-blend-mode: overlay;
}
@media(max-width:768px) {
  .stock-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    padding: 10px 0 8px;
    margin: -4px 0 0;
  }
  /* Masquer le filtre type sur mobile */
  #q-type { display: none !important; }
  #q-millesime { max-width: 100% !important; flex:1; }
}

/* ── MILLÉSIMES GRID MOBILE ──────────────────────────────────────────────── */
@media(max-width:768px) {
  #millesimes-grid { padding: 16px 0 !important; }
}

/* ── PRICING / ABONNEMENTS ───────────────────────────────────────────────── */
.pricing-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; max-width:960px; margin:0 auto; }
.pricing-card { background:var(--bg2); border:1px solid var(--border2); border-radius:12px; overflow:hidden; display:flex; flex-direction:column; position:relative; transition:transform .15s,box-shadow .15s; }
.pricing-card:hover { transform:translateY(-3px); box-shadow:0 12px 32px rgba(0,0,0,.4); }
.pricing-featured { border-color:#c9a96e; box-shadow:0 0 0 1px #c9a96e40; }
.pricing-current  { border-color:#6d5f3d; }
.pricing-badge-top { background:#c9a96e; color:#1a1714; font-size:11px; font-weight:700; text-align:center; padding:5px; letter-spacing:.08em; text-transform:uppercase; }
.pricing-header { padding:24px 24px 16px; border-bottom:1px solid var(--border2); }
.pricing-name   { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; margin-bottom:8px; }
.pricing-price  { margin:6px 0; }
.pricing-features { padding:20px 24px; flex:1; display:flex; flex-direction:column; gap:8px; }
.pricing-feature { display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--muted); line-height:1.4; }
.pricing-feature-inherit { color:var(--text); font-weight:600; }
.pricing-footer { padding:16px 24px 20px; }
@media(max-width:768px) {
  .pricing-grid { grid-template-columns:1fr; }
  .pricing-card { min-width:0; }
}

/* Modale upgrade */
.upgrade-modal { text-align:center; padding:8px 0; }
.upgrade-modal h2 { font-size:18px; font-weight:700; margin-bottom:8px; }
.upgrade-modal p  { font-size:13px; color:var(--muted); margin-bottom:16px; }

/* ── AUTH / INSCRIPTION ──────────────────────────────────────────────────── */
.auth-container { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; position:relative; z-index:1; }
.auth-view { display:none; width:100%; justify-content:center; position:relative; z-index:2; }
.auth-view.active { display:flex; }
.auth-card { background:rgba(25,22,22,.88); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:32px; width:100%; max-width:420px; }
.auth-logo { text-align:center; margin-bottom:20px; }
.auth-title { font-size:20px; font-weight:700; color:var(--text); text-align:center; margin:0 0 20px; }
.auth-btn { width:100%; padding:13px; background:#6d5f3d; color:#dfdbd5; border:none; border-radius:8px; font-size:14px; font-weight:700; cursor:pointer; margin-top:8px; transition:background .15s; }
.auth-btn:hover { background:#7d6f4d; }
.auth-err { color:var(--red); font-size:12px; margin-top:10px; text-align:center; min-height:16px; }
.auth-switch { text-align:center; font-size:13px; color:var(--muted); margin-top:16px; }
.auth-switch a { color:var(--accent); text-decoration:none; font-weight:600; }

/* Steps */
.auth-steps { display:flex; align-items:center; justify-content:center; gap:0; margin-bottom:20px; }
.auth-step { width:28px; height:28px; border-radius:50%; background:var(--bg3); border:2px solid var(--border2); color:var(--muted); font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.auth-step.active { background:#6d5f3d; border-color:#6d5f3d; color:#dfdbd5; }
.auth-step.done { background:var(--green); border-color:var(--green); color:#000; }
.auth-step-line { width:40px; height:2px; background:var(--border2); }
.auth-step-line.active { background:#6d5f3d; }

/* Plans signup */
.signup-plans { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.signup-plan-card { background:var(--bg); border:2px solid var(--border2); border-radius:10px; padding:18px; cursor:pointer; transition:border-color .15s,transform .1s; position:relative; }
.signup-plan-card:hover { border-color:#6d5f3d; transform:translateY(-2px); }
.signup-plan-card.selected { border-color:#6d5f3d; background:rgba(109,95,61,.08); }
.signup-plan-badge { position:absolute; top:-10px; left:50%; transform:translateX(-50%); background:#6d5f3d; color:#dfdbd5; font-size:10px; font-weight:700; padding:3px 10px; border-radius:10px; white-space:nowrap; }
.signup-plan-name { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; margin-bottom:6px; }
.signup-plan-price { font-size:22px; font-weight:700; color:var(--text); margin-bottom:4px; }
.signup-plan-desc { font-size:11px; color:var(--muted); margin-bottom:12px; }
.signup-plan-features { list-style:none; padding:0; margin:0; font-size:11px; color:var(--muted); line-height:2; }
.signup-plan-features li { color:var(--text); }

@media(max-width:768px) {
  .signup-plans { grid-template-columns:1fr; }
  .auth-card { padding:20px; }
}
