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

:root {
  color-scheme: dark;
  --red: #C41E3A;
  --red-dark: #a01830;
  --red-light: rgba(196,30,58,0.12);
  --red-glow: rgba(196,30,58,0.45);
  --sidebar-bg: rgba(20,15,17,0.55);
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-text: rgba(255,255,255,0.55);
  --sidebar-text-active: #ffffff;
  --sidebar-active-bg: rgba(196,30,58,0.14);
  --bg: #0c0a0b;
  --bg-white: #151112;
  --bg-card: rgba(255,255,255,0.035);
  --header-bg: rgba(12,10,11,0.7);
  --text: #f5f3f4;
  --text-muted: #8a8589;
  --border: rgba(255,255,255,0.08);
  --border-focus: #C41E3A;
  --input-bg: rgba(0,0,0,0.35);
  --shadow: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 12px 30px -10px rgba(196,30,58,0.25), 0 2px 8px rgba(0,0,0,0.5);
  --radius: 22px;
  --radius-sm: 12px;
  --destructive: #ef4868;
  --modal-bg: #1e1a1c;
  --input-focus-bg: rgba(0,0,0,0.45);
  --neu-bg: #0c0a0b;
  --neu-shadow-dark: rgba(0,0,0,0.55);
  --neu-shadow-light: rgba(255,255,255,0.045);
  --title-gradient: linear-gradient(90deg, #ffffff, #b8b3b6);
}

html[data-theme="light"] {
  color-scheme: light;
  --red: #C41E3A;
  --red-dark: #a01830;
  --red-light: rgba(196,30,58,0.08);
  --red-glow: rgba(196,30,58,0.25);
  --sidebar-bg: rgba(255,255,255,0.75);
  --sidebar-border: rgba(0,0,0,0.08);
  --sidebar-text: rgba(20,15,17,0.55);
  --sidebar-text-active: #14100f;
  --sidebar-active-bg: rgba(196,30,58,0.09);
  --bg: #ffffff;
  --bg-white: #ffffff;
  --bg-card: rgba(0,0,0,0.025);
  --header-bg: rgba(255,255,255,0.75);
  --text: #1a1516;
  --text-muted: #78716c;
  --border: rgba(0,0,0,0.1);
  --border-focus: #C41E3A;
  --input-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 12px 30px -10px rgba(196,30,58,0.15), 0 2px 8px rgba(0,0,0,0.08);
  --modal-bg: #ffffff;
  --input-focus-bg: #ffffff;
  --neu-bg: #ffffff;
  --neu-shadow-dark: rgba(0,0,0,0.16);
  --neu-shadow-light: rgba(255,255,255,0.9);
  --title-gradient: linear-gradient(90deg, #1a1516, #57504f);
}

body,

html { height: 100%; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='1' cy='1' r='0.8' fill='rgba(255,255,255,0.07)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  background-size: 20px 20px;
  -webkit-font-smoothing: antialiased;
}
/* Deux orbes de couleur en fond, animées en "respiration" (scale) plutôt qu'en background-size :
   un dégradé animé via background-size se met à se répéter en tuiles sur certains navigateurs mobiles
   (background-attachment: fixed + background-size mal supportés ensemble sur iOS). Un vrai élément
   positionné en fixed + transform: scale() n'a pas ce problème, quelle que soit la hauteur de la page. */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  will-change: transform, opacity;
}
body::before {
  top: -220px; right: -160px;
  width: 620px; height: 480px;
  background: rgba(196,30,58,0.22);
  filter: blur(90px);
  animation: orb-breathe 16s ease-in-out infinite;
}
body::after {
  bottom: -200px; left: -180px;
  width: 520px; height: 420px;
  background: rgba(99,102,241,0.18);
  filter: blur(90px);
  animation: orb-breathe 16s ease-in-out infinite -8s;
}
html[data-theme="light"] body::before { background: rgba(196,30,58,0.08); }
html[data-theme="light"] body::after { background: rgba(99,102,241,0.06); }
@keyframes orb-breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.35); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

header {
  height: 48px;
  height: calc(48px + env(safe-area-inset-top));
  background: var(--header-bg);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
  backdrop-filter: blur(16px) saturate(140%);
}

.logo-mark {
  width: 28px; height: 28px;
  background: var(--red);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  letter-spacing: -0.5px; flex-shrink: 0;
  box-shadow: 0 6px 18px -4px var(--red-glow), 0 0 0 1px rgba(196,30,58,0.3) inset;
}

.logo-text {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--text);
}

