/* ============================================================
   TAPLEE — Dashboard Gérant · Design System
   Revolut-inspired premium · Dark · Inter
   Identique au site vitrine taplee.app
   ============================================================ */

/* ----------  Design Tokens  ---------- */
:root {
  /* Backgrounds */
  --bg: #07080D;
  --bg-2: #0B0D14;
  --surface: #111520;
  --surface-2: #181D2A;
  --surface-3: #1F2536;
  --surface-hover: #232A3D;

  /* Brand */
  --orange: #FF7B1C;
  --orange-light: #FFA020;
  --orange-dark: #FF5500;
  --orange-grad: linear-gradient(135deg, #FFA020, #FF5500);
  --orange-grad-soft: linear-gradient(135deg, rgba(255,160,32,0.18), rgba(255,85,0,0.18));

  /* Text */
  --white: #FFFFFF;
  --text: rgba(255, 255, 255, 0.94);
  --text-muted: rgba(255, 255, 255, 0.58);
  --text-dim: rgba(255, 255, 255, 0.40);

  /* Status */
  --green: #4ADE80;
  --green-soft: rgba(74, 222, 128, 0.14);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --yellow: #FBBF24;
  --yellow-soft: rgba(251, 191, 36, 0.14);
  --blue: #60A5FA;
  --blue-soft: rgba(96, 165, 250, 0.14);

  /* Borders */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 36px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.55);
  --shadow-orange: 0 14px 50px rgba(255, 123, 28, 0.4);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t: 220ms;
  --t-slow: 480ms;

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h: 68px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ----------  Reset  ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }
svg { display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ----------  Mesh gradient background  ---------- */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, rgba(255, 123, 28, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 10%, rgba(255, 160, 32, 0.06), transparent 55%),
    var(--bg);
}

/* ----------  Typography  ---------- */
h1, h2, h3, h4, h5 {
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--white);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -0.04em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }
h5 { font-size: 0.88rem; }
.gradient-text {
  background: var(--orange-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-orange { color: var(--orange-light); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-center { text-align: center; }

/* ============================================================
   APP LAYOUT — sidebar + topbar + content
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ----------  Sidebar  ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--t-slow) var(--ease);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--border);
}
/* Full horizontal logo (icon + "Taplee" text) — never stretched */
.sidebar-brand .brand-logo-full {
  height: 30px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.sidebar-brand .brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}
.sidebar-brand .brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--white);
}
.sidebar-nav {
  flex: 1;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 16px 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.93rem;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--surface-2); color: var(--white); }
.nav-item.active {
  background: var(--orange-grad-soft);
  color: var(--white);
  border: 1px solid rgba(255,160,32,0.22);
}
.nav-item.active svg { opacity: 1; color: var(--orange-light); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--orange-grad);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--orange-grad);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--r-full);
}
.sidebar-foot {
  padding: 14px;
  border-top: 1px solid var(--border);
}

/* Sidebar user card */
.user-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color var(--t);
}
.user-card:hover { border-color: var(--border-strong); }
.user-card .avatar { width: 36px; height: 36px; font-size: 0.9rem; flex-shrink: 0; }
.user-card .uc-info { min-width: 0; flex: 1; }
.user-card .uc-name { font-weight: 600; font-size: 0.86rem; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .uc-plan { font-size: 0.72rem; color: var(--text-muted); }

/* ----------  Main  ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ----------  Topbar  ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(11, 13, 20, 0.78);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
}
.topbar .menu-btn {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  align-items: center; justify-content: center;
  color: var(--white);
}
.topbar .menu-btn:hover { background: var(--surface-2); }
.topbar-title { font-weight: 700; font-size: 1.02rem; color: var(--white); }
.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--white); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot {
  position: absolute;
  top: 9px; right: 9px;
  width: 8px; height: 8px;
  background: var(--orange);
  border: 2px solid var(--bg-2);
  border-radius: 50%;
}

/* Language selector (topbar) */
.lang-select { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all var(--t) var(--ease);
  height: 40px;
}
.lang-btn:hover { color: var(--white); border-color: rgba(255,255,255,0.3); }
.lang-btn svg { width: 16px; height: 16px; }
.lang-menu {
  position: absolute;
  top: calc(100% + 10px); right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 6px;
  min-width: 168px;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all var(--t) var(--ease);
  z-index: 300;
}
.lang-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background var(--t), color var(--t);
}
.lang-menu button:hover, .lang-menu button.active { background: rgba(255,255,255,0.07); color: var(--white); }

