/* =============================================================================
 * ZIC Landing — MultiTicket+ : popup billetterie du profil public.
 * Autonome (aucune feuille admin chargée). Quatre blocs :
 *   1. chrome overlay .zh-mticket-* (gabarit .zh-mshop-overlay) ;
 *   2. pont de tokens --msi-* -> --pp-* (thème clair/sombre du profil) posé
 *      sur l'overlay ET sur .ntk-overlay (le wizard est monté sur <body>) ;
 *   3. classes utilitaires msi-* consommées par le module (copie admin
 *      admin-multishop-inventory.css : btn/spinner/error/modal/toast) avec
 *      remap z-index — modale Stripe 4500, busy 4510, toast 5000 ;
 *   4. port VERBATIM de admin-multishop-tickets.css (moins le bouton sync
 *      admin) et admin-multishop-ticket-modal.css (.ntk-overlay 300 -> 4000).
 * Échelle z : overlay 1500 < ntk 4000 < Stripe 4500 < toast 5000 < auth 9999.
 * ============================================================================= */

/* ============================================================ */
/* 1. Chrome overlay                                            */
/* ============================================================ */

.zh-mticket-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--pp-scrim, rgba(15, 8, 38, 0.55));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  padding: 0;
}
.zh-mticket-overlay[hidden] { display: none !important; }

.zh-mticket-overlay-card {
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--pp-bg, #f6f5fb);
  border-radius: 0;
  box-shadow: 0 30px 80px var(--pp-shadow, rgba(15, 8, 38, 0.45));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  outline: none;
}

@media (min-width: 768px) {
  .zh-mticket-overlay { padding: 24px; }
  .zh-mticket-overlay-card {
    max-height: calc(100vh - 48px);
    border-radius: 22px;
  }
}

.zh-mticket-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: var(--pp-overlay, rgba(17, 24, 39, 0.06));
  color: var(--pp-text, #111827);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 120ms ease, transform 120ms ease;
}
.zh-mticket-overlay-close:hover { background: var(--pp-overlay-strong, rgba(17, 24, 39, 0.12)); transform: scale(1.05); }
.zh-mticket-overlay-close svg { width: 18px; height: 18px; }