.header-sep { color: var(--border); margin: 0 4px; }
.header-page { font-size: 12px; color: var(--text-muted); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync-indicator { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:5px 10px; border-radius:20px; white-space:nowrap; }
.trial-banner { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:5px 10px; border-radius:20px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; cursor:pointer; transition:all 0.15s; }
.trial-banner.trial-normal { background: rgba(196,30,58,0.12); color: var(--red); border: 1px solid rgba(196,30,58,0.3); }
.trial-banner.trial-soon { background: rgba(196,30,58,0.2); color:#f87171; }
.trial-banner.trial-locked { background: rgba(220,38,38,0.3); color:#f87171; }
.trial-banner:hover { filter: brightness(1.15); }
.sync-indicator.offline { background: rgba(220,38,38,0.15); color:#f87171; }

/* Calculatrice flottante */
#calc-fab {
  position: fixed; bottom: 76px; right: 18px; z-index: 500;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -4px rgba(196,30,58,0.5);
  transition: transform 0.15s;
}
#calc-fab:active { transform: scale(0.92); }
@media (min-width: 769px) { #calc-fab { bottom: 24px; right: 24px; } }

#calc-popup {
  position: fixed; z-index: 501; width: 300px;
  background: var(--neu-bg); border-radius: 18px;
  box-shadow: 10px 10px 26px var(--neu-shadow-dark), -10px -10px 26px var(--neu-shadow-light);
  overflow: hidden; display: none;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}
#calc-popup.open { display: block; }
#calc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: grab; background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border); user-select: none;
}
#calc-header:active { cursor: grabbing; }
#calc-header span { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.03em; text-transform: uppercase; }
#calc-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 4px; }
#calc-display {
  padding: 20px 20px 6px; text-align: right;
  font-size: 42px; font-weight: 500; color: var(--text);
  overflow-x: auto; white-space: nowrap;
}
#calc-display-sub { text-align: right; padding: 0 20px; font-size: 12px; color: var(--text-muted); height: 16px; }
#calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 16px 18px; }
.calc-btn {
  border: none; border-radius: 50%; aspect-ratio: 1; width: 100%;
  font-size: 19px; font-weight: 500;
  cursor: pointer; background: rgba(255,255,255,0.1); color: var(--text);
  transition: filter 0.1s; display: flex; align-items: center; justify-content: center;
}
.calc-btn:active { filter: brightness(1.35); }
.calc-btn.fn { background: rgba(255,255,255,0.2); color: var(--text); }
.calc-btn.op { background: var(--red); color: #fff; font-size: 22px; }
.calc-btn.zero { grid-column: span 2; border-radius: 999px; justify-content: flex-start; padding-left: 22px; aspect-ratio: auto; }

/* Onglets de la calculatrice */
#calc-tabs { display: flex; gap: 6px; padding: 10px 14px 0; }
.calc-tab { flex: 1; border: none; border-radius: 10px; padding: 8px 0; font-size: 12px; font-weight: 700; cursor: pointer; background: rgba(255,255,255,0.06); color: var(--text-muted); font-family: inherit; }
.calc-tab.active { background: var(--red); color: #fff; }

/* Outils toiture */
#calc-view-roof { display: none; padding: 16px; max-height: 70vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(196,30,58,0.5) transparent; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
#calc-view-roof::-webkit-scrollbar { width: 6px; }
#calc-view-roof::-webkit-scrollbar-track { background: transparent; }
#calc-view-roof::-webkit-scrollbar-thumb { background: rgba(196,30,58,0.5); border-radius: 10px; }
#calc-view-roof::-webkit-scrollbar-thumb:hover { background: rgba(196,30,58,0.8); }
.roof-tool { background: rgba(255,255,255,0.04); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.roof-tool-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 10px; }
.roof-field { margin-bottom: 8px; }
.roof-field label { display: block; font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px; }
.roof-field input { width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--text); font-family: inherit; -moz-appearance: textfield; }
.roof-field input::-webkit-outer-spin-button, .roof-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.roof-result { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.8; }
.roof-result strong { color: var(--red); }

/* Interrupteur clair/sombre (Uiverse.io by satyamchaudharydev, adapté) */
.theme-switch {
  display: block;
  --width-of-switch: 3em;
  --height-of-switch: 1.7em;
  --size-of-icon: 1.2em;
  --slider-offset: 0.25em;
  position: relative;
  width: var(--width-of-switch);
  height: var(--height-of-switch);
  flex-shrink: 0;
  cursor: pointer;
}
.theme-switch input { opacity: 0; width: 0; height: 0; }
.theme-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #f4f4f5;
  transition: .4s;
  border-radius: 30px;
}
.theme-switch-slider:before {
  position: absolute;
  content: "";
  height: var(--size-of-icon);
  width: var(--size-of-icon);
  border-radius: 20px;
  left: var(--slider-offset);
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(40deg,#ff0080,#ff8c00 70%);
  transition: .4s;
}
.theme-switch input:checked + .theme-switch-slider { background-color: #303136; }
.theme-switch input:checked + .theme-switch-slider:before {
  left: calc(100% - (var(--size-of-icon) + var(--slider-offset)));
  background: #303136;
  box-shadow: inset -3px -2px 5px -2px #8983f7, inset -10px -4px 0 0 #a3dafb;
}
.sync-indicator.pending { background: rgba(234,179,8,0.15); color:#facc15; }
.sync-dot { width:7px; height:7px; border-radius:50%; background:currentColor; flex-shrink:0; }
.sync-indicator.pending .sync-dot { animation: sync-pulse 1s ease-in-out infinite; }
@keyframes sync-pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

@media (min-width: 769px) { header { display: none; } }

.app-body { display: flex; flex: 1; min-height: 0; height: 100vh; height: 100dvh; }
@media (min-width: 769px) { .app-body { height: 100vh; height: 100dvh; } }

.sidebar {
  width: 252px; flex-shrink: 0;
  background: transparent;
  border-right: none;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  padding: 12px;
}
.sidebar::before {
  content: '';
}
.sidebar {
  background: var(--neu-bg);
  border: none;
  border-radius: 26px;
  margin: 12px;
  box-shadow: 12px 12px 24px var(--neu-shadow-dark), -12px -12px 24px var(--neu-shadow-light);
  height: calc(100vh - 24px); height: calc(100dvh - 24px);
  overflow: visible;
}

.sidebar-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: rgba(255,255,255,0.28);
  padding: 8px 12px 8px;
}

.sidebar > .sidebar-label:first-of-type { margin-top: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 13px;
  font-size: 13px; font-weight: 500;
  color: var(--sidebar-text);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit;
  transition: all 0.15s; margin-bottom: 2px;
  position: relative;
}

.nav-item:hover { color: var(--sidebar-text-active); background: rgba(255,255,255,0.05); }

.nav-item.active {
  color: var(--sidebar-text-active);
  background: rgba(196,30,58,0.13);
  border: 1px solid rgba(196,30,58,0.28);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(196,30,58,0.06);
}
.nav-item.active::after {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  margin-left: auto;
  flex-shrink: 0;
}
.nav-item.active .nav-badge,
.nav-item.active .admin-badge { margin-left: 6px; }

.nav-item.active .nav-icon { color: var(--red); opacity: 1; }

.nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.75; }

.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: var(--red); color: #fff;
  border-radius: 10px; padding: 1px 6px; min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 8px -2px var(--red-glow);
}

.sidebar-footer {
  margin-top: auto; padding: 10px 6px 4px;
  font-size: 11px; color: rgba(255,255,255,0.2);
}

.sidebar { padding-top: 14px; }

.content { flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.page { display: none; max-width: 1080px; margin: 0 auto; padding: 30px 28px 60px; }
.page.active { display: block; animation: fadeUp 0.35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-title {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px;
  background: var(--title-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

.section { margin-bottom: 24px; }
.section-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.20em;
  color: var(--text-muted); margin-bottom: 12px;
}

.card {
  background: var(--neu-bg);
  border: none;
  border-radius: var(--radius);
  box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light);
  padding: 20px 22px;
  margin-bottom: 10px;
}

input[type="text"], input[type="number"], input[type="password"], input[type="date"], input[type="tel"], select, textarea {
  box-sizing: border-box;
  font-family: inherit; font-size: 13px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 13px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus,
input[type="date"]:focus, input[type="tel"]:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(196,30,58,0.18);
  background: var(--input-focus-bg);
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a8589' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px; cursor: pointer;
}

input[type="color"] {
  width: 40px; height: 34px; padding: 2px 3px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); cursor: pointer; outline: none;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, transform 180ms ease, box-shadow 0.15s;
  box-shadow: 0 8px 24px -8px var(--red-glow), 0 0 0 1px rgba(196,30,58,0.25) inset;
}
.btn-primary:hover { transform: scale(1.06); }
.btn-primary:active { transform: scale(1.02); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.04); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.07); }
.btn-secondary.active-toggle { background: rgba(217,119,6,0.18); border-color: #d97706; color: #d97706; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 12px; font-weight: 500;
  background: none; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.04); }

