/* ================================================================
   Panel Crème — Admin shared styles
   ----------------------------------------------------------------
   Composants UI partagés par les pages admin (Atelier + Fidélité) :
   stats-grid, total-card, chart, callout, ainsi que les composants
   spécifiques au service Fidélité (scan, theme mock, valider, etc.).

   Base styles (variables, forms, buttons, cards, alerts, loader,
   hints, animations, empty-state) ? /common/css/panel.css
   ================================================================ */


/* Callout — style global config */
.callout {
  background: color-mix(in srgb, var(--primary) 6%, #fff);
  border: 2px solid var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
  color: var(--base);
  font-size: 0.88rem;
  padding: 1rem 1.1rem;
  gap: 0.75rem;
  align-items: center;
}
.callout-emoji { font-size: 1.6rem; }

/* ================================================================
   STATS GRID
   ================================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.stats-grid-3 .stat-card:nth-child(3) { grid-column: 1 / -1; }

.stat-card {
  background: #fff;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 90px; height: 90px;
  border-radius: 0 0 0 100%;
  background: var(--secondary);
  opacity: 0.15;
  transition: transform 0.3s ease;
}
.stat-card:hover { transform: translate(-2px, -3px); box-shadow: 7px 8px 0 var(--base); }
.stat-card:hover::before { transform: scale(1.3); }

.stat-card.accent-yellow::before  { background: var(--secondary); opacity: 0.35; }
.stat-card.accent-green::before   { background: var(--green);     opacity: 0.25; }
.stat-card.accent-orange::before  { background: var(--orange);    opacity: 0.3; }
.stat-card.accent-pink::before    { background: var(--pink);      opacity: 0.25; }
.stat-card.accent-yellow  { box-shadow: 5px 5px 0 var(--secondary); }
.stat-card.accent-yellow:hover  { box-shadow: 7px 8px 0 var(--secondary); }
.stat-card.accent-green   { box-shadow: 5px 5px 0 var(--green); }
.stat-card.accent-green:hover   { box-shadow: 7px 8px 0 var(--green); }
.stat-card.accent-orange  { box-shadow: 5px 5px 0 var(--orange); }
.stat-card.accent-orange:hover  { box-shadow: 7px 8px 0 var(--orange); }
.stat-card.accent-pink    { box-shadow: 5px 5px 0 var(--pink); }
.stat-card.accent-pink:hover    { box-shadow: 7px 8px 0 var(--pink); }

.stat-sticker {
  position: absolute;
  top: 12px; right: 10px;
  background: var(--secondary);
  color: var(--base);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 2px solid var(--base);
  border-radius: 5px;
  box-shadow: 2px 2px 0 var(--base);
  transform: rotate(4deg);
  z-index: 2;
}
.stat-sticker--green  { background: var(--green);  color: #fff; }
.stat-sticker--pink   { background: var(--pink);   color: #fff; }
.stat-sticker--orange { background: var(--orange); color: #fff; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--base);
  box-shadow: 3px 3px 0 var(--base);
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.stat-icon--green  { background: var(--green); }
.stat-icon--yellow { background: var(--secondary); color: var(--base); }
.stat-icon--pink   { background: var(--pink); }
.stat-icon--orange { background: var(--orange); }

.stat-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.stat-main .stat-icon {
  margin-bottom: 0;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}
.stat-value {
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  position: relative;
  z-index: 1;
}
.stat-hint {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--grey);
  margin-top: 0.65rem;
  position: relative;
  z-index: 1;
}
/* ================================================================
   INSIGHTS : graphique 14j (gauche) + totaux empilés (droite)
   ================================================================ */

.insights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.insight-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 5%, #fff) 0%, #fff 50%);
  border: 2.5px solid var(--base);
  border-radius: 1.55rem;
  box-shadow: 7px 7px 0 var(--base);
  padding: 1.5rem 1.3rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}
.insight-card .card-header { margin-bottom: 1.1rem; }

/* --- Activity Curve Chart (atelier style) --- */

.chart-area { position: relative; }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  background: #fffdf7;
  border: 2px solid #e5e2da;
  border-radius: 0.85rem;
  overflow: hidden;
  cursor: crosshair;
}
.chart-svg { display: block; width: 100%; height: 100%; }

.chart-hover-line {
  position: absolute; top: 0; bottom: 0;
  width: 1.5px; background: var(--base);
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease; z-index: 3;
}
.chart-hover-dot {
  position: absolute; width: 10px; height: 10px;
  border-radius: 50%; background: #fff;
  border: 2.5px solid var(--primary);
  box-shadow: 0 2px 6px rgba(57, 5, 200, 0.25);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.12s ease; z-index: 4;
}
.chart-overlay { position: absolute; inset: 0; z-index: 5; }

