/* ==========================================================================
   Zalando Alerts — thème moderne
   Dark premium : dégradés, glassmorphism, micro-animations.
   ========================================================================== */

:root {
  --bg0: #05070f;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(151, 164, 209, 0.16);
  --border-strong: rgba(151, 164, 209, 0.3);
  --text: #eef1fb;
  --muted: #97a1c1;
  --faint: #67708f;
  --violet: #8b5cf6;
  --blue: #3aa0ff;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #3aa0ff 58%, #22d3ee 100%);
  --green: #2fd47a;
  --red: #ff5d6c;
  --orange: #ffb253;
  --gray: #8b94ad;
  --green-bg: rgba(47, 212, 122, 0.13);
  --red-bg: rgba(255, 93, 108, 0.13);
  --orange-bg: rgba(255, 178, 83, 0.13);
  --gray-bg: rgba(139, 148, 173, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-disp: "Space Grotesk", "Inter", system-ui, sans-serif;
  --shadow: 0 22px 60px -24px rgba(0, 0, 0, 0.75);
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grille de fond très subtile */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% -10%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% -10%, #000 25%, transparent 78%);
}

.hidden { display: none !important; }

/* --- Halos lumineux animés en arrière-plan -------------------------------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: blobFloat 26s ease-in-out infinite alternate;
}
.blob-1 {
  width: 540px; height: 540px;
  background: radial-gradient(circle at 30% 30%, #7c3aed, transparent 70%);
  top: -180px; left: -140px;
}
.blob-2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle at 60% 40%, #2563eb, transparent 70%);
  top: 18%; right: -180px;
  animation-delay: -9s;
}
.blob-3 {
  width: 440px; height: 440px;
  background: radial-gradient(circle at 50% 50%, #0891b2, transparent 70%);
  bottom: -200px; left: 30%;
  opacity: 0.35;
  animation-delay: -17s;
}
@keyframes blobFloat {
  to { transform: translate3d(46px, -34px, 0) scale(1.07); }
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px 64px;
  position: relative;
  z-index: 1;
}

/* --- Barre supérieure ----------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(5, 7, 15, 0.72);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px -10px rgba(99, 102, 241, 0.8);
}
.brand-icon svg { width: 22px; height: 22px; }
.brand-icon.lg { width: 62px; height: 62px; border-radius: 19px; }
.brand-icon.lg svg { width: 30px; height: 30px; }
.brand h1 {
  margin: 0;
  font-family: var(--font-disp);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.brand h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  background: var(--surface);
}
.live-indicator .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(47, 212, 122, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(47, 212, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 212, 122, 0); }
}

.env-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 12px;
}
.env-chip.dev { background: var(--violet); color: #fff; box-shadow: 0 6px 20px -8px rgba(139, 92, 246, 0.9); }
.env-chip.prd { background: var(--green-bg); color: var(--green); border: 1px solid rgba(47, 212, 122, 0.35); }

/* --- Boutons -------------------------------------------------------------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 28px -12px rgba(99, 102, 241, 0.8);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 16px 34px -12px rgba(99, 102, 241, 0.95);
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); background: var(--surface-strong); }
.btn-danger {
  background: var(--red-bg);
  border: 1px solid rgba(255, 93, 108, 0.4);
  color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: rgba(255, 93, 108, 0.22); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn .spin {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Page de connexion ---------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 24px 20px;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: 100%;
  max-width: 424px;
  background: rgba(15, 20, 40, 0.62);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 38px 34px 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 10px; }
.auth-brand h1 {
  margin: 0;
  font-family: var(--font-disp);
  font-size: 1.55rem;
  font-weight: 600;
}
.auth-brand h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 24px;
}
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-legal {
  text-align: center;
  color: var(--faint);
  font-size: 0.78rem;
  margin: 22px 0 0;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* --- Champs de formulaire ------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
input[type="text"], input[type="password"], input[type="number"], input[type="email"] {
  width: 100%;
  background: rgba(5, 7, 15, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-ui);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: var(--faint); }
input:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }

/* --- Cartes ----------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px -26px rgba(0, 0, 0, 0.85);
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h2 {
  margin: 0;
  font-family: var(--font-disp);
  font-size: 1.12rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head .card-ico {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--violet);
  display: grid; place-items: center;
}
.card-head .card-ico svg { width: 15px; height: 15px; }
.card-desc { margin: 3px 0 0; color: var(--muted); font-size: 0.85rem; }

/* --- Bandeau de statistiques ---------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 26px 0 22px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: border-color 0.25s ease, transform 0.2s ease;
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0.85;
}
.stat-card.green::after { background: var(--green); }
.stat-card.red::after { background: var(--red); }
.stat-card .stat-value {
  font-family: var(--font-disp);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-card.green .stat-value { color: var(--green); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card .stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-top: 5px;
}

/* --- Formulaires ------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 18px; }
.form-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }

.check { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 0.88rem; font-weight: 500; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark {
  width: 19px; height: 19px;
  flex: none;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: rgba(5, 7, 15, 0.45);
  display: grid; place-items: center;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.check input:checked + .checkmark {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.8);
}
.checkmark svg { width: 11px; height: 11px; color: #fff; opacity: 0; transform: scale(0.4); transition: 0.18s ease; }
.check input:checked + .checkmark svg { opacity: 1; transform: scale(1); }

.preview-link { color: var(--cyan); font-size: 0.84rem; font-weight: 600; text-decoration: none; }
.preview-link:hover { text-decoration: underline; }

.form-alert { margin: 0; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.form-alert.error { color: var(--red); }
.form-alert.ok { color: var(--green); }

/* --- Liste d'alertes -------------------------------------------------------- */
.count-badge {
  min-width: 32px; height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.8);
}
.alerts-list { display: flex; flex-direction: column; gap: 14px; }