.btn-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.btn-icon:hover { color: var(--destructive); background: rgba(239,68,104,0.10); }

.toggle-group {
  display: inline-flex;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.toggle-group::-webkit-scrollbar { display: none; }

.toggle-btn {
  padding: 6px 14px; font-size: 13px; font-weight: 500;
  background: none; color: var(--text-muted);
  border: none; border-radius: 9px;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s; white-space: nowrap;
}
.toggle-btn:hover:not(.active) { color: var(--text); }
.toggle-btn.active {
  background: rgba(255,255,255,0.08); color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-btn.active.red { background: var(--red); color: #fff; }

.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.form-label { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.08em; }
.form-group { display: flex; flex-direction: column; }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-red { background: var(--red); color: #fff; }
.badge-gray { background: var(--input-bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-green { background: rgba(34,197,94,0.15); color: #4ade80; }

.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px;
}

.pliages-table { width: 100%; border-collapse: collapse; }
.pliages-table th {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.10em; color: var(--text-muted);
  padding: 5px 12px 10px; text-align: left;
}
.pliages-table td { padding: 6px 6px; }
.pliages-table td:first-child { padding-left: 0; }
.pliages-table td:last-child { padding-right: 0; width: 36px; }

.pliage-color-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.btn-add-row {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 0; font-size: 13px; font-weight: 600;
  color: var(--red); background: none; border: none;
  cursor: pointer; font-family: inherit; transition: opacity 0.15s;
  margin-top: 6px;
}
.btn-add-row:hover { opacity: 0.75; }

.calc-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0; border-top: 1px solid var(--border);
  margin-top: 8px;
}

.results-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.results-title { font-size: 16px; font-weight: 700; }
.results-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta-pill {
  display: inline-flex; align-items: center; gap-5px;
  font-size: 12px; color: var(--text-muted);
}
.meta-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }

.results-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}

.result-panel { }
.result-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.result-panel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
.result-panel-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.result-card {
  background: var(--neu-bg); border: none;
  border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 8px; box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light);
}
.result-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.result-card-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.result-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.cut-bar {
  height: 8px; border-radius: 4px; overflow: hidden;
  display: flex; margin: 10px 0; background: var(--input-bg);
}
.cut-bar-seg { height: 100%; transition: width 0.3s; }
.cut-bar-chute { height: 100%; background: rgba(255,255,255,0.05); border-left: 1px dashed var(--border); flex: 1; }

.cut-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; padding: 3px 0; border-bottom: 1px solid var(--border);
}
.cut-row:last-child { border-bottom: none; }
.cut-row-label { color: var(--text-muted); }
.cut-row-val { font-weight: 500; font-variant-numeric: tabular-nums; }
.cut-row-chute { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.result-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 0; font-size: 12px;
  border-top: 1px solid var(--border); margin-top: 4px;
}
.result-total-label { color: var(--text-muted); }
.result-total-val { font-weight: 700; font-size: 13px; }

.savings-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(34,197,94,0.15); color: #4ade80;
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; font-weight: 600;
}