.chart-tooltip {
  position: absolute; z-index: 10;
  background: var(--base); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 0.45rem 0.8rem; border-radius: 8px;
  pointer-events: none; opacity: 0;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  box-shadow: 3px 3px 0 rgba(0, 194, 107, 0.35);
  transform: translateX(-50%);
}
.chart-tooltip.is-visible { opacity: 1; }
.chart-tooltip-date { font-size: 0.6rem; font-weight: 600; color: #b5ada5; margin-bottom: 2px; }
.chart-tooltip-val  { font-size: 0.85rem; font-weight: 800; }

.chart-axis {
  display: flex; justify-content: space-between;
  padding: 0.45rem 0.15rem 0;
}
.chart-axis-label {
  font-size: 0.78rem; font-weight: 700;
  color: var(--grey); letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chart-legend {
  display: flex; gap: 1.25rem; margin-top: 0.7rem;
  font-size: 0.72rem; font-weight: 700; color: var(--base);
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-legend-dot { width: 18px; height: 3px; border-radius: 2px; }
.chart-legend-dot--purple { background: var(--primary); }
.chart-legend-dot--green  { background: var(--green); }

/* --- Totaux : 2 cartes empilées à droite --- */

.totals-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.total-card {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  background: #fff;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.5rem;
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 150px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.total-card-plays    { box-shadow: 5px 5px 0 var(--primary); }
.total-card-plays:hover    { transform: translate(-2px, -3px); box-shadow: 7px 8px 0 var(--primary); }
.total-card-products { box-shadow: 5px 5px 0 var(--green); }
.total-card-products:hover { transform: translate(-2px, -3px); box-shadow: 7px 8px 0 var(--green); }
.total-card-pending  { box-shadow: 5px 5px 0 var(--orange); }
.total-card-pending:hover  { transform: translate(-2px, -3px); box-shadow: 7px 8px 0 var(--orange); }
.total-card-yellow   { box-shadow: 5px 5px 0 var(--secondary); }
.total-card-yellow:hover   { transform: translate(-2px, -3px); box-shadow: 7px 8px 0 var(--secondary); }

.total-card::before {
  content: "";
  position: absolute;
  top: -30px; right: -30px;
  width: 130px; height: 130px;
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
  transition: transform 0.3s ease;
}
.total-card-plays::before    { background: var(--primary); }
.total-card-products::before { background: var(--green); }
.total-card-pending::before  { background: var(--orange); }
.total-card-yellow::before   { background: var(--secondary); opacity: 0.35; }
.total-card:hover::before    { transform: scale(1.25); }

.total-icon {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 2.5px solid var(--base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 3px 3px 0 var(--base);
  position: relative;
  z-index: 1;
}
.total-icon svg { width: 34px; height: 34px; }
.total-card-plays    .total-icon { background: var(--primary); }
.total-card-products .total-icon { background: var(--green); }
.total-card-pending  .total-icon { background: var(--orange); }
.total-card-yellow   .total-icon { background: var(--secondary); color: var(--base); }

.total-body { flex: 1; min-width: 0; position: relative; z-index: 1; }

.total-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.25rem;
}

.total-value {
  font-size: clamp(3rem, 10vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--base);
}

.total-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--grey);
  margin-top: 0.5rem;
}
/* ================================================================
   QR CARD (hero on dashboard)
   ================================================================ */

.qr-card {
  background: var(--primary);
  color: #fff;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-lg);
  box-shadow: 7px 7px 0 var(--secondary);
  padding: 1.6rem;
  position: relative;
  overflow: hidden;
}
.qr-card::before {
  content: "";
  position: absolute;
  top: -20px; right: -20px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--secondary);
  opacity: 0.25;
}
.qr-card::after {
  content: "";
  position: absolute;
  bottom: -30px; left: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--bg);
  opacity: 0.08;
}
.qr-card .card-title { color: #fff; position: relative; z-index: 1; }
.qr-card .card-num { background: var(--secondary); color: var(--base); }

.qr-sticker {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--secondary);
  color: var(--base);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 2.5px solid var(--base);
  border-radius: 5px;
  box-shadow: 2px 2px 0 var(--base);
  transform: rotate(6deg);
  z-index: 2;
}

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  background: #ffffff;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
  min-height: 280px;
  justify-content: center;
}
.qr-block img, .qr-block canvas, .qr-block svg {
  background: #ffffff;
  display: block;
  max-width: 420px;
  height: auto;
  width: 100%;
}
.qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.1rem;
  position: relative;
  z-index: 1;
}
.qr-actions .btn { width: 100%; padding: 0.85rem 0.8rem; }
.qr-actions .btn-ghost { background: #fff; color: var(--base); }
@media (max-width: 420px) {

  .qr-actions { grid-template-columns: 1fr; }

}

/* ================================================================
   TABLE
   ================================================================ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--bg);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.table th, .table td {
  text-align: left;
  padding: 0.95rem 1rem;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table th {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
  background: var(--bg-alt);
  border-bottom: 2.5px solid var(--base);
}
.table td { font-weight: 700; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: var(--bg); }
.table tr:last-child td { border-bottom: none; }

.code-pill {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  background: var(--base);
  color: var(--secondary);
  padding: 4px 9px;
  border-radius: 5px;
  border: 2px solid var(--base);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.64rem;
  font-weight: 700;
  border: 2px solid var(--base);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--base);
}
.tag-success { background: var(--green);    color: #fff; }
.tag-pending { background: var(--secondary); color: var(--base); }
.tag-close   { background: var(--orange);   color: #fff; }
.tag-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffea29;
  color: #171412;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 2.5px solid #171412;
  border-radius: 50px;
  box-shadow: 3px 3px 0 #171412;
  transform: rotate(3deg);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #171412;
  animation: liveBlink 1.4s ease-in-out infinite;
}
@keyframes liveBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.fid-delete-btn {
  width: 28px;
  height: 28px;
  border: 2px solid var(--base);
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  box-shadow: 2px 2px 0 var(--base);
  padding: 0;
  line-height: 1;
}
.fid-delete-btn:hover {
  background: var(--red);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--base);
}
.fid-delete-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--base);
}

.table .col-actions {
  width: 1%;
  min-width: 76px;
  padding-left: 0.25rem;
  padding-right: 0.75rem;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
.table tr.is-editing .col-actions {
  min-width: 84px;
  padding-right: 0.5rem;
}
.table tr.is-editing .input-inline {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 0.8rem;
}
.table tr.is-editing .btn-del {
  width: 34px;
  height: 34px;
}
.btn-del {
  width: 28px;
  height: 28px;
  border: 2px solid var(--base);
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  box-shadow: 2px 2px 0 var(--base);
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}
.table .col-actions .btn-del + .btn-del {
  margin-left: 0.35rem;
}
.btn-del:hover {
  background: var(--red);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--base);
}
.btn-del:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--base);
}
.btn-del:focus-visible {
  outline: none;
}
.btn-edit {
  background: var(--green);
}
.btn-edit:hover {
  background: var(--green);
}
.btn-save {
  background: var(--green);
}
.btn-save:hover {
  background: var(--green);
}
.btn-cancel {
  background: var(--secondary);
  color: var(--base);
}
.btn-cancel:hover {
  background: var(--secondary);
  color: var(--base);
}

/* ================================================================
   VALIDER (page scan)
   ================================================================ */

.valider-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.valider-side { display: flex; flex-direction: column; gap: 1.25rem; }
.valider-side .card + .card { margin-top: 0; }

/* Hero scan */
.scan-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  min-height: 280px;
  padding: 2.25rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: 3px solid var(--base);
  border-radius: var(--radius-lg);
  box-shadow: 6px 6px 0 var(--base);
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  font: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.scan-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 234, 41, 0.18) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.9;
  pointer-events: none;
}
.scan-hero:hover  { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--base); }
.scan-hero:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--base); }
.scan-hero:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }

