/* ===========================================================================
   Pokemon Restock Watcher — design system "identite Pokemon"
   Palette officielle (bleu/jaune/rouge), fond clair, cartes pleines avec ombres
   (pas de glassmorphism), le logo est le point focal du bandeau.
=========================================================================== */

:root {
  --bg: #f7f2e8;
  --bg-card: #fffcf6;
  --bg-alt: #f1e8d7;
  --border: #e8ddc7;
  --border-strong: #d6c7a3;
  --text: #211d1a;
  --text-secondary: #726c60;
  --text-tertiary: #9c9382;

  --blue: #3b4cca;
  --blue-dark: #232f8f;
  --blue-light: #6c7ae0;
  --yellow: #ffcb05;
  --yellow-dark: #e0ac00;
  --red: #ee1515;
  --purple: #8b5cf6;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red-bg: #fee2e2;
  --orange: #f59e0b;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(29, 29, 53, 0.06);
  --shadow-md: 0 8px 24px rgba(29, 29, 53, 0.08);
  --shadow-lg: 0 16px 40px rgba(29, 29, 53, 0.12);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 0.3s;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--yellow);
  color: #1d1d35;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c3cadd;
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #a8b0c9;
  background-clip: padding-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Ecran de lancement (splash video)
-------------------------------------------------------------------------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.55s var(--ease);
}
.splash.is-visible {
  opacity: 1;
}

.splash__video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}

.splash__skip {
  position: absolute;
  bottom: 32px;
  right: 32px;
  background: rgba(29, 29, 53, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  transition: all var(--dur) var(--ease);
}
.splash__skip:hover {
  color: var(--blue);
  border-color: var(--blue);
}

@media (prefers-reduced-motion: reduce) {
  .splash { display: none; }
}

/* --------------------------------------------------------------------------
   Ecran de login
-------------------------------------------------------------------------- */

.login-body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: var(--blue-dark);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Helvetica, Arial, sans-serif;
}

.login-bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  z-index: 0;
}

.login-bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(150deg, var(--blue-dark) 0%, var(--blue) 65%, #4f5edb 100%);
  opacity: 0.62;
}

.login-screen {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.4s var(--ease);
}
.login-screen.is-fading-out {
  opacity: 0;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 252, 246, 0.72);
  border: 1px solid rgba(255, 252, 246, 0.5);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px 32px;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  animation: reveal-up 0.5s var(--ease) forwards;
}

.login-card__logo-frame {
  margin: 0 auto 20px;
  box-shadow: var(--shadow-md);
}

.login-card__title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-card__subtitle {
  margin: 6px 0 26px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 14.5px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.login-input::placeholder {
  color: var(--text-tertiary);
}
.login-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(59, 76, 202, 0.15);
}

.login-submit {
  margin-top: 6px;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(59, 76, 202, 0.35);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(59, 76, 202, 0.45);
}
.login-submit:active {
  transform: scale(0.98);
}
.login-submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.login-error {
  min-height: 18px;
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--red);
}

@media (max-width: 480px) {
  .login-card { padding: 32px 22px 26px; }
}

a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--dur) var(--ease);
}
a:hover {
  opacity: 0.7;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Hero
-------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 44px 32px 48px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(150deg, var(--blue-dark) 0%, var(--blue) 65%, #4f5edb 100%);
  border-radius: 0 0 32px 32px;
  box-shadow: 0 12px 32px rgba(59, 76, 202, 0.25);
}

.hero__pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.16;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 2.5px, transparent 2.5px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 80% 0%, black 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(circle at 80% 0%, black 0%, transparent 65%);
}

.hero__top,
.stat-grid {
  position: relative;
  z-index: 1;
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand__logo-frame {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease-spring);
}
.brand__logo-frame:hover {
  transform: scale(1.06) rotate(-3deg);
}

.brand__logo {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand__subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 500;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conn-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  transition: all var(--dur) var(--ease);
}
.logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse-dot 2s var(--ease) infinite;
}
.conn-dot--error { background: var(--red); animation: none; }

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* --------------------------------------------------------------------------
   Stat tiles
-------------------------------------------------------------------------- */

.stat-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur) var(--ease);
  opacity: 0;
  transform: translateY(16px);
  animation: reveal-up 0.6s var(--ease) forwards;
}
.stat-tile:nth-child(1) { animation-delay: 0.02s; }
.stat-tile:nth-child(2) { animation-delay: 0.08s; }
.stat-tile:nth-child(3) { animation-delay: 0.14s; }
.stat-tile:nth-child(4) { animation-delay: 0.2s; }

.stat-tile:hover {
  transform: translateY(-3px);
}

.stat-tile__label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.stat-tile__value {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

.stat-tile--positive .stat-tile__value {
  color: var(--green);
}

@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Layout / sections
-------------------------------------------------------------------------- */

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}