.zh-mticket-head {
  flex-shrink: 0;
  padding: 22px 56px 14px 24px;
  border-bottom: 1px solid var(--pp-border, #e5e7eb);
  background: linear-gradient(180deg, var(--pp-card, #ffffff), var(--pp-bg, #f6f5fb));
}
.zh-mticket-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--pp-text, #111827);
}
.zh-mticket-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: var(--pp-text-muted, #475569);
}

/* Le shell admin (.aw-main) fournissait le padding : le fork repose le sien. */
.zh-mticket-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 28px;
}
@media (min-width: 768px) {
  .zh-mticket-head { padding: 26px 64px 16px 32px; }
  .zh-mticket-body { padding: 24px 32px 36px; }
}

/* État invité « Mes billets » (landing-only) */
.mstk-guest-empty { gap: 12px; }
.mstk-guest-empty .msi-btn { margin-top: 2px; }

/* ============================================================ */
/* 2. Pont de tokens --msi-* -> --pp-* (clair/sombre du profil)  */
/*    Posé aussi sur .ntk-overlay : wizard monté sur <body>.     */
/* ============================================================ */

.zh-mticket-overlay,
.ntk-overlay {
  --msi-primary: #8d22ff;
  --msi-primary-dk: #6d28d9;
  --msi-primary-soft: var(--pp-overlay, #f3e8ff);
  --msi-red: #ef4444;
  --msi-green: #10b981;
  --msi-radius: 14px;
  --msi-radius-sm: 10px;
  --msi-bg: var(--pp-bg, #f6f5fb);
  --msi-bg-soft: var(--pp-bg-soft, #f8fafc);
  --msi-card: var(--pp-card, #ffffff);
  --msi-text: var(--pp-text, #111827);
  --msi-text-soft: var(--pp-text-muted, #475569);
  --msi-text-muted: var(--pp-text-soft, #94a3b8);
  --msi-border: var(--pp-border, #e5e7eb);
  --msi-row-hover: var(--pp-bg-soft, #f8fafc);
  --msi-shadow: 0 1px 2px var(--pp-shadow-soft, rgba(15, 23, 42, 0.05));
}

/* ============================================================ */
/* 3. Utilitaires msi-* (copie admin-multishop-inventory.css)   */
/* ============================================================ */

.msi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--msi-radius-sm);
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.msi-btn:focus-visible { outline: 2px solid var(--msi-primary); outline-offset: 2px; }
.msi-btn:active { transform: scale(0.98); }
.msi-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.msi-btn svg { width: 16px; height: 16px; }
.msi-btn--primary {
  background: var(--msi-primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(141, 34, 255, 0.28);
}
.msi-btn--primary:hover:not(:disabled) { background: var(--msi-primary-dk); }
.msi-btn--ghost {
  background: transparent;
  color: var(--msi-text-soft);
  border-color: var(--msi-border);
}
.msi-btn--ghost:hover:not(:disabled) { background: var(--msi-row-hover); color: var(--msi-text); }
.msi-btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  animation: msi-spin 0.8s linear infinite;
}
.msi-btn--ghost .msi-btn-spinner {
  border: 2px solid rgba(15, 23, 42, 0.18);
  border-top-color: var(--msi-text);
}
@keyframes msi-spin { to { transform: rotate(360deg); } }

.msi-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--msi-primary-soft);
  border-top-color: var(--msi-primary);
  animation: msi-spin 0.9s linear infinite;
}

.msi-error {
  padding: 50px 24px;
  text-align: center;
  color: var(--msi-text-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.msi-error[hidden] { display: none; }
.msi-error-msg { margin: 0; font-size: 14px; color: var(--msi-text); font-weight: 500; }

/* Modale Stripe Connect — 4500 : au-dessus du wizard ntk (4000). */
.msi-modal {
  position: fixed;
  inset: 0;
  z-index: 4500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.msi-modal[hidden] { display: none !important; }
.msi-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 18, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.msi-modal-card {
  position: relative;
  background: var(--msi-card, #fff);
  border-radius: 22px;
  box-shadow: 0 32px 64px rgba(15, 23, 42, 0.25);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  animation: msi-modal-in 0.18s ease-out;
}
@keyframes msi-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.msi-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 0;
}
.msi-modal-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.msi-modal-icon svg { width: 22px; height: 22px; }
.msi-modal-icon--brand { background: linear-gradient(135deg, var(--msi-primary), rgba(141, 34, 255, 0.7)); }
.msi-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--msi-text);
  flex: 1 1 auto;
}
.msi-modal-close {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--msi-text-soft);
  padding: 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.msi-modal-close:hover { background: var(--msi-row-hover); color: var(--msi-text); }
.msi-modal-close svg { width: 20px; height: 20px; }
.msi-modal-body { padding: 16px 22px 8px; }
.msi-modal-text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--msi-text-soft);
}
.msi-modal-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--msi-primary-soft);
  border: 1px solid rgba(141, 34, 255, 0.2);
  border-radius: 12px;
  font-size: 13px;
  color: var(--msi-text);
}
.msi-modal-info svg { width: 18px; height: 18px; color: var(--msi-primary); flex-shrink: 0; margin-top: 1px; }
.msi-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 22px;
}

/* Toast — 5000 : au-dessus de tout sauf l'auth-modal (9999). */
.msi-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--msi-text, #111827);
  color: var(--pp-card, #fff);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  z-index: 5000;
  max-width: calc(100vw - 32px);
}
.msi-toast[hidden] { display: none !important; }
.msi-toast--err { background: var(--msi-red); color: #fff; }
.msi-toast--ok  { background: var(--msi-green); color: #fff; }

/* ============================================================ */
/* 4a. Port admin-multishop-tickets.css (sans le sync admin)    */
/* ============================================================ */

/* Garde anti-piège : tout display posé par une classe (flex, inline-flex…)
 * bat le style UA de l'attribut `hidden`. Ce scope-wide !important rétablit
 * le contrat « hidden = invisible » pour tout le panneau. */
.mstk-root [hidden] { display: none !important; }

.mstk-root {
  --mstk-accent: #e11d48;
  --mstk-accent-border: #e11d4833;
  --mstk-accent-row: #e11d4855;
  --mstk-accent-soft: #fee2e8;
  --mstk-remove-bg: #fee2e2;
  --mstk-remove-fg: #991b1b;
  --mstk-purple: #7b3ff2;
  --mstk-purple-soft: #7b3ff21a;
  --mstk-green-bg: #dcfce7;
  --mstk-green-fg: #16a34a;
  --mstk-dark: #1f1340;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------------------------------------------------------------------------
 * 1. CTA « Crée ta propre billetterie »
 * ------------------------------------------------------------------------- */

.mstk-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: linear-gradient(90deg, #e11d480e, transparent);
  border: 1px solid var(--mstk-accent-border);
  border-radius: var(--msi-radius);
  box-shadow: var(--msi-shadow);
}
.mstk-cta-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--mstk-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mstk-cta-icon svg { width: 22px; height: 22px; }
.mstk-cta-body { flex: 1 1 220px; min-width: 0; }
.mstk-cta-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--msi-text);
  letter-spacing: -0.2px;
}
.mstk-cta-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--msi-text-soft);
  line-height: 1.5;
}
.mstk-cta-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: var(--mstk-accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.mstk-cta-btn:hover { filter: brightness(1.06); }

/* ---------------------------------------------------------------------------
 * 2. Cartes (Mes billets / Tickets disponibles)
 * ------------------------------------------------------------------------- */

.mstk-card {
  background: var(--msi-card);
  border: 1px solid var(--msi-border);
  border-radius: var(--msi-radius);
  box-shadow: var(--msi-shadow);
  padding: 16px 18px;
}
.mstk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mstk-card-head--catalog {
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.mstk-card-head-text { flex: 1 1 240px; min-width: 0; }
.mstk-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--msi-text);
  letter-spacing: -0.3px;
}
.mstk-card-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--msi-text-soft);
  line-height: 1.5;
}
.mstk-count {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--msi-text-muted);
}