/* ----------  Content area  ---------- */
.content {
  padding: 28px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.page-head { margin-bottom: 26px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .page-sub { color: var(--text-muted); font-size: 0.98rem; }
.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* Overlay for mobile sidebar */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0; visibility: hidden;
  transition: opacity var(--t) var(--ease), visibility var(--t);
}
.scrim.show { opacity: 1; visibility: visible; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ----------  Buttons  ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease), opacity var(--t);
  white-space: nowrap;
  border: 1px solid transparent;
  position: relative;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary {
  background: var(--orange-grad);
  color: #fff;
  box-shadow: var(--shadow-orange);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 56px rgba(255, 123, 28, 0.55); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  color: var(--white);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255,255,255,0.3); }
.btn-dark {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--white);
}
.btn-dark:hover { background: var(--surface-hover); }
.btn-green { background: var(--green); color: #0a1f12; }
.btn-green:hover { background: #5ef096; transform: translateY(-2px); }
.btn-red { background: var(--red-soft); color: var(--red); border-color: rgba(248,113,113,0.3); }
.btn-red:hover { background: rgba(248,113,113,0.22); }
.btn-sm { padding: 8px 15px; font-size: 0.84rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon-only { padding: 11px; }
.btn:disabled, .btn.is-loading {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}
.btn.is-loading { pointer-events: none; }
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------  Cards  ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t);
}
.card-pad { padding: 22px; }
.card-hover:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card-title { font-weight: 700; font-size: 1.02rem; color: var(--white); margin-bottom: 4px; }
.card-sub { font-size: 0.84rem; color: var(--text-muted); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

/* ----------  KPI cards  ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t) var(--ease), border-color var(--t);
}
.kpi-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(255,123,28,0.10), transparent 65%);
  opacity: 0;
  transition: opacity var(--t);
}
.kpi-card:hover::before { opacity: 1; }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--orange-grad-soft);
  border: 1px solid rgba(255,160,32,0.22);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  position: relative;
}
.kpi-icon svg { width: 22px; height: 22px; color: var(--orange-light); }
.kpi-icon.green { background: var(--green-soft); border-color: rgba(74,222,128,0.22); }
.kpi-icon.green svg { color: var(--green); }
.kpi-icon.blue { background: var(--blue-soft); border-color: rgba(96,165,250,0.22); }
.kpi-icon.blue svg { color: var(--blue); }
.kpi-icon.yellow { background: var(--yellow-soft); border-color: rgba(251,191,36,0.22); }
.kpi-icon.yellow svg { color: var(--yellow); }
.kpi-label { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 6px; }
.kpi-value { font-size: 2rem; font-weight: 900; color: var(--white); letter-spacing: -0.03em; line-height: 1; }
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 12px;
}
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend svg { width: 14px; height: 14px; }

/* ----------  Avatar  ---------- */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.avatar.sm { width: 32px; height: 32px; font-size: 0.82rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar.xl { width: 76px; height: 76px; font-size: 1.6rem; }

/* ----------  Badge  ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-full);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-orange { background: rgba(255,160,32,0.12); color: var(--orange-light); }
.badge-gray { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-live {
  background: var(--red-soft);
  color: var(--red);
}
.badge-live .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ----------  Forms  ---------- */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.field-label .req { color: var(--orange-light); }
.field-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; }
/* Aide inline SOUS le texte d'un label (ex : champ TVA facultatif). */
.field-label .field-hint-inline { display: block; font-size: 0.72rem; font-weight: 400; color: var(--text-dim); margin-top: 2px; }
.input, .textarea, .select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--white);
  font-size: 0.93rem;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:hover, .textarea:hover, .select:hover { border-color: rgba(255,255,255,0.25); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,123,28,0.16);
  background: var(--surface-3);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ffffff99' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.select option { background: var(--surface-2); color: var(--white); }

/* Input with icon / suffix */
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 42px; }
.input-wrap .input-suffix { padding-right: 42px; }
.input-wrap .input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}
.input-wrap .input-action {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.input-wrap .input-action:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.input-wrap .input-action svg { width: 18px; height: 18px; }

/* Validation states */
.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select { border-color: var(--red); box-shadow: 0 0 0 3px rgba(248,113,113,0.14); }
.field.has-success .input,
.field.has-success .textarea,
.field.has-success .select { border-color: var(--green); }
.field-error {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 6px;
}
.field-error svg { width: 14px; height: 14px; }
.field.has-error .field-error { display: flex; }

/* Checkbox & radio */
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }
.check input { display: none; }
.check .box {
  width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
  margin-top: 1px;
}
.check .box svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.check input:checked + .box { background: var(--orange-grad); border-color: transparent; }
.check input:checked + .box svg { opacity: 1; }
.check a { color: var(--orange-light); text-decoration: underline; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { display: none; }
.toggle .track {
  position: absolute; inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  transition: all var(--t);
}
.toggle .track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--t) var(--ease);
}
.toggle input:checked + .track { background: var(--orange-grad); border-color: transparent; }
.toggle input:checked + .track::after { transform: translateX(18px); }