.scan-hero-pulse {
  position: relative;
  width: 128px; height: 128px;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.scan-hero-ring {
  position: absolute; inset: 0;
  border: 3px solid var(--secondary);
  border-radius: 50%;
  opacity: 0;
  animation: scan-hero-pulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.scan-hero-ring-2 { animation-delay: 0.8s; }
.scan-hero-ring-3 { animation-delay: 1.6s; }
@keyframes scan-hero-pulse {
  0%   { transform: scale(0.55); opacity: 0.95; }
  70%  { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1.15); opacity: 0; }
}
.scan-hero-icon {
  position: relative;
  width: 76px; height: 76px;
  color: var(--secondary);
  z-index: 2;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.35));
}
.scan-hero-title {
  position: relative; z-index: 1;
  font-family: "Labil", Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: none;
}
.scan-hero-sub {
  position: relative; z-index: 1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--secondary);
  color: var(--base);
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid var(--base);
  box-shadow: 3px 3px 0 var(--base);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transform: rotate(-1.5deg);
}

/* Code input */
.code-input {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 1.05rem;
  text-align: center;
}

/* Tips list */
.tips-list { list-style: none; padding: 0; margin: 0; counter-reset: tip; }
.tips-list li {
  counter-increment: tip;
  position: relative;
  padding: 0.7rem 0 0.7rem 2.65rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--base);
  border-bottom: 1px dashed var(--line);
}
.tips-list li:last-child { border-bottom: none; }
.tips-list li::before {
  content: counter(tip);
  position: absolute;
  left: 0; top: 0.55rem;
  width: 28px; height: 28px;
  background: var(--secondary);
  color: var(--base);
  border: 2px solid var(--base);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 2px 2px 0 var(--base);
}

/* Validation result */
.valid-result-wrap:not(:empty) { margin-top: 1.25rem; }

.valid-result {
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 2.5px solid var(--base);
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
  text-align: center;
}
.valid-result.ok   { background: color-mix(in srgb, var(--green) 20%, #fff); box-shadow: 5px 5px 0 var(--green); }
.valid-result.ko   { background: color-mix(in srgb, var(--red)   15%, #fff); box-shadow: 5px 5px 0 var(--red); }
.valid-result.reward {
  background: color-mix(in srgb, var(--secondary) 30%, #fff);
  box-shadow: 5px 5px 0 var(--pink);
  position: relative;
  overflow: hidden;
}
.valid-result.reward::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255, 102, 188, 0.14) 2px, transparent 2px);
  background-size: 18px 18px;
  pointer-events: none;
}
.valid-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: 0.5rem; position: relative; z-index: 1; }
.valid-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.35rem; letter-spacing: -0.02em; position: relative; z-index: 1; }
.valid-meta  { font-size: 0.82rem; color: var(--grey); font-weight: 700; line-height: 1.5; position: relative; z-index: 1; }
.valid-meta + .valid-meta { margin-top: 4px; }
/* ================================================================
   SCANNER QR (modale)
   ================================================================ */

.scan-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  background: rgba(23, 20, 18, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: scan-modal-in 0.2s ease-out;
}
@keyframes scan-modal-in { from { opacity: 0; } to { opacity: 1; } }