/* Bouton sync AWIN (admin uniquement) */

/* ---------------------------------------------------------------------------
 * 3. Barre d'outils du catalogue (fraîcheur, recherche, compteur)
 * ------------------------------------------------------------------------- */

.mstk-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.mstk-fresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--mstk-green-bg);
  color: var(--mstk-green-fg);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.mstk-fresh-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mstk-green-fg);
}
.mstk-search {
  position: relative;
  flex: 1 1 200px;
  max-width: 300px;
}
.mstk-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--msi-text-muted);
  pointer-events: none;
}
.mstk-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px 9px 32px;
  border: 1px solid var(--msi-border);
  border-radius: 8px;
  background: var(--msi-row-hover);
  color: var(--msi-text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.mstk-search-input:focus { border-color: var(--mstk-accent); background: #fff; }
.mstk-shop-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--msi-text-muted);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * 4. Puces catégories + slider prix
 * ------------------------------------------------------------------------- */

.mstk-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mstk-pills:empty { display: none; }
.mstk-pill {
  padding: 6px 12px;
  border: 1px solid var(--msi-border);
  border-radius: 999px;
  background: var(--msi-row-hover);
  color: var(--msi-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mstk-pill.is-active {
  background: var(--mstk-dark);
  border-color: var(--mstk-dark);
  color: #fff;
}

.mstk-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.mstk-slider-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--msi-text);
  white-space: nowrap;
}
.mstk-range {
  flex: 1 1 180px;
  max-width: 320px;
  accent-color: var(--mstk-accent);
  cursor: pointer;
}
.mstk-slider-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--msi-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mstk-reset {
  padding: 5px 11px;
  border: 1px solid var(--msi-border);
  border-radius: 999px;
  background: var(--msi-card);
  color: var(--msi-text-soft);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
 * 5. Lignes (partagées Mes billets / catalogue) — grid à areas
 * ------------------------------------------------------------------------- */

.mstk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mstk-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  grid-template-areas: "thumb main side";
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--msi-row-hover);
  border: 1px solid var(--msi-border);
  border-radius: 12px;
  transition: border-color 0.15s;
}
.mstk-item.is-added { border-color: var(--mstk-accent-row); }
.mstk-item.is-unavailable { opacity: 0.72; }