.ral-option-row { display: flex; align-items: center; gap: 8px; }
.ral-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); flex-shrink: 0; }

.dev-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.dev-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,0.04); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 20px;
  cursor: default;
}
.dev-tab-arrow { color: var(--text-muted); }
.dev-tab-val { font-weight: 700; color: var(--red); }

.dev-add-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}

.dev-card {
  background: var(--neu-bg); border: none;
  border-radius: var(--radius); box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light);
  margin-bottom: 12px; overflow: hidden;
}
.dev-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.dev-card-title { font-size: 13px; font-weight: 600; }
.dev-card-type { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.dev-card-body { display: flex; align-items: flex-start; gap: 24px; padding: 18px 20px; }
.dev-svg-wrap { flex-shrink: 0; padding-top: 20px; }

.dev-fields-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.10em; color: var(--text-muted); margin-bottom: 12px;
}
.dev-fields-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.dev-field { display: flex; flex-direction: column; gap: 4px; }
.dev-field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
}
.dev-field-badge {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dev-field input { font-variant-numeric: tabular-nums; }

.dev-angle-row {
  display: flex; align-items: center; gap: 8px;
  padding-top: 10px; margin-top: 10px;
  border-top: 1px solid var(--border);
}
.dev-angle-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.dev-total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.dev-total-label { font-size: 12px; color: var(--text-muted); }
.dev-total-val { font-size: 18px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }

.dev-send-bar {
  display: flex; justify-content: flex-end; padding: 20px 0 0;
  border-top: 1px solid var(--border); margin-top: 8px;
}

.saves-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.saves-counter { font-size: 13px; color: var(--text-muted); }
.saves-counter strong { color: var(--text); }

.save-card {
  background: var(--neu-bg); border: none;
  border-radius: var(--radius-sm); box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light);
  padding: 14px 18px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all 0.15s;
}
.save-card:hover { box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light), inset 0 0 0 1.5px rgba(196,30,58,0.5); transform: translateY(-1px); }
.save-ral-swatch {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.15); flex-shrink: 0;
}
.save-card-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.save-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-muted); flex-wrap: wrap;
}
.save-meta-sep { color: var(--border); }
.save-card-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.save-card-date { font-size: 12px; color: var(--text-muted); }

.config-section { margin-bottom: 28px; }
.config-section-title {
  font-size: 12px; font-weight: 700; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.10em; color: var(--text-muted);
}

.config-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; background: var(--neu-bg);
  border: none; border-radius: var(--radius-sm);
  box-shadow: 5px 5px 12px var(--neu-shadow-dark), -5px -5px 12px var(--neu-shadow-light);
  margin-bottom: 6px;
}
.config-item-color { width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); flex-shrink: 0; }
.config-item-name { font-size: 13px; font-weight: 600; }
.config-item-sub { font-size: 11px; color: var(--text-muted); }
.config-item-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.config-item-hex { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; font-family: monospace; }
.badge-default { font-size: 10px; font-weight: 500; padding: 2px 7px; background: var(--input-bg); color: var(--text-muted); border: 1px solid var(--border); border-radius: 10px; }

.config-add-card {
  background: rgba(255,255,255,0.02); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-top: 8px;
}
.config-add-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.10em; color: var(--text-muted); margin-bottom: 12px; }
.config-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.config-add-grid-3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.config-add-footer { display: flex; justify-content: flex-end; }

.btn-actualiser {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px; font-size: 14px; font-weight: 600;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; transition: background 0.15s;
  margin-top: 8px;
  box-shadow: 0 8px 24px -8px var(--red-glow);
}
.btn-actualiser:hover { background: var(--red-dark); filter: brightness(1.08); }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,18,19,0.9); color: var(--text);
  font-size: 13px; font-weight: 500;
  padding: 11px 18px; border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