.scan-modal-card {
  background: var(--card);
  border: 3px solid var(--base);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 var(--primary);
  width: min(100%, 460px);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scan-card-in 0.25s cubic-bezier(0.18, 0.9, 0.35, 1.1);
}
@keyframes scan-card-in {
  from { transform: translateY(14px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.scan-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  border-bottom: 2.5px solid var(--base);
  background: var(--bg-alt);
}
.scan-modal-title { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }
.scan-modal-close {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  background: var(--card);
  color: var(--base);
  border: 2.5px solid var(--base);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--base);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.scan-modal-close:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--base); }
.scan-modal-close:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--base); }

.scan-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0b0a09;
  overflow: hidden;
}
#scan-video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.scan-frame {
  position: absolute;
  inset: 14%;
  pointer-events: none;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}
.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  width: 42px; height: 42px;
  border: 4px solid #fff;
  border-radius: 6px;
}
.scan-frame::before { top: -4px; left: -4px; border-right: none; border-bottom: none; }
.scan-frame::after  { bottom: -4px; right: -4px; border-left: none; border-top: none; }

.scan-stage::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 14%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 14px var(--primary);
  animation: scan-sweep 2.2s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes scan-sweep {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translateY(500%); opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}

.scan-status {
  padding: 0.9rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--base);
  background: var(--card);
  border-top: 2.5px solid var(--base);
  min-height: 2.5rem;
}
.scan-status.is-ok    { background: color-mix(in srgb, var(--green) 25%, #fff); color: var(--base); }
.scan-status.is-error { background: color-mix(in srgb, var(--red) 18%, #fff); color: var(--base); }

@media (max-height: 640px) {

  .scan-modal { padding: 0; align-items: stretch; }
  .scan-modal-card {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
  .scan-stage { aspect-ratio: auto; flex: 1; }

}
/* ================================================================
   GRID HELPERS
   ================================================================ */

.stack-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
/* Titres et numéros de section — plus grands (aligné sur La Roue) */
.card-title { font-size: 1.6rem; gap: 1rem; }
.card-num   { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 11px; box-shadow: 3px 3px 0 var(--base); }

/* Header page — tailles alignées sur La Roue */
.page-title    { font-size: 3.5rem; }
.page-subtitle { font-size: 1.15rem; }

/* ================================================================
   SAVE BAR
   ================================================================ */

.save-bar {
  position: sticky;
  bottom: 70px;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0 0.5rem;
  z-index: 5;
  flex-wrap: wrap;
  align-items: center;
}
.save-bar .btn { flex: 1 1 auto; min-width: 120px; }
.save-bar .btn-danger { flex: 0 0 auto; }

/* ================================================================
   LOGOUT / UTILS shared
   ================================================================ */

.config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 0.25rem;
}
.config-form-col { display: flex; flex-direction: column; }
.config-form-col .card + .card { margin-top: 1.25rem; }


/* ================================================================
   DESKTOP (min-width: 900px)
   ================================================================ */

@media (min-width: 900px) {

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  .stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .stats-grid-3 .stat-card:nth-child(3) { grid-column: auto; }
  .stat-card { padding: 1.75rem 1.5rem; min-height: 180px; }
  .stat-card::before { width: 120px; height: 120px; }

  .insights-grid {
    grid-template-columns: 1fr 1.3fr;
    gap: 1.75rem;
    margin-bottom: 2rem;
    align-items: stretch;
  }
  .insight-card { padding: 2rem; }
  .chart-wrap { height: 240px; }
  .totals-stack { gap: 1rem; }
  .total-card { padding: 1.55rem 1.5rem; min-height: 140px; gap: 1.1rem; }
  .total-icon { width: 72px; height: 72px; flex-basis: 72px; border-radius: 18px; }
  .total-icon svg { width: 38px; height: 38px; }
  .total-value { font-size: clamp(3.2rem, 4vw, 4rem); }

  .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
  .grid-2-qr {
    grid-template-columns: 1fr 0.75fr;
  }

  .config-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
  }
  .config-form-col { min-width: 0; }

  .valider-grid {
    grid-template-columns: 1.25fr 1fr;
    gap: 1.75rem;
    align-items: stretch;
  }
  .scan-hero { min-height: 100%; padding: 3rem 2rem; }
  .scan-hero-pulse { width: 160px; height: 160px; }
  .scan-hero-icon  { width: 96px; height: 96px; }
  .scan-hero-title { font-size: 2.1rem; }

  .qr-card { padding: 2rem; }
  .qr-block { min-height: 380px; padding: 1.5rem; }

  .save-bar { position: static; justify-content: flex-end; }
  .save-bar .btn { flex: 0 0 auto; }
  .save-bar .btn-danger { margin-right: auto; }

}

.char-counter {
  text-align: right;
  margin-top: 0.35rem;
  font-size: 0.68rem;
}
.char-counter.is-limit {
  color: var(--orange);
}

.fid-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fid-alert {
  padding: 0.85rem 1rem;
  border: 2px solid var(--base);
  border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 var(--base);
  font-size: 0.82rem;
  font-weight: 800;
}

.fid-alert.is-success {
  background: color-mix(in srgb, var(--green) 22%, #fff);
}

.fid-alert.is-error {
  background: color-mix(in srgb, var(--red) 18%, #fff);
}

.fid-table-wrap {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem;
}

.fid-table-wrap table { table-layout: fixed; width: 100%; }
.fid-table-wrap td,
.fid-table-wrap th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Table historique des points : Points épinglée à droite */
.fid-table-wrap table:has(#history-list) th:nth-child(1),
.fid-table-wrap table:has(#history-list) td:nth-child(1) { width: 14%; }
.fid-table-wrap table:has(#history-list) th:nth-child(2),
.fid-table-wrap table:has(#history-list) td:nth-child(2) { width: 22%; }
.fid-table-wrap table:has(#history-list) th:nth-child(3),
.fid-table-wrap table:has(#history-list) td:nth-child(3) { width: 14%; }
.fid-table-wrap table:has(#history-list) th:nth-child(4),
.fid-table-wrap table:has(#history-list) td:nth-child(4) { width: auto; }
.fid-table-wrap table:has(#history-list) th:last-child,
.fid-table-wrap table:has(#history-list) td:last-child {
  width: 90px;
  text-align: right;
}
.fid-table-wrap::-webkit-scrollbar { width: 4px; }
.fid-table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.fid-empty-row {
  padding: 1.25rem;
  text-align: center;
  color: var(--grey);
  font-weight: 800;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.75rem;
  border: 2px solid var(--primary);
  border-radius: 999px;
  box-shadow: none;
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}
.points-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.65rem;
  border: 2px solid var(--base);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--base);
  background: var(--bg);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.points-pill.is-positive {
  background: color-mix(in srgb, var(--green) 22%, #fff);
  color: var(--base);
}

.points-pill.is-negative {
  background: color-mix(in srgb, var(--orange) 22%, #fff);
  color: var(--base);
}

.color-presets {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.color-preset {
  width: 44px;
  height: 44px;
  border: 2.5px solid var(--base);
  border-radius: 999px;
  background: var(--c);
  box-shadow: 3px 3px 0 var(--base);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-preset:hover,
.color-preset.is-active {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--base);
}

.scan-result-wrap:not(:empty) {
  margin-top: 1.5rem;
}

.scan-client-card {
  overflow: hidden;
}

.scan-client-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--line);
}

.client-avatar-xl {
  width: 64px;
  height: 64px;
  border: 2.5px solid var(--base);
  border-radius: 50%;
  background: var(--secondary);
  color: var(--base);
  box-shadow: 4px 4px 0 var(--base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
}

.scan-client-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
}

.scan-client-head p {
  margin: 0;
  color: var(--grey);
  font-weight: 700;
}

.scan-points {
  min-width: 120px;
  padding: 0.75rem 1rem;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  box-shadow: 4px 4px 0 var(--base);
  text-align: center;
}

.scan-points span {
  display: block;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
}

.scan-points strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
}

.scan-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
  align-items: start;
}

.scan-action-box {
  padding: 1rem;
  border: 2px solid var(--base);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: 3px 3px 0 var(--base);
}

.scan-action-box label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
}

.scan-input-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scan-input-row .input,
.scan-input-row .btn {
  width: 100%;
}

/* Mode "fixe par visite" : ticket néo-brut affichant les points à créditer */
.scan-visit-ticket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 1.1rem 1.1rem;
  background: #fff;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0 var(--primary);
}

.scan-visit-ticket-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.05em;
  margin: 0.15rem 0 0.05rem;
  color: var(--primary);
  line-height: 1;
}
.scan-visit-ticket-sign {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.scan-visit-ticket-num {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.scan-visit-ticket-unit {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 0.18em;
  color: var(--base);
}

.scan-visit-ticket-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
  text-align: center;
}

.reward-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.reward-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--base);
  border-radius: var(--radius-sm);
  background: var(--secondary);
  color: var(--base);
  box-shadow: 3px 3px 0 var(--base);
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.reward-action:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--base);
}

.reward-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.reward-action > span {
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
  overflow: hidden;
}

.reward-action strong,
.reward-action small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-action strong {
  font-size: 0.92rem;
  font-weight: 900;
}

.reward-action small {
  margin-top: 0.15rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.reward-action b {
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.reward-emoji-big {
  font-size: 1.9rem;
  line-height: 1;
  flex-shrink: 0;
  margin-right: 0.65rem;
}

.scan-actions-grid > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .scan-actions-grid {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

/* ================================================================
   CARD-LEAD — Texte d'intro sous un card-header
   ================================================================ */

.card-lead {
  margin: -0.5rem 0 1rem;
  font-size: 0.86rem;
  color: var(--grey);
  font-weight: 600;
  line-height: 1.5;
}

/* ================================================================
   THEME PICKER — Layout gauche/droite (config page)
   ================================================================ */

.theme-picker {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  align-items: stretch;
}
@media (max-width: 640px) {
  .theme-picker { flex-direction: column; }
}

/* ---- Liste des thèmes ---- */
.theme-list {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
@media (max-width: 640px) {
  .theme-list { flex: none; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
}

.theme-list-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
  user-select: none;
}
.theme-list-item:hover {
  border-color: var(--primary);
  background: transparent;
}
.theme-list-item.is-selected {
  border-color: var(--primary);
  background: transparent;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
  .theme-list-item { flex: 1 1 calc(50% - 0.2rem); min-width: 0; }
}

.theme-dot {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
}
.theme-dot-dark     { background: linear-gradient(135deg, #7700ff 30%, #0e0c1e); }
.theme-dot-tropical { background: linear-gradient(135deg, #ffd83c, #ff8c42); }
.theme-dot-minimal  { background: linear-gradient(135deg, #f0f0f0, #d8d8d8); border: 1.5px solid #ccc; }
.theme-dot-luxury   { background: linear-gradient(135deg, #d4af37 40%, #0a0a0a); }
.theme-dot-neo      { background: #fbf9ef; border: 2px solid #171412; box-shadow: 2px 2px 0 #171412; }

.theme-list-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.theme-list-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--base);
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-list-item.is-selected .theme-list-name { color: var(--primary); }

.theme-check {
  flex-shrink: 0;
  opacity: 0;
  color: var(--primary);
  transition: opacity 0.14s;
}
.theme-list-item.is-selected .theme-check { opacity: 1; }

/* ---- Panel aperçu ---- */
.theme-preview-panel {
  flex: 1 1 50%;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.tmock-label {
  position: absolute;
  top: 8px; right: 10px;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  z-index: 5;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.theme-mockup {
  width: 100%; height: 100%;
  min-height: 300px;
  padding: 1.8rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  justify-content: center;
  position: relative;
  transition: none;
}
.theme-mockup::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: background 0.35s ease;
}
.theme-mockup > * { position: relative; z-index: 1; }

/* ---- Backgrounds par thème ---- */
.theme-mockup[data-theme="playful"]::before {
  background:
    radial-gradient(circle at 20% -10%, rgba(57,5,200,0.3) 0%, transparent 55%),
    radial-gradient(circle at 100% 20%, rgba(255,234,41,0.35) 0%, transparent 55%),
    linear-gradient(180deg, #fbf9ef, #f5f2ea);
}
.theme-mockup[data-theme="dark"]::before {
  background:
    radial-gradient(circle at 15% -5%,  rgba(119,0,255,0.55) 0%, transparent 55%),
    radial-gradient(circle at 95% 15%,  rgba(255,0,119,0.4)  0%, transparent 50%),
    linear-gradient(180deg, #0e0c1e, #12102a);
}
.theme-mockup[data-theme="tropical"]::before {
  background:
    radial-gradient(circle at 20% -10%, rgba(255,100,30,0.5)  0%, transparent 55%),
    radial-gradient(circle at 100% 20%, rgba(255,210,40,0.65) 0%, transparent 55%),
    linear-gradient(180deg, #fff6e0, #fffbf3);
}
.theme-mockup[data-theme="minimal"]::before {
  background: linear-gradient(180deg, #f8f8f8, #f0f0f0);
}
.theme-mockup[data-theme="luxury"]::before {
  background:
    radial-gradient(circle at 20% -10%, rgba(212,175,55,0.22) 0%, transparent 55%),
    radial-gradient(circle at 100% 20%, rgba(212,175,55,0.12) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a0a, #110f06);
}
.theme-mockup[data-theme="neo"]::before {
  background: linear-gradient(180deg, #fbf9ef, #f5f2ea);
}
.theme-mockup[data-theme="pastel"]::before {
  background:
    radial-gradient(circle at 20% -10%, #ffd6e0 0%, transparent 55%),
    radial-gradient(circle at 100% 20%, #c1e3ff 0%, transparent 55%),
    linear-gradient(180deg, #fff5f7, #f0f6ff);
}
.theme-mockup[data-theme="ocean"]::before {
  background:
    radial-gradient(circle at 20% -10%, rgba(0,180,216,0.4) 0%, transparent 55%),
    radial-gradient(circle at 100% 20%, rgba(0,119,182,0.3) 0%, transparent 50%),
    linear-gradient(180deg, #0a1628, #0d2137);
}
.theme-mockup[data-theme="sunset"]::before {
  background:
    radial-gradient(circle at 20% -10%, rgba(255,107,107,0.5) 0%, transparent 55%),
    radial-gradient(circle at 100% 20%, rgba(255,201,60,0.5) 0%, transparent 55%),
    linear-gradient(180deg, #fff5f0, #fffbe8);
}

/* ---- Brand chip ---- */
.tmock-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.7rem 0.38rem 0.45rem;
  border-radius: 100px;
  width: fit-content;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 4px 12px -4px rgba(101,52,200,0.2);
  transition: background 0.3s, border 0.3s, box-shadow 0.3s, border-radius 0.3s;
}
.tmock-chip-logo { font-size: 1.6rem; line-height: 1; }
.tmock-chip-badge {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7fb5;
  line-height: 1;
}
.tmock-chip-name { font-size: 1.1rem; font-weight: 900; line-height: 1.2; color: #141027; }

.theme-mockup[data-theme="dark"] .tmock-chip {
  background: #1e1a35;
  box-shadow: 0 4px 12px -4px rgba(119,0,255,0.35);
}
.theme-mockup[data-theme="dark"] .tmock-chip-badge  { color: #7266b0; }
.theme-mockup[data-theme="dark"] .tmock-chip-name   { color: #f0eaff; }
.theme-mockup[data-theme="luxury"] .tmock-chip {
  background: #1a1608;
  border: 1px solid rgba(212,175,55,0.35);
  box-shadow: none;
}
.theme-mockup[data-theme="luxury"] .tmock-chip-badge { color: #8a7a5a; }
.theme-mockup[data-theme="luxury"] .tmock-chip-name  { color: #f8f0d8; }
.theme-mockup[data-theme="neo"] .tmock-chip {
  border-radius: 8px;
  border: 2px solid #171412;
  box-shadow: 3px 3px 0 #171412;
  background: var(--bg);
}
.theme-mockup[data-theme="neo"] .tmock-chip-badge { color: #7a7068; }
.theme-mockup[data-theme="ocean"] .tmock-chip {
  background: rgba(10,22,40,0.85);
  box-shadow: 0 4px 12px -4px rgba(0,119,182,0.35);
}
.theme-mockup[data-theme="ocean"] .tmock-chip-badge  { color: #5ba8c8; }
.theme-mockup[data-theme="ocean"] .tmock-chip-name   { color: #c8ecff; }

/* ---- Title ---- */
.tmock-title {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #141027;
  text-align: center;
  padding: 0 0.2rem;
}
.tmock-hl { color: #3905c8; font-style: italic; }
.theme-mockup[data-theme="dark"]     .tmock-title { color: #f0eaff; }
.theme-mockup[data-theme="dark"]     .tmock-hl    { color: #a78bff; }
.theme-mockup[data-theme="luxury"]   .tmock-title { color: #f8f0d8; }
.theme-mockup[data-theme="luxury"]   .tmock-hl    { color: #d4af37; }
.theme-mockup[data-theme="tropical"] .tmock-title { color: #2a1400; }
.theme-mockup[data-theme="tropical"] .tmock-hl    { color: #ff8c42; }
.theme-mockup[data-theme="minimal"]  .tmock-title { color: #222; }
.theme-mockup[data-theme="neo"]      .tmock-title { color: #171412; }
.theme-mockup[data-theme="ocean"]    .tmock-title { color: #c8ecff; }
.theme-mockup[data-theme="ocean"]    .tmock-hl    { color: #00b4d8; }

/* ---- How-card ---- */
.tmock-card {
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 0.7rem 1.8rem;
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.5rem;
  box-shadow: 0 6px 14px -4px rgba(101,52,200,0.16);
  border: 1.5px solid rgba(122,75,255,0.1);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, border-radius 0.3s;
}
.tmock-card-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.tmock-card-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #141027;
  line-height: 1.25;
}
.theme-mockup[data-theme="dark"] .tmock-card {
  background: #1e1a35;
  border-color: rgba(138,91,255,0.22);
  box-shadow: 0 6px 14px -4px rgba(119,0,255,0.25);
}
.theme-mockup[data-theme="dark"] .tmock-card-text    { color: #f0eaff; }
.theme-mockup[data-theme="luxury"] .tmock-card {
  background: #1a1608;
  border-color: rgba(212,175,55,0.22);
  box-shadow: 0 6px 14px -4px rgba(212,175,55,0.12);
}
.theme-mockup[data-theme="luxury"] .tmock-card-text  { color: #f8f0d8; }
.theme-mockup[data-theme="tropical"] .tmock-card {
  border-color: rgba(255,140,66,0.14);
  box-shadow: 0 6px 14px -4px rgba(255,100,0,0.14);
}
.theme-mockup[data-theme="minimal"] .tmock-card {
  border-color: #e8e8e8;
  box-shadow: 0 2px 8px -2px rgba(0,0,0,0.09);
}
.theme-mockup[data-theme="neo"] .tmock-card {
  border-radius: 8px;
  border: 2px solid #171412;
  box-shadow: 3px 3px 0 #171412;
  background: var(--bg);
}
.theme-mockup[data-theme="ocean"] .tmock-card {
  background: rgba(10,22,40,0.85);
  border-color: rgba(0,180,216,0.18);
  box-shadow: 0 6px 14px -4px rgba(0,119,182,0.25);
}
.theme-mockup[data-theme="ocean"] .tmock-card-text   { color: #c8ecff; }

/* ---- CTA button ---- */
.tmock-btn {
  background: #3905c8;
  color: #fff;
  border-radius: 14px;
  font-size: 1.15rem;
  padding: 1rem 3rem;
  font-weight: 900;
  text-align: center;
  align-self: center;
  width: auto;
  box-shadow: 0 4px 0 #2403a0, 0 6px 12px -4px rgba(57,5,200,0.4);
  transition: background 0.3s, box-shadow 0.3s, border-radius 0.3s, border 0.3s, color 0.3s;
}
.theme-mockup[data-theme="tropical"] .tmock-btn {
  background: #ff8c42;
  box-shadow: 0 4px 0 #cc5500, 0 6px 12px -4px rgba(255,100,0,0.4);
}
.theme-mockup[data-theme="luxury"] .tmock-btn {
  background: #d4af37;
  color: #0a0a0a;
  box-shadow: 0 4px 0 #8a6400, 0 6px 12px -4px rgba(212,175,55,0.4);
}
.theme-mockup[data-theme="minimal"] .tmock-btn {
  background: #222;
  box-shadow: 0 4px 0 #000, 0 6px 12px -4px rgba(0,0,0,0.25);
}
.theme-mockup[data-theme="neo"] .tmock-btn {
  border-radius: 8px;
  border: 2px solid #171412;
  box-shadow: 4px 4px 0 #171412;
}
.theme-mockup[data-theme="ocean"] .tmock-btn {
  background: #00b4d8;
  box-shadow: 0 4px 0 #0077b6, 0 6px 12px -4px rgba(0,119,182,0.4);
}

/* ---- Pastel ---- */
.theme-mockup[data-theme="pastel"] .tmock-title  { color: #5a4070; }
.theme-mockup[data-theme="pastel"] .tmock-hl     { color: #e86ca0; }
.theme-mockup[data-theme="pastel"] .tmock-card    { border-color: rgba(200,160,220,0.2); }
.theme-mockup[data-theme="pastel"] .tmock-btn     { background: #e86ca0; box-shadow: 0 4px 0 #c0407a, 0 6px 12px -4px rgba(232,108,160,0.4); }
/* ---- Sunset ---- */
.theme-mockup[data-theme="sunset"] .tmock-title  { color: #4a1a00; }
.theme-mockup[data-theme="sunset"] .tmock-hl     { color: #ff6b6b; }
.theme-mockup[data-theme="sunset"] .tmock-card    { border-color: rgba(255,107,107,0.15); box-shadow: 0 6px 14px -4px rgba(255,107,107,0.15); }
.theme-mockup[data-theme="sunset"] .tmock-btn     { background: #ff6b6b; box-shadow: 0 4px 0 #d94444, 0 6px 12px -4px rgba(255,107,107,0.4); }

/* ================================================================
   CANAL TOGGLES — Collecte d'infos (config page)
   ================================================================ */

.canaux-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.canal-item {
  background: var(--bg);
  border: 2.5px solid var(--base);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.canal-item:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--base);
}
.canal-item.is-on {
  background: color-mix(in srgb, var(--primary) 7%, #fff);
}

.canal-toggle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  user-select: none;
}
.canal-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.canal-toggle-ico {
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid var(--base);
  box-shadow: 2px 2px 0 var(--base);
  background: var(--secondary);
  color: var(--base);
}
.canal-toggle-ico svg { width: 20px; height: 20px; }
.canal-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.canal-toggle-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--base);
  line-height: 1.2;
}
.canal-toggle-sub {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--grey);
  line-height: 1.3;
}

/* Switch pill */
.canal-toggle-switch {
  position: relative;
  width: 44px; height: 26px;
  border-radius: 100px;
  background: var(--line);
  border: 2px solid var(--base);
  flex-shrink: 0;
  transition: background 0.18s ease;
}
.canal-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--base);
  transition: transform 0.2s ease, background 0.2s ease;
}
.canal-item.is-on .canal-toggle-switch {
  background: var(--primary);
}
.canal-item.is-on .canal-toggle-switch::after {
  transform: translateX(18px);
  background: var(--secondary);
}

/* Locked row */
.canal-item.is-locked {
  cursor: default;
  pointer-events: none;
  background: #f5f2ea;
  border-color: #c8c4bc;
  box-shadow: 3px 3px 0 #c8c4bc;
}
.canal-item.is-locked .canal-toggle { cursor: default; }
.canal-item.is-locked .canal-toggle-ico {
  border-color: #c8c4bc;
  box-shadow: 2px 2px 0 #c8c4bc;
  background: #e8e4da;
  color: #8e827c;
}
.canal-item.is-locked .canal-toggle-title { color: var(--grey); }
.canal-item.is-locked .canal-toggle-switch { background: #c8c4bc; }
.canal-item.is-locked .canal-toggle-switch::after {
  transform: translateX(18px);
  background: var(--bg);
}

/* Badge "Obligatoire" */
.field-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1em 0.55em;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--secondary);
  border: 1.5px solid var(--base);
  border-radius: 6px;
  color: var(--base);
  vertical-align: middle;
  line-height: 1.6;
}

/* ================================================================
   OVERRIDES — #card-collecte (match roulette #card-protection look)
   ================================================================ */

#card-collecte .canaux-list {
  gap: 0.7rem;
  margin-top: 1rem;
}
#card-collecte .canal-item {
  background: #fff;
}
#card-collecte .canal-item.is-on {
  background: color-mix(in srgb, var(--primary) 7%, #fff);
}
#card-collecte .canal-toggle-ico {
  background: var(--secondary);
}
#card-collecte .canal-item.is-locked {
  background: #f5f2ea;
  border-color: #c8c4bc;
  box-shadow: 3px 3px 0 #c8c4bc;
}
#card-collecte .canal-item.is-locked .canal-toggle-ico {
  border-color: #c8c4bc;
  box-shadow: 2px 2px 0 #c8c4bc;
  background: var(--secondary);
  color: #8e827c;
  opacity: 0.85;
}
#card-collecte .canal-toggle-switch {
  border: 2px solid var(--base);
  box-shadow: 2px 2px 0 var(--base);
}
#card-collecte .canal-item.is-locked .canal-toggle-switch {
  background: #c8c4bc;
  border-color: var(--base);
  box-shadow: 2px 2px 0 var(--base);
}
#card-collecte .canal-item.is-locked .canal-toggle-switch::after {
  transform: translateX(18px);
  background: #fff;
}

/* ================================================================
   SAVE BAR — Sticky save button (config page)
   ================================================================ */

.save-bar {
  position: sticky;
  bottom: 70px;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 2.5px solid var(--base);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0 0.5rem;
  z-index: 10;
  flex-wrap: wrap;
  align-items: center;
}
.save-bar .btn { flex: 1 1 auto; min-width: 120px; }

@media (min-width: 900px) {
  .save-bar {
    position: static;
    justify-content: flex-end;
  }
  .save-bar .btn { flex: 0 0 auto; }
}

.result-close-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 34px;
  height: 34px;
  border: 2.5px solid var(--base);
  border-radius: 10px;
  background: #fff;
  color: var(--base);
  box-shadow: 3px 3px 0 var(--base);
  font: inherit;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.result-close-btn:hover  { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--base); }
.result-close-btn:active { transform: translate(1px, 1px);   box-shadow: 1px 1px 0 var(--base); }