.alert-card {
  display: flex;
  background: rgba(5, 7, 15, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease, opacity 0.3s ease;
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.alert-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.95); }
.alert-accent { width: 5px; flex: none; background: var(--gray); }
.alert-card.st-AVAILABLE .alert-accent { background: var(--green); box-shadow: 0 0 14px rgba(47, 212, 122, 0.45); }
.alert-card.st-SOLD_OUT .alert-accent { background: var(--red); box-shadow: 0 0 14px rgba(255, 93, 108, 0.4); }
.alert-card.st-ERROR .alert-accent, .alert-card.st-UNKNOWN .alert-accent { background: var(--orange); box-shadow: 0 0 14px rgba(255, 178, 83, 0.4); }
.alert-card.is-disabled { opacity: 0.72; }
.alert-body { flex: 1; padding: 18px 20px; min-width: 0; }

.alert-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.alert-title {
  margin: 0 0 3px;
  font-family: var(--font-disp);
  font-size: 1.04rem;
  font-weight: 600;
}
.alert-sub { color: var(--faint); font-size: 0.8rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.AVAILABLE { background: var(--green-bg); color: var(--green); }
.pill.SOLD_OUT { background: var(--red-bg); color: var(--red); }
.pill.ERROR, .pill.UNKNOWN { background: var(--orange-bg); color: var(--orange); }
.pill.OFF { background: var(--gray-bg); color: var(--gray); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}
.chip b { color: var(--text); font-weight: 600; }
.chip .chip-ico { width: 13px; height: 13px; opacity: 0.85; }

.alert-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.last-check { color: var(--faint); font-size: 0.76rem; display: inline-flex; align-items: center; gap: 7px; }
.last-check svg { width: 13px; height: 13px; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-now { font-family: var(--font-disp); font-weight: 700; font-size: 1.02rem; color: var(--text); }
.price-old { color: var(--faint); text-decoration: line-through; font-size: 0.8rem; }

.row-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-strong); transform: translateY(-1px); }
.icon-btn.danger:hover { color: var(--red); border-color: rgba(255, 93, 108, 0.5); background: var(--red-bg); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.switch { position: relative; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: 0.22s ease; }
.slider::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  left: 3px; top: 3px;
  transition: 0.22s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.switch input:checked + .slider { background: var(--grad); box-shadow: 0 4px 16px -6px rgba(99, 102, 241, 0.9); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: 0.45; }

/* --- Historique ------------------------------------------------------------- */
.history { margin-top: 15px; border-top: 1px dashed var(--border); padding-top: 12px; }
.history summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.history summary::-webkit-details-marker { display: none; }
.history summary .caret { display: inline-block; transition: transform 0.2s ease; }
.history[open] summary .caret { transform: rotate(90deg); }
.history-summary-line { display: flex; align-items: center; gap: 10px; }
.avail-bar {
  width: 110px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}
.avail-bar > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.history-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 18px;
  margin-top: 12px;
  max-height: 190px;
  overflow: auto;
  padding-right: 6px;
}
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 5px 2px;
  border-bottom: 1px solid rgba(151, 164, 209, 0.08);
}
.h-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; display: inline-block; }
.h-dot.AVAILABLE { background: var(--green); box-shadow: 0 0 8px rgba(47, 212, 122, 0.5); }
.h-dot.SOLD_OUT { background: var(--red); }
.h-dot.ERROR, .h-dot.UNKNOWN { background: var(--orange); }
.h-ts { color: var(--faint); font-variant-numeric: tabular-nums; }