.mstk-thumb {
  grid-area: thumb;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.mstk-thumb svg { width: 20px; height: 20px; }
.mstk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mstk-main { grid-area: main; min-width: 0; }
.mstk-item-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mstk-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--msi-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mstk-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--msi-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mstk-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mstk-badge--catalog { background: var(--mstk-purple-soft); color: var(--mstk-purple); }
.mstk-badge--own { background: var(--mstk-accent-soft); color: var(--mstk-accent); }
.mstk-badge--popular {
  background: var(--mstk-accent-soft);
  color: var(--mstk-accent);
  font-size: 9.5px;
}
.mstk-badge--off { background: var(--msi-border); color: var(--msi-text-soft); }

/* Billetteries NATIVES (étape 3) : ligne cliquable → drawer détail */
.mstk-item--native { cursor: pointer; transition: border-color 0.15s; }
.mstk-item--native:hover,
.mstk-item--native:focus-visible { border-color: var(--mstk-accent); outline: none; }
.mstk-chevron { color: var(--msi-text-soft); font-size: 16px; }

.mstk-side {
  grid-area: side;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mstk-price {
  min-width: 56px;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: var(--msi-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mstk-comm {
  min-width: 44px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--mstk-accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mstk-status-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--mstk-green-bg);
  color: var(--mstk-green-fg);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.mstk-btn-toggle {
  min-width: 92px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.mstk-btn-toggle--add { background: var(--mstk-accent); color: #fff; }
.mstk-btn-toggle--add:hover { filter: brightness(1.06); }
.mstk-btn-toggle--remove { background: var(--mstk-remove-bg); color: var(--mstk-remove-fg); }
.mstk-btn-toggle:disabled { opacity: 0.55; cursor: default; }

/* États vides / chargement / charger plus */
.mstk-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--msi-text-soft);
  line-height: 1.55;
}
.mstk-loading {
  display: flex;
  justify-content: center;
  padding: 26px 0;
}
.mstk-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.mstk-more-wrap:has([hidden]) { margin-top: 0; }

/* ---------------------------------------------------------------------------
 * 6. Responsive <700px — la zone side passe sous le nom, pleine largeur
 * ------------------------------------------------------------------------- */

@media (max-width: 699.98px) {
  .mstk-item {
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "side side";
  }
  .mstk-side {
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--msi-border);
  }
  .mstk-card-head--catalog { flex-direction: column; align-items: stretch; }
  /* En colonne, le flex-basis (240px) deviendrait une HAUTEUR : on le coupe. */
  .mstk-card-head--catalog .mstk-card-head-text { flex: 0 0 auto; }
  .mstk-search { max-width: none; flex: 1 1 100%; }
}

/* ============================================================ */
/* 4b. Port admin-multishop-ticket-modal.css (ntk 300 -> 4000)  */
/* ============================================================ */

.ntk-overlay [hidden] { display: none !important; }

.ntk-overlay {
  position: fixed;
  inset: 0;
  /* LANDING : 300 (admin) -> 4000 — au-dessus de l'overlay hôte (1500),
     sous la modale Stripe (4500) et le toast (5000). */
  z-index: 4000;
  background: rgba(15, 7, 34, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ntk-overlay--drawer {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: rgba(31, 19, 64, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
body.ntk-lock { overflow: hidden; }

/* ── Carte modal ─────────────────────────────────────────────────────────── */
.ntk-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--msi-card, #fff);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--msi-text, #1f1340);
}
.ntk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  flex-shrink: 0;
}
.ntk-title {
  margin: 0;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 17px;
  font-weight: 800;
}
.ntk-close {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--msi-bg, #f4f3fb);
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  color: var(--msi-text-soft, #6b7280);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.ntk-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.ntk-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  flex-shrink: 0;
}

/* ── Champs ──────────────────────────────────────────────────────────────── */
.ntk-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--msi-text-muted, #9ca3af);
  margin-bottom: 6px;
}
.ntk-inp {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  border-radius: 9px;
  font: 400 14px "DM Sans", sans-serif;
  color: var(--msi-text, #1f1340);
  background: var(--msi-card, #fff);
  outline: none;
  box-sizing: border-box;
}
.ntk-inp:focus { border-color: #e11d48; }
.ntk-textarea { resize: vertical; line-height: 1.5; }
.ntk-two { display: flex; gap: 12px; }
.ntk-two > div { flex: 1; }

.ntk-error {
  margin: 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-size: 13px;
}
.ntk-tip {
  margin: 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Visuel (upload) */
.ntk-cover {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--msi-bg-soft, #fafafb);
  border: 1px dashed var(--msi-border, rgba(31, 19, 64, 0.12));
  border-radius: 10px;
  cursor: pointer;
}
.ntk-cover.is-set { border-color: #e11d48; }
.ntk-cover-dot {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #fee2e8;
  color: var(--msi-text-soft, #6b7280);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ntk-cover.is-set .ntk-cover-dot { background: #e11d48; color: #fff; }
/* Miniature réelle du visuel dans la pastille (recouvre le fond). */
.ntk-cover-dot { overflow: hidden; position: relative; }
.ntk-cover-dot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.ntk-cover-label { flex: 1; font-size: 13px; font-weight: 600; }

/* Tiers */
.ntk-tiers-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.ntk-tier-add {
  padding: 5px 11px;
  border-radius: 8px;
  background: #fee2e8;
  color: #e11d48;
  border: none;
  font: 800 12px "DM Sans", sans-serif;
  cursor: pointer;
}
.ntk-tiers { display: flex; flex-direction: column; gap: 8px; }
.ntk-tier-row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.ntk-tier-label { flex: 1.4 1 90px; }
.ntk-tier-price {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  border-radius: 9px;
  flex: 1 1 70px;
  background: var(--msi-card, #fff);
}
.ntk-tier-price input {
  border: none;
  padding: 11px 0;
  width: 100%;
  min-width: 0;
  font: 800 14px "Space Grotesk", "DM Sans", sans-serif;
  color: var(--msi-text, #1f1340);
  outline: none;
  background: transparent;
}
.ntk-tier-price span { color: var(--msi-text-muted, #9ca3af); font-weight: 700; }
.ntk-tier-price.is-locked { opacity: 0.6; background: var(--msi-bg-soft, #fafafb); }
.ntk-tier-qty { flex: 0.8 1 60px; }
.ntk-tier-rm {
  width: 32px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  background: var(--msi-card, #fff);
  color: var(--msi-text-soft, #6b7280);
  font-size: 15px;
  cursor: pointer;
}
.ntk-tier-rm:disabled { cursor: not-allowed; opacity: 0.4; }
.ntk-tier-lock {
  flex-basis: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #e11d48;
}

/* Checkboxes Diffusion & Boost */
.ntk-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 11px;
  cursor: pointer;
  margin-bottom: 9px;
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  background: var(--msi-bg-soft, #fafafb);
}
.ntk-check input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #e11d48;
}
.ntk-check--network.is-on { border-color: #e11d48; background: rgba(225, 29, 72, 0.05); }
.ntk-check--boost input { accent-color: #7b3ff2; }
.ntk-check--boost.is-on { border-color: #7b3ff2; background: rgba(123, 63, 242, 0.05); }
.ntk-check > span { flex: 1; min-width: 0; }
.ntk-check-title {
  display: flex;
  gap: 7px;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 13.5px;
  font-weight: 800;
}
.ntk-check-desc {
  display: block;
  font-size: 11.5px;
  color: var(--msi-text-soft, #6b7280);
  margin-top: 3px;
  line-height: 1.5;
}
.ntk-seats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  font-size: 12px;
  font-weight: 600;
}
.ntk-seats-ctrl {
  display: flex;
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  border-radius: 8px;
  overflow: hidden;
  background: var(--msi-card, #fff);
}
.ntk-seats-ctrl button {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--msi-card, #fff);
  font-size: 16px;
  cursor: pointer;
  color: var(--msi-text, #1f1340);
}
.ntk-seats-val {
  min-width: 34px;
  text-align: center;
  align-self: center;
  font: 800 14px "Space Grotesk", "DM Sans", sans-serif;
}

/* Bandeau info */
.ntk-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(225, 29, 72, 0.05);
  border: 1px solid rgba(225, 29, 72, 0.2);
  font-size: 15px;
}
.ntk-note span {
  flex: 1;
  font-size: 11.5px;
  color: var(--msi-text-soft, #6b7280);
  line-height: 1.5;
}

/* Boutons */
.ntk-btn {
  padding: 11px 18px;
  border-radius: 9px;
  border: none;
  font: 700 13px "DM Sans", sans-serif;
  cursor: pointer;
}
.ntk-btn--ghost {
  background: var(--msi-bg, #f4f3fb);
  color: var(--msi-text, #1f1340);
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
}
.ntk-btn--primary { background: #e11d48; color: #fff; padding: 11px 20px; }
.ntk-btn--primary:disabled { background: #e8b9c4; cursor: not-allowed; }
.ntk-btn--danger { background: #fee2e2; color: #dc2626; font-weight: 800; }

/* Écran de succès */
.ntk-success {
  padding: 44px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.ntk-success-check {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #e11d48;
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ntk-success h3 {
  margin: 0;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 21px;
  font-weight: 800;
}
.ntk-success p {
  margin: 0;
  font-size: 13px;
  color: var(--msi-text-soft, #6b7280);
  line-height: 1.5;
  max-width: 360px;
}
.ntk-success-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-top: 4px;
}
.ntk-success-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--msi-bg-soft, #fafafb);
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  text-align: left;
  font-size: 16px;
}
.ntk-success-item span {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--msi-text, #1f1340);
}

/* ── Drawer détail ───────────────────────────────────────────────────────── */
.ntk-drawer {
  width: min(520px, 100%);
  height: 100%;
  background: var(--msi-card, #fff);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--msi-text, #1f1340);
}
.ntk-dt-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ntk-dt-tile {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, #e11d48, #e11d48aa);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.ntk-dt-tile svg { width: 20px; height: 20px; }
/* Miniature du visuel : recouvre le dégradé quand elle charge (icône billet
   visible si pas d'image ou si elle casse). */
.ntk-dt-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ntk-dt-head-main { flex: 1; min-width: 0; display: block; }
.ntk-dt-head-main strong {
  display: block;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ntk-dt-head-main small {
  display: block;
  font-size: 11.5px;
  color: var(--msi-text-soft, #6b7280);
  margin-top: 2px;
}
.ntk-dt-draft { color: #b45309; font-style: normal; font-weight: 700; }
.ntk-dt-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ntk-dt-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.ntk-dt-foot .ntk-btn { flex: 1; }
.ntk-dt-foot .ntk-btn--danger { flex: 1.4; }
.ntk-dt-state {
  padding: 30px 10px;
  text-align: center;
  color: var(--msi-text-soft, #6b7280);
  font-size: 13.5px;
}
.ntk-dt-state.is-error { color: #b91c1c; }
.ntk-dt-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.ntk-dt-stat {
  padding: 12px 13px;
  border-radius: 11px;
  background: var(--msi-bg-soft, #fafafb);
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
}
.ntk-dt-stat span {
  display: block;
  font-size: 10.5px;
  color: var(--msi-text-muted, #9ca3af);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ntk-dt-stat strong {
  display: block;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 18px;
  font-weight: 800;
  margin-top: 3px;
}
.ntk-dt-bar {
  height: 8px;
  border-radius: 5px;
  background: var(--msi-bg-soft, #fafafb);
  overflow: hidden;
}
.ntk-dt-bar div { height: 100%; background: #e11d48; }
.ntk-dt-sec {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--msi-text-muted, #9ca3af);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ntk-dt-place { margin: 0; font-size: 13.5px; }
.ntk-dt-list { display: flex; flex-direction: column; gap: 8px; }
.ntk-dt-tier,
.ntk-dt-buyer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--msi-bg-soft, #fafafb);
  border: 1px solid var(--msi-border, rgba(31, 19, 64, 0.08));
}
.ntk-dt-tier strong {
  flex: 1;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.ntk-dt-tier span { font-size: 12px; color: var(--msi-text-soft, #6b7280); }
.ntk-dt-tier em {
  font: 800 13.5px "Space Grotesk", "DM Sans", sans-serif;
  font-style: normal;
  min-width: 50px;
  text-align: right;
}
.ntk-dt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.13);
  color: #e11d48;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 800 12px "Space Grotesk", "DM Sans", sans-serif;
  flex-shrink: 0;
}
.ntk-dt-buyer-main { flex: 1; min-width: 0; display: block; }
.ntk-dt-buyer-main strong { display: block; font-size: 13px; font-weight: 700; }
.ntk-dt-buyer-main small {
  display: block;
  font-size: 11px;
  color: var(--msi-text-soft, #6b7280);
  margin-top: 1px;
}
.ntk-dt-paid { font-size: 11px; color: #16a34a; font-weight: 700; }
.ntk-dt-empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--msi-text-soft, #6b7280);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .ntk-overlay { padding: 0; }
  .ntk-card {
    max-width: none;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .ntk-foot {
    position: sticky;
    bottom: 0;
    background: var(--msi-card, #fff);
  }
  .ntk-dt-stats { grid-template-columns: 1fr 1fr; }
  .ntk-two { flex-direction: column; gap: 16px; }
}


/* ============================================================ */
/* 5. Thème sombre — accents en dur du module (le reste passe   */
/*    par le pont --pp-*). Structure de public-profile-theme.   */
/* ============================================================ */

:root[data-pp-theme="dark"] .mstk-root,
:root[data-pp-theme="dark"] .ntk-overlay {
  --mstk-accent-soft: rgba(225, 29, 72, 0.16);
  --mstk-remove-bg: rgba(239, 68, 68, 0.15);
  --mstk-remove-fg: #fca5a5;
  --mstk-purple-soft: rgba(123, 63, 242, 0.18);
  --mstk-green-bg: rgba(22, 163, 74, 0.18);
  --mstk-green-fg: #4ade80;
  --mstk-dark: var(--pp-text, #e5e7eb);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-pp-theme]) .mstk-root,
  :root:not([data-pp-theme]) .ntk-overlay {
    --mstk-accent-soft: rgba(225, 29, 72, 0.16);
    --mstk-remove-bg: rgba(239, 68, 68, 0.15);
    --mstk-remove-fg: #fca5a5;
    --mstk-purple-soft: rgba(123, 63, 242, 0.18);
    --mstk-green-bg: rgba(22, 163, 74, 0.18);
    --mstk-green-fg: #4ade80;
    --mstk-dark: var(--pp-text, #e5e7eb);
  }
}