/* Char counter */
.char-counter {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 6px;
  text-align: right;
}
.char-counter.warn { color: var(--yellow); }

/* Segmented control / tabs */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 4px;
  gap: 3px;
}
.segmented button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--t);
  white-space: nowrap;
}
.segmented button:hover { color: var(--white); }
.segmented button.active {
  background: var(--orange-grad);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.segmented.block { display: flex; width: 100%; }
.segmented.block button { flex: 1; text-align: center; }

/* Tabs (full underline style) */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 13px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--t), border-color var(--t);
  margin-bottom: -1px;
}
.tab:hover { color: var(--white); }
.tab.active { color: var(--white); border-bottom-color: var(--orange); }

/* ----------  Tables  ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
table.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0; /* let parent constrain; wrap scrolls horizontally only when needed */
}
.table th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table .cell-main { font-weight: 600; color: var(--white); }
.table .cell-sub { font-size: 0.8rem; color: var(--text-muted); }

/* ----------  Modal  ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--t) var(--ease), visibility var(--t);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  max-width: 540px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  padding: 28px;
  position: relative;
  transform: scale(0.95) translateY(14px);
  transition: transform var(--t-slow) var(--ease);
}
.modal.modal-lg { max-width: 680px; }
.modal.modal-sm { max-width: 420px; }
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
  z-index: 2;
}
.modal-close:hover { background: var(--surface-hover); }
.modal-close svg { width: 16px; height: 16px; }
.modal-head { padding-right: 36px; margin-bottom: 22px; }
.modal-head h3 { font-size: 1.25rem; margin-bottom: 4px; }
.modal-head p { color: var(--text-muted); font-size: 0.9rem; }
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ----------  Toasts  ---------- */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 3000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 13px 17px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  transform: translateX(120%);
  transition: transform var(--t-slow) var(--ease);
  pointer-events: auto;
}
.toast.show { transform: translateX(0); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--orange-light); }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--orange-light); }
.toast-msg { font-size: 0.88rem; line-height: 1.4; }