.empty-state {
  padding: 48px 24px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state p { font-size: 13px; color: var(--text-muted); }

.print-header { display: none; margin-bottom: 1.5rem; }
.print-header h1 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.print-header p { font-size: 12px; color: #666; }

@media print {
  .no-print { display: none !important; }
  * { visibility: hidden; }
  #print-header, #print-header *,
  #panel-per-dev, #panel-per-dev *,
  #panel-optimized, #panel-optimized * { visibility: visible; }
  body { margin: 0; padding: 0; background: #fff !important; color: #000 !important; }
  #page-calc { display: block !important; }
  .content { overflow: visible !important; height: auto !important; flex: none !important; }
  #print-header { padding: 1rem 1.5rem 0.75rem; border-bottom: 1px solid #ccc; background: #fff; }
  #panel-per-dev, #panel-optimized { margin: 0 1.5rem; }
  .result-card { background: #f8f8f8 !important; border: 1px solid #ccc !important; break-inside: avoid; margin-bottom: 10px; padding: 12px 14px; }
  .badge-red { background: #C41E3A !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cut-bar-seg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .savings-pill { background: #dcfce7 !important; color: #15803d !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 768px) {
  .save-card-meta { font-size: 11px; gap: 6px; }
  .save-card { padding: 12px 14px; gap: 10px; }
  .save-card-right { flex-direction: column; align-items: flex-end; gap: 4px; }
  .stock-add-grid { grid-template-columns: 1fr !important; }
  .results-btns-desktop { display: none !important; }
  .results-btns-mobile { display: block !important; margin-top: 20px; }
  .results-actions {
    order: 99;
    margin-top: 20px;
    flex-direction: column;
    gap: 8px;
  }
  .results-actions .btn-ghost {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
  .app-body { flex-direction: column; height: auto; min-height: 100vh; min-height: 100dvh; }
  .sidebar {
    width: auto !important; height: 60px !important; max-height: 60px !important;
    position: fixed !important; bottom: 0; left: 50%; top: auto !important;
    transform: translateX(-50%);
    border: 1px solid var(--sidebar-border) !important;
    border-radius: 999px !important;
    flex-direction: row !important; padding: 6px !important; z-index: 200;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    max-width: calc(100% - 24px);
    background: var(--sidebar-bg) !important;
    backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.35);
    margin: 0 !important;
  }
  .sidebar-brand { display: none !important; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-label, .sidebar-footer { display: none; }
  .nav-item {
    flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 9px 8px 9px; font-size: 9px;
    border-radius: 999px; margin-bottom: 0;
    flex: 0 0 auto; width: 64px;
    white-space: nowrap; overflow: hidden;
  }
  .nav-item span { display: none; }
  .nav-item.active { border: none; background: rgba(196,30,58,0.22); }
  .nav-item.active::after { display: none; }
  .nav-icon { width: 20px; height: 20px; opacity: 0.85; }
  .nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); margin-left: 0; }
  .nav-new-dot { position: absolute; top: 6px; right: calc(50% - 20px); }
  .content { padding-bottom: 90px; }
  .page { padding: 20px 16px 40px; }
  .results-grid { grid-template-columns: 1fr; }
  .dev-fields-grid { grid-template-columns: 1fr 1fr; }
  .dev-card-body { flex-direction: column; }
  .config-add-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; align-items: flex-start; }
  .page-header-row { flex-direction: column; gap: 12px; }
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .dashboard-shortcuts-row { flex-direction: column; align-items: stretch; }
  #dashboard-shortcuts { flex-direction: column; }
  #dashboard-shortcuts button { width: 100%; justify-content: center; }
}

@media print {
  body.printing-dev * { visibility: hidden; }
  body.printing-dev #print-dev-zone,
  body.printing-dev #print-dev-zone * { visibility: visible; }
  body.printing-dev #print-dev-zone {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    padding: 20px 28px; background: #fff; overflow: auto;
    z-index: 9999;
  }
}

.login-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  z-index: 9999;
}
.landing-wrap2 {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100%;
}
@media (max-width: 860px) {
  .landing-wrap2 { grid-template-columns: 1fr; }
}

/* Colonne connexion (sidebar sombre) */
.login-sidebar {
  flex: 0 0 380px;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  min-height: 100vh; min-height: 100dvh;
}
.login-sidebar-inner { padding: 40px 32px; width: 100%; display: flex; flex-direction: column; }
.login-logo2 { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.login-logo2-mark { box-shadow: 0 8px 24px -6px rgba(0,0,0,0.3); }
.login-logo2-text { font-size: 14px; font-weight: 800; letter-spacing: 0.03em; color: var(--text); }
.login-title2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.login-subtitle2 { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.login-field2 { margin-bottom: 16px; }
.login-field2 label { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 7px; }
.login-field2 input { width: 100%; padding: 11px 13px; font-size: 15px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,0.03); color: var(--text); font-family: inherit; outline: none; transition: border-color 0.15s; }
.login-field2 input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,30,58,0.18); }
.login-pwd-wrap { position: relative; }
.login-pwd-wrap input { padding-right: 40px; }
.login-pwd-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; display: flex; }
.login-pwd-toggle:hover { color: var(--text); }
.login-error { font-size: 12px; color: var(--red); margin-bottom: 10px; min-height: 16px; }
.btn-login2 { width: 100%; padding: 13px; font-size: 14px; font-weight: 700; background: var(--red); color: #fff; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; transition: all 0.15s; margin-top: 4px; box-shadow: 0 8px 24px -8px var(--red-glow); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-login2:hover { background: var(--red-dark); filter: brightness(1.08); }
.btn-login2:disabled { opacity: 0.5; cursor: not-allowed; }
.login-links-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12px; }
.login-forgot-link2, .login-demo-link { color: var(--text-muted); cursor: pointer; transition: color 0.15s; }
.login-forgot-link2:hover, .login-demo-link:hover { color: var(--red); text-decoration: underline; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-secondary2 { width: 100%; padding: 12px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,0.03); color: var(--text); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-secondary2:hover { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); }
.login-sidebar-footer { margin-top: auto; padding-top: 32px; font-size: 11px; color: var(--text-muted); line-height: 1.8; }