.section {
  margin-top: 44px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.section__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.section__hint {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   Restock carousel
-------------------------------------------------------------------------- */

.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 6px 2px 18px;
  margin: 0 -2px;
}

.restock-card {
  scroll-snap-align: start;
  flex: 0 0 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-spring), box-shadow var(--dur) var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
  opacity: 0;
  animation: card-in 0.6s var(--ease) forwards;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.restock-card:hover {
  box-shadow: var(--shadow-lg);
}

.restock-card__image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.restock-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.5s var(--ease);
}
.restock-card:hover .restock-card__image-wrap img {
  transform: scale(1.06);
}

.restock-card__placeholder {
  font-size: 40px;
  opacity: 0.25;
}

.restock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, var(--green), #0d8a3e);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
  animation: badge-pulse 1.8s var(--ease) infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.restock-card__priority {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  color: #241a00;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: var(--radius-pill);
}

.restock-card__body {
  padding: 12px 14px 14px;
}

.restock-card__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.restock-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.restock-card__price {
  font-weight: 800;
  color: var(--blue);
}

.carousel .empty {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Retailer grid (cliquable = filtre)
-------------------------------------------------------------------------- */

.retailer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.retailer-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-spring), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
  color: var(--text);
  opacity: 0;
  animation: card-in 0.5s var(--ease) forwards;
}

.retailer-card:hover {
  box-shadow: var(--shadow-lg);
}

.retailer-card:active {
  transform: scale(0.97) !important;
}

.retailer-card--selected {
  border-color: var(--blue);
  background: #eef0ff;
  box-shadow: 0 0 0 2px var(--blue), var(--shadow-md);
}

.retailer-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.retailer-card__favicon {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease-spring);
}

.retailer-card__favicon-inner {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.retailer-card__health-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  z-index: 1;
}
.retailer-card__health-dot--ok {
  background: var(--green);
}
.retailer-card__health-dot--warn {
  background: var(--orange);
}
.retailer-card__health-dot--error {
  background: var(--red);
  animation: pulse-dot 2s var(--ease) infinite;
}
.retailer-card:hover .retailer-card__favicon {
  transform: scale(1.05);
}
.retailer-card__favicon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.retailer-card__favicon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #1d1d35;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
}

.retailer-card__flag {
  font-size: 14px;
}

.retailer-card__stock-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  margin-top: 2px;
}
.retailer-card__stock-pill--high {
  background: var(--green-bg);
  color: #15803d;
}
.retailer-card__stock-pill--low {
  background: #fef3c7;
  color: #92400e;
}
.retailer-card__stock-pill--none {
  background: var(--bg-alt);
  color: var(--text-tertiary);
}

.retailer-card__name {
  font-weight: 700;
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.retailer-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.retailer-card__count {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.retailer-card__count b {
  color: var(--green);
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Toolbar / filtres
-------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 360px;
  color: var(--text-tertiary);
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 11px 16px 11px 40px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-input::placeholder {
  color: var(--text-tertiary);
}
.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(59, 76, 202, 0.15);
}

.chip-row {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.chip {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  transition: color var(--dur) var(--ease);
  white-space: nowrap;
}
.chip--active {
  color: #ffffff;
}
.chip-row__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  transition: left 0.35s var(--ease-spring), width 0.35s var(--ease-spring);
  z-index: 0;
  box-shadow: 0 4px 14px rgba(59, 76, 202, 0.35);
}

.clear-filters {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  transition: all var(--dur) var(--ease);
  display: none;
  box-shadow: var(--shadow-sm);
}
.clear-filters:hover {
  color: var(--red);
  border-color: var(--red);
}
.clear-filters.is-visible {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Filtre par type de produit (ETB / Display / Coffret / Deck / Autre)
-------------------------------------------------------------------------- */

.type-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 14px;
  margin-top: -6px;
}

.type-chip-row__label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.type-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.type-chip:hover {
  border-color: var(--blue-light);
  color: var(--blue);
}
.type-chip--active {
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  border-color: var(--blue);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Table
-------------------------------------------------------------------------- */

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-scroll {
  max-height: 560px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  z-index: 2;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--dur) var(--ease);
}
th.sortable:hover {
  color: var(--text);
}
th.sortable.sort-active {
  color: var(--blue);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--text);
}

tbody tr {
  transition: background var(--dur) var(--ease);
}
tbody tr:hover {
  background: var(--bg-alt);
}
tbody tr:last-child td {
  border-bottom: none;
}

.row-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 3px;
}
.row-thumb-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px;
}