/* ----------  Skeleton loaders  ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton.line { height: 14px; margin-bottom: 8px; }
.skeleton.line.short { width: 60%; }
.skeleton.circle { border-radius: 50%; }
.spinner-lg {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-overlay {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ----------  Empty state  ---------- */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.empty-state .empty-ill {
  width: 84px; height: 84px;
  border-radius: 24px;
  background: var(--orange-grad-soft);
  border: 1px solid rgba(255,160,32,0.18);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.empty-state .empty-ill svg { width: 38px; height: 38px; color: var(--orange-light); }
.empty-state h4 { font-size: 1.1rem; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 0.92rem; max-width: 360px; margin-bottom: 18px; }

/* ----------  Progress bar  ---------- */
.progress {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  background: var(--orange-grad);
  border-radius: var(--r-full);
  transition: width var(--t-slow) var(--ease);
}
.progress .bar.green { background: var(--green); }

/* ----------  Live feed item  ---------- */
.feed-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-item .feed-meta { flex: 1; min-width: 0; }
.feed-item .feed-name { font-weight: 600; font-size: 0.9rem; color: var(--white); }
.feed-item .feed-time { font-size: 0.78rem; color: var(--text-dim); }

/* ----------  Banner / trial  ---------- */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: var(--r-md);
  margin-bottom: 22px;
  border: 1px solid;
}
.banner-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.banner-icon svg { width: 20px; height: 20px; }
.banner.orange { background: var(--orange-grad-soft); border-color: rgba(255,160,32,0.3); }
.banner.orange .banner-icon { background: var(--orange-grad); }
.banner.orange .banner-icon svg { color: #fff; }
.banner.red { background: var(--red-soft); border-color: rgba(248,113,113,0.3); }
.banner.red .banner-icon { background: var(--red); }
.banner.red .banner-icon svg { color: #fff; }
.banner-content { flex: 1; }
.banner-title { font-weight: 700; font-size: 0.92rem; color: var(--white); }
.banner-text { font-size: 0.82rem; color: var(--text-muted); }

/* ----------  Misc utilities  ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.gap-lg { gap: 22px; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 26px; }
.mb-md { margin-bottom: 18px; }
.mb-lg { margin-bottom: 26px; }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Drag & drop zone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 28px 20px;
  text-align: center;
  transition: all var(--t);
  cursor: pointer;
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--orange); background: rgba(255,123,28,0.06); }
.dropzone .dz-icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--orange-grad-soft);
  display: flex; align-items: center; justify-content: center;
}
.dropzone .dz-icon svg { width: 24px; height: 24px; color: var(--orange-light); }
.dropzone .dz-title { font-weight: 600; font-size: 0.92rem; color: var(--white); margin-bottom: 4px; }
.dropzone .dz-text { font-size: 0.8rem; color: var(--text-muted); }
.dropzone .dz-ideal { font-size: 0.76rem; color: var(--orange-light); margin-top: 8px; }
.dropzone .dz-ideal strong { font-weight: 700; }
/* Uploaded preview showing how it looks ON the card (circle, like the card logo) */
.dz-preview { display: flex; align-items: center; gap: 12px; justify-content: center; }
.dz-preview .dz-card-mock { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,160,32,.3); background: var(--surface-3); flex-shrink: 0; }
.dz-preview .dz-card-mock img { width: 100%; height: 100%; object-fit: cover; }

/* Realistic phone mockup (iPhone by default, Android via .is-android) */
.phone-mockup {
  width: 268px;
  max-width: 100%;
  background: linear-gradient(150deg, #3a3f52 0%, #1a1d28 40%, #0c0e15 100%);
  border-radius: 42px;
  padding: 11px;
  box-shadow: 0 30px 70px rgba(0,0,0,.55), inset 0 0 0 1.5px rgba(255,255,255,.06);
  margin: 0 auto;
  position: relative;
}
/* Dynamic Island / notch */
.phone-notch {
  position: absolute;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  width: 92px; height: 26px;
  background: #000;
  border-radius: var(--r-full);
  z-index: 6;
}
.phone-mockup.is-android .phone-notch {
  width: 10px; height: 10px; border-radius: 50%;
  top: 22px; left: auto; right: 28px; transform: none;
}
.phone-screen {
  background: #000;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  min-height: 520px;
}
.phone-screen .wallpaper {
  position: absolute; inset: 0;
  /* FIXED dark backdrop — only the CARD reflects the chosen background */
  background:
    radial-gradient(circle at 30% 12%, rgba(255,123,28,0.12), transparent 55%),
    radial-gradient(circle at 80% 88%, rgba(96,165,250,0.08), transparent 50%),
    linear-gradient(180deg, #15171f, #07080D);
}
/* status bar (time + signal + battery) */
.phone-statusbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px 0; z-index: 4;
  color: #fff; font-size: 0.78rem; font-weight: 700;
}
.ps-icons { display: flex; align-items: center; gap: 6px; color: #fff; }

/* Apple Wallet pass preview */
/* Card preview: standalone Wallet card (no phone), realistic vertical format */
.card-preview-stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0;
}
.wallet-pass {
  width: 290px; max-width: 100%;
  background: linear-gradient(160deg, #232a3c, #11151f);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 55px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  /* Apple/Google Wallet loyalty cards are vertical rectangles.
     Content defines the height; the card stays card-like and compact. */
}
.wallet-pass .wp-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wallet-pass .wp-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--orange-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 0.8rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.wallet-pass .wp-logo.draggable {
  cursor: grab; touch-action: none;
  border: 2px dashed rgba(255,255,255,.5);
}
.wallet-pass .wp-logo.draggable:active { cursor: grabbing; }
.wallet-pass .wp-logo img { width: 100%; height: 100%; object-fit: cover; }
.wallet-pass .wp-name { font-size: 0.82rem; font-weight: 700; color: #fff; line-height: 1.2; }
.wallet-pass .wp-sub { font-size: 0.66rem; color: rgba(255,255,255,0.55); }
.wallet-pass .wp-body { padding: 12px 14px; }
.wallet-pass .wp-prog-label { font-size: 0.66rem; color: rgba(255,255,255,0.55); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
/* En-tête : nom du commerce à gauche, prénom du client à droite. */
.wallet-pass .wp-head-main { flex: 1; min-width: 0; }
/* Prénom en haut à droite (aligné avec le nom), bold, ellipsis si long. */
.wallet-pass .wp-cust-name {
  font-size: 0.95rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 45%; text-align: right; flex-shrink: 0;
}
/* Ligne de progression : compteur X/Y uniquement (le prénom est dans l'en-tête). */
.wallet-pass .wp-prog-row { margin-bottom: 10px; }
.wallet-pass .wp-prog-count { font-size: 0.7rem; font-weight: 600; opacity: 0.85; white-space: nowrap; }
.wallet-pass .wp-stamps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wallet-pass .wp-stamp {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wallet-pass .wp-stamp.filled { background: var(--orange-grad); border-color: transparent; }
.wallet-pass .wp-stamp.filled svg { width: 13px; height: 13px; color: #fff; }
.wallet-pass .wp-reward {
  text-align: center;
  padding: 9px 10px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.wallet-pass .wp-slogan {
  text-align: center;
  margin-top: 8px;
  font-size: 0.64rem;
  color: rgba(255,255,255,0.92);
  font-weight: 500;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.wallet-pass .wp-points { font-size: 1.8rem; font-weight: 900; color: #fff; letter-spacing: -0.03em; }
.wallet-pass .wp-qr {
  display: flex; justify-content: center; margin: 8px 0 2px;
}
.wallet-pass .wp-qr img {
  width: 68px; height: 68px; background: #fff; padding: 5px;
  border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.wallet-pass .wp-qr-label {
  text-align: center; font-size: 0.6rem; color: rgba(255,255,255,0.6);
  margin-top: 5px; letter-spacing: 0.03em;
}
.wallet-pass .wp-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.2);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
}

/* Wallet brand toggle (Apple/Google) */
.wallet-brand {
  position: absolute;
  bottom: 20px; left: 16px; right: 16px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}
.wallet-brand svg { width: 16px; height: 16px; }

/* ============================================================
   AUTH PAGES (login)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,123,28,0.16), transparent 60%);
  pointer-events: none;
}
.auth-page::after {
  content: '';
  position: absolute;
  bottom: -300px; left: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,160,32,0.10), transparent 60%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 36px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-logo .brand-mark { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; }
.auth-logo .brand-logo-full { max-width: 160px; width: auto; height: auto; object-fit: contain; }
.auth-logo .brand-name { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; color: var(--white); }

/* CEO tag (small badge next to logo in admin sidebar) */
.brand-ceo-tag {
  font-size: 0.62rem; color: var(--orange-light); font-weight: 800; letter-spacing: 0.06em;
  background: var(--orange-grad-soft); border: 1px solid rgba(255,160,32,0.22);
  padding: 2px 8px; border-radius: var(--r-full);
}
.auth-title { text-align: center; font-size: 1.55rem; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 0.92rem; margin-bottom: 28px; }
.auth-switch {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 22px;
}
.auth-switch a, .auth-link { color: var(--orange-light); font-weight: 600; }
.auth-link { font-size: 0.84rem; display: inline-block; }
.auth-lang {
  position: absolute;
  top: 24px; right: 24px;
  z-index: 2;
}
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn var(--t) var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.auth-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.auth-back:hover { color: var(--white); }
.auth-back svg { width: 16px; height: 16px; }
.auth-success {
  display: none;
  align-items: center; gap: 10px;
  background: var(--green-soft);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 0.86rem;
  color: var(--green);
  margin-bottom: 18px;
}
.auth-success.show { display: flex; }
.auth-success svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   STATISTICS / charts
   ============================================================ */
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.sm { height: 220px; }

/* Heatmap */
.heatmap { display: grid; grid-template-columns: 32px 1fr; gap: 6px; }
.heatmap-labels { display: flex; flex-direction: column; gap: 5px; font-size: 0.7rem; color: var(--text-dim); justify-content: space-around; padding-top: 22px; }
.heatmap-grid { display: flex; flex-direction: column; gap: 5px; }
.heatmap-hours { display: flex; gap: 4px; font-size: 0.66rem; color: var(--text-dim); padding-left: 2px; margin-bottom: 4px; }
.heatmap-hours span { flex: 1; text-align: center; }
.heatmap-row { display: flex; gap: 4px; }
.heatmap-cell {
  flex: 1;
  aspect-ratio: 1.4;
  border-radius: 4px;
  background: var(--surface-3);
  transition: transform var(--t);
  cursor: pointer;
}
.heatmap-cell:hover { transform: scale(1.15); }

/* Insight card */
.insight {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.insight-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.insight-icon svg { width: 20px; height: 20px; }
.insight-icon.orange { background: var(--orange-grad-soft); }
.insight-icon.orange svg { color: var(--orange-light); }
.insight-icon.green { background: var(--green-soft); }
.insight-icon.green svg { color: var(--green); }
.insight-icon.blue { background: var(--blue-soft); }
.insight-icon.blue svg { color: var(--blue); }
.insight-icon.yellow { background: var(--yellow-soft); }
.insight-icon.yellow svg { color: var(--yellow); }
.insight-text { flex: 1; }
.insight-title { font-weight: 600; font-size: 0.9rem; color: var(--white); }
.insight-val { font-size: 0.82rem; color: var(--text-muted); }

/* ============================================================
   SCANNER
   ============================================================ */
.scan-frame {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at center, rgba(255,123,28,0.06), transparent 70%),
    var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.scan-corner {
  position: absolute;
  width: 36px; height: 36px;
  border: 3px solid var(--orange);
}
.scan-corner.tl { top: 18px; left: 18px; border-right: none; border-bottom: none; border-radius: 10px 0 0 0; }
.scan-corner.tr { top: 18px; right: 18px; border-left: none; border-bottom: none; border-radius: 0 10px 0 0; }
.scan-corner.bl { bottom: 18px; left: 18px; border-right: none; border-top: none; border-radius: 0 0 0 10px; }
.scan-corner.br { bottom: 18px; right: 18px; border-left: none; border-top: none; border-radius: 0 0 10px 0; }
.scan-laser {
  position: absolute;
  left: 18px; right: 18px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--orange), transparent);
  box-shadow: 0 0 12px var(--orange);
  animation: scanLine 2.4s ease-in-out infinite;
}
@keyframes scanLine {
  0%, 100% { top: 30px; }
  50% { top: calc(100% - 30px); }
}
.scan-icon { width: 64px; height: 64px; color: var(--text-dim); }
.scan-icon svg { width: 100%; height: 100%; }

/* ============================================================
   CARD EDITOR
   ============================================================ */
.editor-section { margin-bottom: 26px; }
.editor-section h4 { margin-bottom: 4px; }
.editor-section .section-sub { color: var(--text-muted); font-size: 0.84rem; margin-bottom: 16px; }

/* Color swatches */
.swatch-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatch {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--t), border-color var(--t);
  position: relative;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--white); }
.swatch.active::after {
  content: '';
  position: absolute; inset: 0;
  border: 2px solid var(--orange);
  border-radius: var(--r-sm);
}

/* Image picker grid */
.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.img-option {
  aspect-ratio: 1.5;
  border-radius: var(--r-sm);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  transition: transform var(--t), border-color var(--t);
}
.img-option:hover { transform: translateY(-2px); }
.img-option.active { border-color: var(--orange); }
.img-option .img-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 8px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
}
.img-option .img-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--orange-grad);
  display: none;
  align-items: center; justify-content: center;
}
.img-option.active .img-check { display: flex; }
.img-option .img-check svg { width: 13px; height: 13px; color: #fff; }

/* Slider */
.range-row { display: flex; align-items: center; gap: 14px; }
.range-value {
  min-width: 54px;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--white);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  background: var(--orange-grad);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--orange);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--surface);
}

/* color input native */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  padding: 4px;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }

/* date / time inputs */
input[type="datetime-local"] { color-scheme: dark; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  /* Sidebar becomes a drawer: keep its own width fixed so it is actually
     visible when open. --sidebar-w only affects the desktop main margin. */
  .sidebar { width: 280px; max-width: 84vw; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: flex; }
  .content { padding: 20px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .page-head-row { flex-direction: column; align-items: stretch; }
  .auth-card { padding: 26px 22px; }
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 0.92rem; }
  .toast-container { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; width: 100%; }
  .modal { padding: 22px 18px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .swatch-grid { grid-template-columns: repeat(4, 1fr); }
  .img-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   MOBILE-FIRST ENHANCEMENTS  (375–430px, one-hand / thumb-zone)
   ============================================================ */

/* HERO scan CTA on the dashboard — first reachable action for cashiers */
.scan-cta {
  display: flex; align-items: center; gap: 16px;
  background: var(--orange-grad); color: #fff;
  border-radius: var(--r-md); padding: 18px 22px; margin-bottom: 22px;
  box-shadow: 0 16px 44px rgba(255,123,28,.4);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  position: relative; overflow: hidden;
}
@media (max-width: 600px) {
  .scan-cta { padding: 16px 18px; gap: 12px; }
  .scan-cta-icon { width: 46px; height: 46px; }
  .scan-cta-title { font-size: 1.15rem; }
  .scan-cta::after { display: none; } /* disable pulse ring on small screens */
  .reward-input-row { flex-wrap: wrap; }
}
.scan-cta:hover { transform: translateY(-2px); box-shadow: 0 20px 52px rgba(255,123,28,.55); }
.scan-cta:active { transform: scale(.98); }
.scan-cta-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
}
.scan-cta-icon svg { width: 28px; height: 28px; }
.scan-cta-text { flex: 1; min-width: 0; }
.scan-cta-title { font-size: 1.3rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.scan-cta-sub { font-size: 0.84rem; opacity: .85; font-weight: 500; margin-top: 2px; }
.scan-cta-arrow { width: 22px; height: 22px; flex-shrink: 0; opacity: .8; }
/* pulse ring to draw the eye */
.scan-cta::after {
  content: ''; position: absolute; right: 56px; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 14px;
  border: 2px solid rgba(255,255,255,.4); animation: ctaPulse 2s ease-out infinite; pointer-events: none;
}
@keyframes ctaPulse { 0% { transform: translateY(-50%) scale(1); opacity: .6; } 100% { transform: translateY(-50%) scale(1.5); opacity: 0; } }

/* Safe areas (notches / home indicator) */
.topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Minimum touch target — every interactive control reachable by thumb */
@media (max-width: 600px) {
  .btn { min-height: 48px; }
  .btn-sm { min-height: 44px; }
  .nav-item { min-height: 48px; }
  .icon-btn, .input-action, .lang-btn { min-width: 44px; min-height: 44px; }
  .select, .input { min-height: 48px; }
  .tab { padding-top: 14px; padding-bottom: 14px; min-height: 48px; }
  /* thumb-zone: actions that matter stick low */
  .content { padding: 18px 14px; }
  .card-pad { padding: 18px 16px; }
  /* prevent horizontal scroll caused by tables */
  .table-wrap { margin: 0 -14px; border-radius: 0; border-left: none; border-right: none; }
  /* FORCE all 2-column inline layouts to stack on phone — fixes the "cut screen" bug
     across notifications, carte, promos, scanner, etc. */
  #notifLayout, #editorLayout, #promoLayout, #scanLayout, #lists, #layout, #bottomLayout, .split-2 {
    display: block !important;
  }
  #notifLayout > div, #editorLayout > div, #promoLayout > div, #scanLayout > div,
  #lists > div, #layout > div, #bottomLayout > div {
    width: 100% !important;
    margin-bottom: 18px;
    position: static !important; /* kill sticky previews that overflow on phone */
  }
  /* segmenteds wrap cleanly */
  .segmented { flex-wrap: wrap; }
  .grid-2, .kpi-grid { gap: 12px; }
  h1 { font-size: 1.7rem; }
  /* iOS : police ≥ 16px obligatoire, sinon Safari zoome tout seul au focus
     d'un champ et la page reste dézoomée/décentrée après la saisie. */
  .input, .textarea, .select { font-size: 16px; }
  /* Ceinture anti-débordement : la page reste centrée, aucun scroll horizontal
     résiduel. clip (et non hidden) ne casse pas position:sticky. */
  html, body { overflow-x: clip; }
}