/* Colonne marketing */
.landing-marketing2 { min-width: 0; padding: 56px 48px; display: flex; justify-content: center; }
.landing-marketing2-inner { width: 100%; max-width: 720px; margin: 0 auto; }
.landing-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--red); background: rgba(196,30,58,0.12); border: 1px solid rgba(196,30,58,0.3); padding: 6px 14px; border-radius: 20px; margin-bottom: 22px; }
.landing-hero2 { font-size: 34px; font-weight: 800; line-height: 1.25; margin-bottom: 18px; letter-spacing: -0.01em; }
.landing-hero2 .accent { color: var(--red); }
.hero-arrow { font-weight: 400; opacity: 0.85; }
.landing-hero2-desc { font-size: 14.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 44px; max-width: 560px; }
.landing-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 16px; }
.landing-features2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 44px; }
.landing-feature2 { background: var(--neu-bg); border: none; border-radius: 20px; padding: 20px; box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light); }
.landing-feature2-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(196,30,58,0.14); display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 14px; }
.landing-feature2-title { font-size: 14.5px; font-weight: 700; margin-bottom: 7px; }
.landing-feature2 p { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.landing-pricing2 { display: flex; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.pricing-card2 { flex: 1; min-width: 220px; border: none; border-radius: 20px; padding: 22px; position: relative; background: var(--neu-bg); box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light); }
.pricing-card2-highlight { box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light), inset 0 0 0 1.5px var(--red); }
.pricing-card2-badge { position: absolute; top: -10px; right: 16px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pricing-card2-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.pricing-card2-amount { font-size: 30px; font-weight: 800; }
.pricing-card2-amount span { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.pricing-card2-sub { font-size: 11.5px; color: var(--text-muted); margin: 6px 0 16px; }
.pricing-card2-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.pricing-card2-list li { font-size: 12.5px; color: var(--text); }
.pricing-card2 .btn-login2, .pricing-card2 .btn-secondary2 { margin-top: 0; }
.landing-trial-bar { display: flex; align-items: flex-start; gap: 12px; background: var(--neu-bg); border: none; border-radius: 18px; padding: 16px 18px; box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light); }
.landing-trial-bar-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.landing-trial-bar p { font-size: 12.5px; color: var(--text-muted); line-height: 1.65; margin: 0; }
.landing-trial-bar strong { color: var(--text); }

@media (max-width: 860px) {
  .login-sidebar { flex: 1 1 100%; min-height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .landing-marketing2 { padding: 40px 20px; }
  .landing-hero2 { font-size: 27px; }
  .landing-features2 { grid-template-columns: 1fr; }
}


.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 16px;
  cursor: pointer; transition: background 0.15s;
  border: 1px solid var(--sidebar-border);
  background: rgba(0,0,0,0.25);
  margin: 0 4px 8px;
}
.user-pill:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(160deg, #3a3438, #191617);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
}
.user-name { font-size: 12px; font-weight: 600; color: var(--sidebar-text-active); flex: 1; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.06em; }

.profile-section { background: var(--neu-bg); border: none; border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: 8px 8px 18px var(--neu-shadow-dark), -8px -8px 18px var(--neu-shadow-light); }

/* Accordéon de la page Info */
.info-chapter { background: var(--neu-bg); border-radius: 16px; box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light); margin-bottom: 10px; transition: box-shadow 0.3s ease, margin 0.35s ease; overflow: hidden; }
.info-chapter.open { box-shadow: 8px 8px 20px var(--neu-shadow-dark), -8px -8px 20px var(--neu-shadow-light), inset 0 0 0 1.5px var(--red); margin-bottom: 18px; margin-top: 6px; }
.info-chapter-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; cursor: pointer; user-select: none; gap: 10px; }
.info-chapter-title { font-size: 14.5px; font-weight: 700; }
.info-chapter-chevron { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1); }
.info-chapter.open .info-chapter-chevron { transform: rotate(180deg); color: var(--red); }
.info-chapter-body-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.38s cubic-bezier(0.4,0,0.2,1); }
.info-chapter.open .info-chapter-body-wrap { grid-template-rows: 1fr; }
.info-chapter-body-inner { overflow: hidden; }
.info-chapter-body { padding: 0 18px 18px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.info-chapter-body p + p { margin-top: 10px; }
.info-chapter-badge { font-size: 10px; font-weight: 700; color: var(--red); border: 1px solid var(--red); border-radius: 20px; padding: 1px 8px; vertical-align: middle; flex-shrink: 0; }
.profile-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.profile-field { margin-bottom: 14px; }
.profile-field label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.profile-field input { width: 100%; max-width: 320px; padding: 10px 13px; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text); font-family: inherit; outline: none; transition: border-color 0.15s; }
.profile-field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,30,58,0.18); }
.profile-error { font-size: 12px; color: var(--red); margin-top: 8px; }
.profile-success { font-size: 12px; color: #4ade80; margin-top: 8px; }

.admin-badge { font-size: 10px; font-weight: 700; background: var(--red); color: #fff; border-radius: 10px; padding: 2px 7px; margin-left: 6px; box-shadow: 0 2px 8px -2px var(--red-glow); }
.user-card { background: var(--neu-bg); border: none; border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light); }

/* ── Super Admin ── */
.sa-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.sa-kpi-card { background: var(--neu-bg); border: none; border-radius: var(--radius); padding: 16px; box-shadow: 6px 6px 14px var(--neu-shadow-dark), -6px -6px 14px var(--neu-shadow-light); }
.sa-kpi-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 8px; }
.sa-kpi-value { font-size: 26px; font-weight: 800; }
.sa-kpi-green { color: #4ade80; }
.sa-kpi-orange { color: #facc15; }
.sa-kpi-red { color: var(--red); }
.sa-kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.sa-main-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.sa-panel { background: var(--neu-bg); border: none; border-radius: var(--radius); padding: 18px; box-shadow: 8px 8px 18px var(--neu-shadow-dark), -8px -8px 18px var(--neu-shadow-light); overflow-x: hidden; min-width: 0; }
.sa-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.sa-panel-title { font-size: 14px; font-weight: 700; }
.sa-filter-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.sa-filter-tab { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); background: none; color: var(--text-muted); cursor: pointer; font-family: inherit; transition: all 0.15s; }
.sa-filter-tab:hover { border-color: rgba(255,255,255,0.25); }
.sa-filter-tab.active { background: var(--red); border-color: var(--red); color: #fff; }

.sa-company-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.sa-company-row:last-child { border-bottom: none; }
.sa-company-name { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.sa-company-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.sa-status-badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.sa-status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sa-status-subscribed { background: rgba(74,222,128,0.14); color: #4ade80; }
.sa-status-trial { background: rgba(250,204,21,0.14); color: #facc15; }
.sa-status-expired { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.sa-status-expired::before { display: none; }
.sa-status-vip { background: rgba(196,30,58,0.14); color: var(--red); }

.sa-message-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
#sa-messages-list, #sa-activity-list { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
#sa-messages-list::-webkit-scrollbar, #sa-activity-list::-webkit-scrollbar { width: 6px; }
#sa-messages-list::-webkit-scrollbar-thumb, #sa-activity-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.sa-message-item:last-child { border-bottom: none; }
.sa-message-sender { font-size: 12.5px; font-weight: 700; overflow-wrap: anywhere; }
.sa-message-subject { font-size: 12px; font-weight: 600; margin: 2px 0; overflow-wrap: anywhere; }
.sa-message-preview { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-message-time { font-size: 10.5px; color: var(--text-muted); float: right; }

.sa-activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 24px; }
.sa-activity-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.sa-activity-item:last-child { border-bottom: none; }
.sa-activity-dot { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; margin-top: 1px; }
.sa-activity-text { font-size: 12px; line-height: 1.5; }
.sa-activity-time { font-size: 10.5px; color: var(--text-muted); }

.sa-freq-card { background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.sa-freq-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.sa-freq-value { font-size: 20px; font-weight: 800; }

.sa-online-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sa-online-row:last-child { border-bottom: none; }
.sa-online-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sa-online-dot.on { background: #4ade80; box-shadow: 0 0 8px 1px rgba(74,222,128,0.6); }
.sa-online-dot.off { background: var(--text-muted); opacity: 0.4; }
.sa-online-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.sa-online-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }

.sa-history-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.sa-history-row:last-child { border-bottom: none; }
.sa-history-time { color: var(--text-muted); font-size: 11px; min-width: 118px; flex-shrink: 0; }
.sa-history-user { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-history-ip { color: var(--text-muted); font-size: 11px; font-family: monospace; flex-shrink: 0; }

@media (max-width: 900px) {
  .sa-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .sa-main-grid { grid-template-columns: 1fr; }
  .sa-freq-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .sa-history-time, .sa-history-ip { min-width: unset; }
  .sa-history-row { flex-wrap: wrap; row-gap: 4px; }
}

/* En dessous de cette largeur, une ligne "nom + badge + boutons" ne tient plus sur une seule ligne :
   on la fait passer en 2 lignes au lieu de forcer un défilement horizontal du cadre. */
@media (max-width: 640px) {
  .sa-company-row { flex-wrap: wrap; row-gap: 8px; }
  .sa-company-row > div:first-child { flex-basis: 100%; }
  .user-card { flex-wrap: wrap; row-gap: 10px; }
  .user-card-actions { flex-basis: 100%; }
}
.user-card-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--red); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-size: 14px; font-weight: 600; overflow-wrap: break-word; }
.user-card-meta { font-size: 12px; color: var(--text-muted); }
.user-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-form { background: rgba(255,255,255,0.02); border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.admin-form-field label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; }
.admin-form-field input, .admin-form-field select { width: 100%; padding: 9px 11px; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text); font-family: inherit; outline: none; }
.admin-form-field input:focus, .admin-form-field select:focus { border-color: var(--red); }

.stock-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--neu-bg); border: none;
  border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 8px;
  box-shadow: 5px 5px 12px var(--neu-shadow-dark), -5px -5px 12px var(--neu-shadow-light);
}
.stock-item-name { flex: 1; font-size: 14px; font-weight: 500; }
.stock-item-qty-wrap { display: flex; align-items: center; gap: 6px; }
.stock-item-qty { width: 80px; padding: 7px 10px; font-size: 14px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text); font-family: inherit; outline: none; -moz-appearance: textfield; }
.stock-item-qty::-webkit-inner-spin-button, .stock-item-qty::-webkit-outer-spin-button { -webkit-appearance: none; }
.stock-item-qty:focus { border-color: var(--border-focus); }
.stock-item-unit { font-size: 12px; color: var(--text-muted); min-width: 36px; }

.nav-new-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--red);
}