/* Status + badges */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status--in {
  background: var(--green-bg);
  color: #15803d;
}
.status--in::before {
  background: var(--green);
  animation: pulse-dot 2s var(--ease) infinite;
}
.status--out {
  background: var(--red-bg);
  color: #b91c1c;
}
.status--out::before { background: var(--red); }
.status--unknown {
  background: var(--bg-alt);
  color: var(--text-tertiary);
}
.status--unknown::before { background: var(--text-tertiary); }

.badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge--restock { background: var(--green-bg); color: #15803d; }
.badge--new_product_in_stock { background: var(--green-bg); color: #15803d; }
.badge--out_of_stock { background: var(--red-bg); color: #b91c1c; }
.badge--new_product { background: var(--bg-alt); color: var(--text-secondary); }

.priority-tag {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  color: #241a00;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.mute-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  border-radius: var(--radius-pill);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur) var(--ease);
}
.mute-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: scale(1.08);
}
.mute-btn:active {
  transform: scale(0.9);
}
.mute-btn--muted {
  color: var(--orange);
  border-color: rgba(245, 158, 11, 0.4);
  background: #fff7ed;
}

.row-muted {
  opacity: 0.45;
}

/* --------------------------------------------------------------------------
   Cartes produit (remplacent le tableau sur mobile — voir media query plus bas)
-------------------------------------------------------------------------- */

.product-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.product-card {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}
.product-card--muted {
  opacity: 0.5;
}

.product-card__media {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.product-card__body {
  flex: 1;
  min-width: 0;
}

.product-card__top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.product-card__name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-card__meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.product-card__price {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--blue);
}

/* --------------------------------------------------------------------------
   Pagination
-------------------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.page-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 700;
  transition: all var(--dur) var(--ease);
}
.page-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.page-indicator {
  color: var(--text-tertiary);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Confetti burst
-------------------------------------------------------------------------- */

.confetti-piece {
  position: fixed;
  top: -10px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to {
    transform: translateY(105vh) rotate(540deg);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   Toast
-------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9998;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 260px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.45s var(--ease-spring), toast-out 0.4s var(--ease) 4.6s forwards;
}
.toast__title {
  font-weight: 800;
  font-size: 13px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
}
.toast__body {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(40px) scale(0.9); }
}

footer {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 28px;
}

/* --------------------------------------------------------------------------
   Responsive
-------------------------------------------------------------------------- */

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .hero { padding: 28px 16px 28px; border-radius: 0 0 22px 22px; }
  main { padding: 20px 16px 48px; }
  .brand { gap: 14px; }
  .brand__logo-frame { width: 68px; height: 68px; border-radius: 19px; }
  .brand__logo { width: 54px; height: 54px; }
  .brand h1 { font-size: 18px; }
  .brand__subtitle { font-size: 12.5px; }
  .conn-badge { padding: 7px 14px; font-size: 12px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-tile { padding: 16px 16px; }
  .stat-tile__value { font-size: 24px; }
  .stat-tile__label { font-size: 10.5px; white-space: normal; }

  .section { margin-top: 32px; }
  .section__title { font-size: 17px; }

  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-wrap { max-width: none; }
  .search-input { padding: 12px 16px 12px 40px; font-size: 15px; }
  .chip-row { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chip { padding: 9px 14px; font-size: 12.5px; }

  .restock-card { flex-basis: 150px; }
  .restock-card__body { padding: 10px 11px 11px; }

  /* Carrousel horizontal plutot qu'une grille qui force un long scroll vertical
     avant meme d'atteindre les produits (32 boutiques = beaucoup d'ecrans). */
  .retailer-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    gap: 10px;
    padding: 4px 2px 10px;
    margin: 0 -2px;
    -webkit-overflow-scrolling: touch;
  }
  .retailer-card {
    flex: 0 0 132px;
    scroll-snap-align: start;
    padding: 12px;
  }
  .retailer-card__favicon { width: 48px; height: 48px; }
  .retailer-card__favicon-inner { border-radius: 14px; }
  .retailer-card__favicon img { width: 32px; height: 32px; }
  .retailer-card__name { font-size: 13px; margin-top: 8px; }
  .retailer-card__count { font-size: 11px; }
  .retailer-card__stock-pill { font-size: 10px; padding: 3px 7px; }

  /* La table classique force un scroll horizontal illisible au doigt :
     on bascule sur les cartes produit empilees (meme donnees, cf. app.js). */
  .table-scroll { display: none; }
  .product-cards { display: flex; }
  .table-card { border-radius: var(--radius-md); }

  .pagination { padding: 14px 10px; gap: 10px; flex-wrap: wrap; }
  .page-btn { padding: 10px 16px; }

  .mute-btn { width: 38px; height: 38px; }

  .toast-stack { left: 12px; right: 12px; bottom: 16px; }
  .toast { min-width: 0; max-width: none; }
}