/* Mobile bottom logout in sidebar (always reachable) */
@media (max-width: 860px) {
  .sidebar-foot { position: sticky; bottom: 0; background: var(--surface); }
}

/* ============================================================
   CARD EDITOR — stamp styles & formats
   ============================================================ */
/* Stamp symbol picker */
.stamp-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stamp-style {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 6px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1.5px solid var(--border-strong);
  color: var(--text-muted); font-size: 0.72rem; font-weight: 600;
  transition: all var(--t) var(--ease); cursor: pointer;
}
.stamp-style:hover { color: var(--white); border-color: rgba(255,255,255,0.25); }
.stamp-style.active { background: var(--orange-grad-soft); border-color: var(--orange); color: var(--white); }
.stamp-style .ss-glyph { font-size: 1.3rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.stamp-style .ss-glyph svg { width: 22px; height: 22px; color: var(--orange-light); }
.stamp-style.active .ss-glyph svg { color: var(--orange); }
@media (max-width: 600px) { .stamp-styles { grid-template-columns: repeat(3, 1fr); } }

/* Emoji picker grid (optional stamp emojis) */
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; background: var(--surface-2); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm); cursor: pointer; transition: all var(--t) var(--ease);
}
.emoji-cell:hover { border-color: rgba(255,255,255,0.25); transform: scale(1.08); }
.emoji-cell.active { background: var(--orange-grad-soft); border-color: var(--orange); }
@media (max-width: 600px) { .emoji-grid { grid-template-columns: repeat(6, 1fr); } }