.page-toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--neu-bg);
  border: none; border-radius: var(--radius-sm);
  box-shadow: 5px 5px 12px var(--neu-shadow-dark), -5px -5px 12px var(--neu-shadow-light);
  margin-bottom: 6px;
}
.page-toggle-icon { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; }
.page-toggle-name { font-size: 13px; font-weight: 500; flex: 1; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 999px; transition: 0.2s;
}
.switch-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 2px; top: 2px; background: var(--text-muted);
  border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--red); border-color: var(--red); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); background: #fff; }

.time-picker-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 13px; font-size: 20px; font-weight: 700;
  font-family: 'Inter', monospace; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-variant-numeric: tabular-nums; letter-spacing: 0.05em;
}
.time-picker-btn:focus, .time-picker-btn.active {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,30,58,0.18); outline: none;
}

.time-picker-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 10000; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.time-picker-sheet {
  background: var(--modal-bg); border: 1px solid var(--border);
  border-radius: 24px; padding: 0;
  width: 320px; max-width: calc(100vw - 32px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  overflow: hidden;
}
.time-picker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.time-picker-title { font-size: 15px; font-weight: 700; color: var(--text); }
.time-picker-confirm {
  font-size: 15px; font-weight: 700; color: var(--red);
  background: none; border: none; cursor: pointer; padding: 4px 8px;
}
.time-picker-cancel {
  font-size: 14px; color: var(--text-muted);
  background: none; border: none; cursor: pointer; padding: 4px 8px;
}
.time-picker-hint {
  text-align: center; font-size: 11px; color: var(--text-muted);
  padding: 8px 12px 0;
}

.time-picker-wheels {
  display: flex; align-items: center; justify-content: center;
  height: 220px; position: relative; padding: 0 20px; gap: 4px;
}

.time-picker-sep {
  font-size: 36px; font-weight: 700; color: var(--text);
  width: 20px; text-align: center; flex-shrink: 0;
  position: relative; z-index: 3;
}

.time-picker-wheels::before { display: none; }

.time-wheel-wrap {
  flex: 1; position: relative; height: 220px; overflow: hidden;
}

.time-wheel-wrap .wheel-selector {
  position: absolute;
  left: 8px; right: 8px;
  top: 50%; transform: translateY(-50%);
  height: 48px; margin-top: -24px;
  border: 2px solid rgba(196,30,58,0.65);
  border-radius: 10px;
  background: rgba(196,30,58,0.08);
  pointer-events: none; z-index: 4;
}

.time-wheel-wrap::before, .time-wheel-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; z-index: 3; pointer-events: none;
}
.time-wheel-wrap::before {
  top: 0; height: 86px;
  background: linear-gradient(to bottom, var(--modal-bg) 0%, var(--modal-bg) 60%, transparent 100%);
}
.time-wheel-wrap::after {
  bottom: 0; height: 86px;
  background: linear-gradient(to top, var(--modal-bg) 0%, var(--modal-bg) 60%, transparent 100%);
}

.time-wheel {
  height: 100%;
  overflow-y: scroll;

  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.time-wheel::-webkit-scrollbar { display: none; }

.time-wheel-item {
  height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  opacity: 0.6;
  
  cursor: pointer; user-select: none;
  transition: color 0.15s;
  
}
.time-wheel-item.selected { color: var(--text); opacity: 1; font-size: 30px; }