/* --- État vide -------------------------------------------------------------- */
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-icon {
  width: 74px; height: 74px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px dashed var(--border-strong);
  display: grid; place-items: center;
  color: var(--violet);
}
.empty-icon svg { width: 32px; height: 32px; }
.empty-state p { margin: 0 0 4px; font-weight: 600; color: var(--text); }
.empty-state span { font-size: 0.85rem; color: var(--faint); }

/* --- Chargement de liste ---------------------------------------------------- */
.list-loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 36px; font-size: 0.9rem; }
.spinner {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--violet);
  animation: spin 0.7s linear infinite;
}

/* --- Identifiants Zalando --------------------------------------------------- */
.creds-current {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 9px;
}
.creds-current::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(47, 212, 122, 0.5);
}
.creds-current.off::before { background: var(--orange); box-shadow: 0 0 8px rgba(255, 178, 83, 0.5); }

/* --- Toasts ------------------------------------------------------------------ */
.toast-root {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(17, 22, 46, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  min-width: 270px;
  max-width: 380px;
  pointer-events: auto;
  animation: toastIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.toast.out { animation: toastOut 0.26s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(34px); } }
.toast .t-ico {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid; place-items: center;
}
.toast .t-ico svg { width: 15px; height: 15px; }
.toast.ok .t-ico { background: var(--green-bg); color: var(--green); }
.toast.error .t-ico { background: var(--red-bg); color: var(--red); }
.toast.info .t-ico { background: var(--surface-strong); color: var(--cyan); }
.toast .t-msg { color: var(--text); font-weight: 500; line-height: 1.4; }
.toast .t-close {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--faint);
  cursor: pointer;
  padding: 4px;
  display: grid; place-items: center;
}
.toast .t-close svg { width: 14px; height: 14px; }
.toast .t-close:hover { color: var(--text); }

/* --- Modale de confirmation -------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 5, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #101527;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid; place-items: center;
}
.modal-icon svg { width: 26px; height: 26px; }
.modal-icon.danger { background: var(--red-bg); color: var(--red); }
.modal h3 { margin: 0 0 8px; font-family: var(--font-disp); font-size: 1.15rem; }
.modal p { color: var(--muted); font-size: 0.9rem; margin: 0 0 22px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* --- Pied de page ------------------------------------------------------------- */
.footer {
  text-align: center;
  color: var(--faint);
  font-size: 0.78rem;
  padding: 8px 0 28px;
  position: relative;
  z-index: 1;
}

/* --- Responsive ---------------------------------------------------------------- */
@media (max-width: 960px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .form-grid, .form-grid.two { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
  .alert-top { flex-direction: column; }
  .topbar-inner { padding: 12px 16px; }
  .live-indicator { display: none; }
  .stats-grid { gap: 10px; margin-top: 18px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .auth-card { padding: 30px 22px 26px; }
  .toast-root { left: 14px; right: 14px; }
  .toast { min-width: 0; max-width: none; }
}

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