/* Reward input row (text + emoji quick pick) */
.reward-input-row { display: flex; gap: 8px; align-items: stretch; }
.reward-input-row .input { flex: 1; }
.emoji-btn {
  width: 46px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.emoji-btn:hover { background: var(--surface-hover); }
.emoji-popover {
  position: absolute; z-index: 50; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 10px; box-shadow: var(--shadow-md); display: none;
  max-width: 280px;
}
.emoji-popover.open { display: block; }
.emoji-popover .ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-popover button { font-size: 1.25rem; padding: 6px; border-radius: 8px; line-height: 1; }
.emoji-popover button:hover { background: var(--surface-hover); }
.reward-style-row { margin-top: 10px; }
.reward-style-row .check .box { width: 18px; height: 18px; }

/* Wallet brand logo (logo-seul) */
.wallet-brand .wb-logo { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }

/* Accent color picker (compact swatches) */
.accent-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform var(--t), border-color var(--t);
  position: relative;
}
.accent-swatch:hover { transform: scale(1.12); }
.accent-swatch.active { border-color: var(--white); box-shadow: 0 0 0 2px var(--bg); }

/* Card format variants (preview sizing) */

/* ============================================================
   WALLET CARD — readability overlay over any background
   ============================================================ */
/* readability overlay so text stays crisp over any background */
.wallet-pass::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}
.wallet-pass .wp-head, .wallet-pass .wp-body, .wallet-pass .wp-foot { position: relative; z-index: 1; }
.wallet-pass .wp-head { background: rgba(0,0,0,0.15); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Info tips (clickable "?") */
.info-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-muted);
  cursor: pointer; vertical-align: middle; margin-left: 6px;
  transition: color var(--t), background var(--t);
}
.info-tip:hover { color: var(--orange-light); background: var(--orange-grad-soft); }
.info-tip-popover {
  position: absolute; z-index: 400; max-width: 260px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 12px 14px;
  font-size: 0.82rem; line-height: 1.5; color: var(--text);
  box-shadow: var(--shadow-md); animation: tipPop .18s var(--ease);
}
@keyframes tipPop { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform: translateY(0); } }
.info-tip-popover .itp-arrow {
  position: absolute; top: -6px; left: 40px;
  width: 12px; height: 12px; background: var(--surface-2);
  border-left: 1px solid var(--border-strong); border-top: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

/* ============================================================
   SAMSUNG / GRANDS ANDROID (C3, 13/09/2026) — correctifs ciblés
   ------------------------------------------------------------
   Constat Samsung : viewport rendu ~600-700px (grand écran et/ou zoom
   de page de Samsung Internet) → les quick actions restaient en
   2 colonnes trop étroites : « Affiche QR » débordait et était ROGNÉ
   par la ceinture anti-débordement (overflow-x: clip).
   ⚠️ Zéro impact PC (>1024 : 3 colonnes inchangées) et iPhone
   (≤430px : déjà en 1 colonne depuis ≤600 — strictement identique).
   ============================================================ */
@media (max-width: 700px) {
  /* 1 colonne plus tôt : plus aucun rognage de carte sur grands Android */
  .grid-3 { grid-template-columns: 1fr; }
}

/* Téléphones étroits : bandeau d'accueil (scan-cta) et titre plus compacts
   (retour terrain 13/09 : « bandeau trop grand » sur Samsung). */
@media (max-width: 430px) {
  .scan-cta { padding: 13px 14px; gap: 10px; margin-bottom: 16px; }
  .scan-cta-icon { width: 40px; height: 40px; border-radius: 12px; }
  .scan-cta-icon svg { width: 22px; height: 22px; }
  .scan-cta-title { font-size: 1.05rem; }
  .scan-cta-sub { font-size: 0.78rem; }
  .scan-cta-arrow { width: 18px; height: 18px; }
  h1 { font-size: 1.45rem; }
  .page-head .page-sub { font-size: 0.85rem; }
}
