/* ================================================================
   OBSIDIENNE DESIGN SYSTEM
   Material Design 3 tokens + glassmorphism pour L'Archive d'Obsidienne
   ================================================================ */

/* --- Material Symbols Outlined --- */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.mso-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* --- Zoom global --- */
html {
  zoom: 1.15;
}

/* --- Body override for new shell --- */
body {
  padding: 0 !important;
  overflow: hidden !important;
  height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top right, #1e1b4b, #0a0a0f) !important;
  font-family: 'Inter', 'Nunito', sans-serif !important;
}

/* --- App Shell --- */
.app-shell {
  display: flex;
  height: calc(100vh / 1.15);
  overflow: hidden;
}

/* --- Main Area --- */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  padding-left: 16px;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 28px 80px 12px;
}

/* Scrollbar custom */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(203, 151, 255, 0.1); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(203, 151, 255, 0.2); }

/* ================================================================
   HEADER BARRE DU HAUT
   ================================================================ */

/* Override des styles de l'ancien header centré */
.app-shell header,
.app-shell header h1,
.app-shell header p {
  all: unset;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 28px 10px 12px;
  background: rgba(28, 23, 36, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.app-hamburger {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #b0a8b6;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 8px;
}

.app-hamburger:hover {
  background: rgba(203, 151, 255, 0.1);
  color: #cb97ff;
  border-color: rgba(203, 151, 255, 0.3);
}

.app-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-title {
  font-family: 'Cinzel', serif !important;
  font-size: 1.9rem !important;
  font-weight: 700 !important;
  letter-spacing: 5px !important;
  background: linear-gradient(130deg, #c060ff, #f0bf30) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  display: block !important;
}

.app-subtitle {
  font-family: 'Inter', 'Nunito', sans-serif !important;
  font-size: 11px !important;
  color: #6868a0 !important;
  margin-top: 2px !important;
  display: block !important;
}

.header-ver {
  color: #b0a8b6;
}

/* ================================================================
   SIDEBAR NOUVELLE VERSION
   ================================================================ */

.sidebar-new {
  width: 256px;
  flex-shrink: 0;
  height: calc(100vh / 1.15);
  display: flex;
  flex-direction: column;
  padding: 24px 0 0;
  background: radial-gradient(circle at top right, #1e1b4b, #0a0a0f);
  border-right: 1px solid rgba(203, 151, 255, 0.12);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.6), inset -1px 0 0 rgba(203, 151, 255, 0.05);
  font-family: 'Manrope', 'Nunito', sans-serif;
  position: relative;
  z-index: 10;
  overflow: hidden;
  max-width: 256px;
  transition: max-width 0.28s ease, opacity 0.22s ease, padding 0.28s ease;
}

.sidebar-new.sidebar-closed {
  max-width: 0;
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Header */
.sb-header {
  padding: 0 24px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sb-logo-wrap {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
}

.sb-brand {
  display: flex;
  flex-direction: column;
}

.sb-brand-name {
  font-size: 19px;
  font-weight: 700;
  color: rgb(196, 181, 253);
  letter-spacing: -0.05em;
  line-height: 1.2;
}

.sb-brand-sub {
  font-size: 9px;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(176, 168, 182, 0.5);
  margin-top: 2px;
}

/* Nav */
.sb-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
}

.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(203, 151, 255, 0.1); border-radius: 10px; }

.sb-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 6px;
}

.sb-section-label {
  font-size: 10px;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(176, 168, 182, 0.35);
}

.sb-add-btn {
  background: none;
  border: none;
  color: rgba(176, 168, 182, 0.4);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 3px;
}

.sb-add-btn:hover {
  color: #cb97ff;
  background: rgba(203, 151, 255, 0.1);
}

.sb-add-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Sidebar item */
.sb-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  color: rgba(148, 163, 184, 0.75);
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.2s, color 0.2s;
  font-family: 'Manrope', 'Nunito', sans-serif;
}

.sb-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgb(221, 214, 254);
}

.sb-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: rgb(203, 151, 255);
}

.sb-item.active::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 28px;
  background: rgb(139, 92, 246);
  border-radius: 9999px;
}

.sb-item-icon {
  font-size: 18px;
  color: rgba(167, 139, 250, 0.45);
  flex-shrink: 0;
  transition: color 0.2s;
}

.sb-item.active .sb-item-icon,
.sb-item:hover .sb-item-icon {
  color: rgb(167, 139, 250);
}

.sb-item-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sb-item.active .sb-item-text {
  font-weight: 600;
}

/* Dot */
.sb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}

.sb-dot.running {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  animation: sb-pulse 1.2s infinite;
}

.sb-dot.idle {
  background: rgba(100, 116, 139, 0.6);
}

@keyframes sb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Delete button */
.sb-del-btn {
  background: none;
  border: none;
  color: rgba(176, 168, 182, 0.35);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sb-item:hover .sb-del-btn {
  opacity: 1;
}

.sb-del-btn:hover {
  color: #ff5070;
  background: rgba(255, 80, 112, 0.12);
}

/* Footer */
.sb-footer {
  padding: 12px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
  flex-shrink: 0;
}

.sb-version {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  color: rgba(176, 168, 182, 0.35);
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sb-version .material-symbols-outlined {
  font-size: 13px;
}

/* ================================================================
   UPDATE BANNER — NOUVELLE VERSION
   ================================================================ */

.update-banner-new {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: rgba(28, 23, 36, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(203, 151, 255, 0.15);
  font-family: 'Inter', 'Nunito', sans-serif;
  font-size: 13px;
  flex-shrink: 0;
}

.update-banner-new.available,
.update-banner-new.downloading,
.update-banner-new.ready,
.update-banner-new.error {
  display: flex;
}

.upd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.update-banner-new.available .upd-dot  { background: #cb97ff; }
.update-banner-new.downloading .upd-dot { background: #f59e0b; animation: sb-pulse 1s infinite; }
.update-banner-new.ready .upd-dot       { background: #22c55e; }
.update-banner-new.error .upd-dot       { background: #ff6e84; }

.upd-text {
  flex: 1;
  color: rgba(176, 168, 182, 0.9);
  font-weight: 500;
}

.upd-bar-wrap {
  width: 180px;
  height: 4px;
  background: rgba(203, 151, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
  flex-shrink: 0;
}

.upd-bar-fill {
  height: 100%;
  background: #cb97ff;
  border-radius: 9999px;
  transition: width 0.3s;
}

.upd-percent {
  font-weight: 700;
  color: #cb97ff;
  min-width: 32px;
  text-align: right;
  font-size: 12px;
}

.upd-install-btn {
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #cb97ff, #c185fd);
  color: #46007c;
  border: none;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  box-shadow: 0 4px 12px rgba(203, 151, 255, 0.25);
  transition: opacity 0.15s, transform 0.1s;
}

.upd-install-btn:hover { opacity: 0.9; transform: scale(1.02); }
.upd-install-btn:active { transform: scale(0.98); }

.upd-dismiss-btn {
  background: none;
  border: none;
  color: rgba(176, 168, 182, 0.5);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
}

.upd-dismiss-btn:hover { color: #ff6e84; }

/* ================================================================
   DASHBOARD NOUVELLE VERSION
   ================================================================ */

.dash-new {
  display: flex;
  flex-direction: column;
  gap: 40px;
  font-family: 'Inter', 'Nunito', sans-serif;
}

/* Section header */
.dash-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dash-section-lbl {
  font-size: 10px;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(176, 168, 182, 0.7);
}

.dash-reset-btn-new {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #f43f5e;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Manrope', 'Nunito', sans-serif;
  transition: color 0.15s;
}

.dash-reset-btn-new .material-symbols-outlined { font-size: 15px; }
.dash-reset-btn-new:hover { color: #fb7185; }

/* KPI Grid */
.dash-kpi-grid-new {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.dash-kpi-card {
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(203, 151, 255, 0.12);
  border-radius: 16px;
  padding: 22px;
  transition: border-color 0.2s;
}

.dash-kpi-card:hover { border-color: rgba(203, 151, 255, 0.3); }

.dash-kpi-lbl {
  font-size: 13px;
  color: rgba(176, 168, 182, 0.75);
  margin-bottom: 10px;
  font-weight: 400;
}

.dash-kpi-val {
  font-family: 'Cinzel', serif;
  font-size: 48px;
  font-weight: 700;
  color: #cb97ff;
  line-height: 1;
}

/* Two-column layout */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

/* Enclos grid */
.dash-enc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.dash-enc-card {
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(203, 151, 255, 0.12);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.dash-enc-card:hover { border-color: rgba(203, 151, 255, 0.35); }
.dash-enc-card.running { box-shadow: 0 0 0 1px rgba(203, 151, 255, 0.15); }
.dash-enc-card.done-enc { border-color: rgba(34, 197, 94, 0.3); }

.dash-enc-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dash-enc-name-new {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f1e8f7;
}

.dash-enc-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
}

.dash-enc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-enc-dot.running { background: #22c55e; animation: sb-pulse 1.2s infinite; }
.dash-enc-dot.paused  { background: #f59e0b; }
.dash-enc-dot.idle    { background: #64748b; }

.dash-enc-status-badge.running { color: #22c55e; }
.dash-enc-status-badge.paused  { color: #f59e0b; }
.dash-enc-status-badge.idle    { color: #64748b; }

.dash-enc-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.dash-enc-dd-block .dd-count-big {
  font-family: 'Cinzel', serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: #f1e8f7;
}

.dash-enc-dd-block .dd-count-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(176, 168, 182, 0.55);
  margin-top: 4px;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-weight: 700;
}

.dash-enc-times {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dash-enc-time-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
}

.dash-enc-time-row.primary { color: #cb97ff; }
.dash-enc-time-row.muted   { color: rgba(176, 168, 182, 0.55); }
.dash-enc-time-row .material-symbols-outlined { font-size: 13px; }

.dash-enc-gauges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dash-enc-gauge-tag {
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid;
  font-family: 'Inter', 'Nunito', sans-serif;
}
.dash-enc-gauge-tag.dash-gauge-empty {
  animation: gauge-alert-pulse 1.5s ease-in-out infinite;
}

.dash-enc-no-gauge {
  font-size: 12px;
  color: rgba(176, 168, 182, 0.4);
  font-style: italic;
}

.dash-enc-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: rgb(203, 213, 225);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: 'Manrope', 'Nunito', sans-serif;
}

.dash-enc-btn:hover {
  background: rgba(203, 151, 255, 0.15);
  color: #cb97ff;
  border-color: rgba(203, 151, 255, 0.2);
}

.dash-enc-btn.btn-active {
  background: #cb97ff;
  color: #46007c;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(203, 151, 255, 0.3);
}

.dash-enc-btn .material-symbols-outlined { font-size: 14px; }

/* Race progression panel */
.dash-race-panel {
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(203, 151, 255, 0.12);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
}

.dash-race-panel::-webkit-scrollbar { width: 3px; }
.dash-race-panel::-webkit-scrollbar-track { background: transparent; }
.dash-race-panel::-webkit-scrollbar-thumb { background: rgba(203, 151, 255, 0.1); border-radius: 10px; }

.dash-race-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-race-row-hd {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-race-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dash-race-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s;
}

.dash-race-empty {
  font-size: 12px;
  color: rgba(176, 168, 182, 0.4);
  font-style: italic;
  text-align: center;
  padding: 16px 0;
}

/* ================================================================
   TABS ROW — ESPACEMENT + DRAG-AND-DROP INDICATEUR
   ================================================================ */

/* Padding aligné avec le header (16px vient déjà du main-area) */
.main-area .tabs-row {
  padding: 8px 28px 0 12px;
  gap: 6px;
}

/* Tab : position relative nécessaire pour le pseudo-élément d'insertion */
.main-area .tab {
  position: relative;
}

/* Indicateur de position lors du drag-and-drop :
   barre violette sur le côté gauche du tab cible */
.main-area .tab.drag-over::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: #cb97ff;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(203, 151, 255, 0.8), 0 0 20px rgba(203, 151, 255, 0.4);
  z-index: 1;
}

/* Tab en cours de déplacement : fantôme translucide */
.main-area .tab.dragging {
  opacity: 0.3;
  transform: scale(0.94);
  border-style: dashed;
  border-color: rgba(203, 151, 255, 0.4) !important;
  box-shadow: none !important;
}

/* Override : surbrillance drag-over plus visible */
.main-area .tab.drag-over {
  background: rgba(203, 151, 255, 0.08) !important;
  border-color: #cb97ff !important;
  box-shadow: 0 0 0 1px rgba(203, 151, 255, 0.3) !important;
  transform: translateX(2px);
  transition: transform 0.1s ease, background 0.1s ease;
}

/* ================================================================
   ENCLOS VIEW — NOUVELLE VERSION
   ================================================================ */

.enc-view-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-family: 'Inter', 'Nunito', sans-serif;
}

/* Glass panel principal */
.enc-panel {
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Ligne principale header : justify-between */
.enc-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Gauche : nom + vider — ne s'étire pas */
.enc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

/* Droite : elapsed + alarme + bouton */
.enc-header-right {
  display: flex;
  align-items: center;
  gap: 48px;
  flex-shrink: 0;
}

.enc-name-input {
  background: transparent;
  border: none;
  color: #f1e8f7;
  font-family: 'Outfit', 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 4px;
  width: auto;
  min-width: 2ch;
  max-width: 400px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.enc-name-input:focus { outline: none; color: #cb97ff; }

.enc-clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 999px;
  color: #f87171;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.enc-clear-btn:hover { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.4); }

.enc-time-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.enc-time-lbl {
  font-size: 10px;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(176, 168, 182, 0.5);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.enc-elapsed {
  font-family: 'Cinzel', serif;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #cb97ff;
  line-height: 1;
}

.enc-alarm {
  font-family: 'Outfit', 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #00ff00;
  line-height: 1;
  text-shadow: 0 0 18px rgba(0, 255, 0, 0.45);
}

.enc-alarm-lbl .material-symbols-outlined { color: #00ff00; }

/* Bouton démarrer / pause */
.enc-start-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #a855f7;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  margin-left: auto;
}
.enc-start-btn:hover { opacity: 0.9; transform: scale(1.02); }
.enc-start-btn:active { transform: scale(0.97); }
.enc-start-btn .material-symbols-outlined { font-size: 22px; }

.enc-start-btn.enc-btn-pause {
  background: linear-gradient(135deg, #b45309, #f59e0b);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

/* Bouton reset timer */
.enc-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  color: #f87171;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.enc-reset-btn:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); }
.enc-reset-btn:active { transform: scale(0.95); }

/* Label section jauges */
.enc-gauge-label {
  font-size: 11px;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(176, 168, 182, 0.5);
}

/* Toggle buttons jauges */
.enc-gauge-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Override gauge-btn pour le nouveau style */
.enc-gauge-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(15, 10, 25, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: rgba(148, 163, 184, 0.7);
  font-size: 12px;
  font-weight: 700;
  font-family: 'Inter', 'Nunito', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.enc-gauge-toggle:hover { background: rgba(255, 255, 255, 0.06); color: #f1e8f7; }
.enc-gauge-toggle.on { background: rgba(168, 85, 247, 0.15); }
.enc-gauge-toggle.locked { opacity: 0.35; cursor: not-allowed; }

/* Grille 2 colonnes pleine largeur */
.enc-gauges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Carte jauge */
.enc-gauge-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.enc-gauge-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.enc-gauge-card-name {
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.enc-tier-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  white-space: nowrap;
  transition: background 0.3s;
}

/* Barre épaisse façon maquette */
.enc-gauge-bar-bg {
  height: 22px;
  background: rgba(5, 8, 20, 0.85);
  border-radius: 999px;
  overflow: hidden;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.enc-gauge-bar-inner {
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
}
.enc-gauge-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s;
}

/* Ligne du bas : [input / 100 000] ←→ [Vide en X] */
.enc-gauge-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.enc-gauge-val-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.enc-gauge-inp {
  background: transparent;
  border: none;
  color: rgba(176, 168, 182, 0.8);
  font: 700 12px 'Inter', 'Nunito', sans-serif;
  width: 45px;
  padding: 0;
  cursor: text;
  transition: color 0.2s;
}
.enc-gauge-inp:focus { outline: none; color: #f1e8f7; }
.enc-gauge-inp:hover { color: #f1e8f7; }
.enc-gauge-inp.recharge { color: #22c55e; }

.enc-gauge-inp-max {
  font-size: 11px;
  color: rgba(176, 168, 182, 0.35);
  white-space: nowrap;
}

.enc-gauge-info {
  font-size: 11px;
  font-weight: 700;
  color: rgba(176, 168, 182, 0.5);
  white-space: nowrap;
  transition: color 0.3s;
}
.enc-gauge-info.enc-gauge-alert {
  color: #eab308;
  animation: gauge-alert-pulse 1.5s ease-in-out infinite;
}
@keyframes gauge-alert-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Bandeau done */
.enc-done-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(34, 197, 94, 0.07);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 16px;
  flex-wrap: wrap;
}
.enc-done-texts { flex: 1; }
.enc-done-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #22c55e;
}
.enc-done-sub { font-size: 12px; color: rgba(176, 168, 182, 0.6); margin-top: 3px; }
.enc-done-reset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  color: #22c55e;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.enc-done-reset-btn:hover { background: rgba(34, 197, 94, 0.2); }

/* Section DD */
.enc-dd-section { display: flex; flex-direction: column; gap: 16px; }

/* Grille DD : max 5-6 cards par ligne */
.enc-dd-section .dd-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.enc-dd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.enc-dd-title {
  font-family: 'Outfit', 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1e8f7;
  display: flex;
  align-items: center;
  gap: 10px;
}
.enc-dd-count {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: rgba(176, 168, 182, 0.5);
  font-weight: 500;
}
.enc-add-dd-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid rgba(203, 151, 255, 0.25);
  border-radius: 10px;
  color: #cb97ff;
  font-family: 'Manrope', 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.enc-add-dd-btn:hover { background: rgba(203, 151, 255, 0.1); border-color: rgba(203, 151, 255, 0.4); }
.enc-add-dd-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ================================================================
   DRAGODINDE CARD — NOUVELLE VERSION
   ================================================================ */

/* Override dd-card */
.enc-dd-card {
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.enc-dd-card:hover { border-color: rgba(203, 151, 255, 0.3); }
.enc-dd-card.dragging { opacity: 0.35; transform: scale(0.97); box-shadow: none; }
.enc-dd-card.drag-over { border-color: #cb97ff; box-shadow: 0 0 0 2px rgba(203, 151, 255, 0.3); }
.enc-dd-card.done { border-color: rgba(34, 197, 94, 0.35); box-shadow: 0 0 16px rgba(34, 197, 94, 0.12); }

/* Badge TERMINÉ */
.enc-dd-done-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #22c55e;
  color: #052e16;
  font-size: 10px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  padding: 3px 12px;
  border-radius: 0 14px 0 10px;
  letter-spacing: 0.06em;
  z-index: 2;
}

/* Header */
.enc-dd-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
}

.enc-dd-drag-handle {
  color: rgba(176, 168, 182, 0.3);
  font-size: 1.1rem;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  padding: 2px 3px;
  line-height: 1;
}
.enc-dd-drag-handle:active { cursor: grabbing; }
.enc-dd-card:hover .enc-dd-drag-handle { opacity: 1; }

.enc-dd-name-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f1e8f7;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 4px;
  min-width: 0;
}
.enc-dd-name-input:focus { outline: none; }

.enc-dd-del-btn {
  background: none;
  border: none;
  color: rgba(176, 168, 182, 0.3);
  cursor: pointer;
  padding: 3px;
  border-radius: 5px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.enc-dd-del-btn:hover { color: #f87171; background: rgba(239, 68, 68, 0.1); }

/* Body */
.enc-dd-body {
  padding: 12px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Stats grid : 5 badges en ligne */
.enc-dd-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.enc-dd-stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px 6px;
  border-radius: 10px;
  background: rgba(15, 10, 25, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: visible;
  cursor: text;
}
.enc-dd-stat-badge.at-max {
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

.enc-dd-stat-icon {
  font-size: 15px;
  line-height: 1;
  margin-bottom: 3px;
}

.enc-dd-stat-input {
  background: transparent;
  border: none;
  color: #f1e8f7;
  font: 700 0.78rem 'Nunito', sans-serif;
  width: 100%;
  min-width: 0;
  text-align: center;
  padding: 0;
  -moz-appearance: textfield;
}
.enc-dd-stat-input:focus { outline: none; }
.enc-dd-stat-input::-webkit-inner-spin-button,
.enc-dd-stat-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Gauge blocks */
.enc-dd-gauge-blocks {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
  margin-top: 4px;
}

.enc-dd-gauge-block { display: flex; flex-direction: column; gap: 6px; }

/* Pill header d'un bloc jauge */
.enc-dd-gauge-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid;
  border-radius: 10px;
}

.enc-dd-pill-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.enc-dd-pill-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Overrides des anciens styles globaux .live-val / .live-delta dans les pills */
.enc-dd-gauge-pill .live-val {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  min-width: 0;
  flex-shrink: 0;
}

.enc-dd-gauge-pill .live-delta {
  font-size: 0.7rem;
  min-width: 0;
  flex-shrink: 0;
}

.enc-dd-pill-cd {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* XP section (mangeoire) */
.enc-dd-xp-section { display: flex; flex-direction: column; gap: 5px; }
.enc-dd-xp-eta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.enc-dd-xp-eta {
  font-size: 11px;
  color: rgba(176, 168, 182, 0.55);
  font-family: 'Inter', sans-serif;
}
.enc-dd-xp-pct {
  font-size: 11px;
  font-weight: 700;
  color: rgba(176, 168, 182, 0.55);
}

/* Barres */
.enc-dd-bar-bg {
  height: 5px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 999px;
  overflow: hidden;
}
.enc-dd-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s;
}

/* Séparateur entre blocs jauges */
.enc-dd-gauge-block + .enc-dd-gauge-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ================================================================
   CIBLES SECTION
   ================================================================ */

.enc-dd-cibles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.enc-dd-cible-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.enc-dd-cible-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.enc-dd-cible-lbl {
  font-size: 11px;
  font-weight: 700;
  color: rgb(148, 163, 184);
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
}

.enc-dd-cible-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.enc-dd-cible-inp {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(176, 168, 182, 0.8);
  font: 700 0.75rem 'Nunito', sans-serif;
  width: 48px;
  text-align: center;
  padding: 1px 2px;
  transition: border-color 0.2s;
}
.enc-dd-cible-inp:focus { outline: none; border-bottom-color: rgba(203, 151, 255, 0.5); }
.enc-dd-cible-inp::placeholder { color: rgba(176, 168, 182, 0.25); font-size: 0.68rem; }

.enc-dd-cible-clr {
  background: none;
  border: none;
  color: rgba(176, 168, 182, 0.3);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.enc-dd-cible-clr:hover { color: #f87171; }

.enc-dd-cible-eta {
  font-size: 11px;
  font-weight: 700;
  color: rgb(100, 116, 139);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

/* ================================================================
   SECTION XP (MANGEOIRE)
   ================================================================ */

.enc-dd-gauge-xp {}

.enc-dd-xp-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 6px;
}

.enc-dd-xp-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.enc-dd-xp-niv {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

.enc-dd-xp-sub {
  font-size: 10px;
  color: rgb(100, 116, 139);
  text-transform: uppercase;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.enc-dd-xp-cd {
  font-size: 13px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: rgb(203, 213, 225);
  letter-spacing: 0.04em;
}

.enc-dd-xp-eta200 {
  display: block;
  font-size: 10px;
  color: rgba(100, 116, 139, 0.7);
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
}

/* ================================================================
   GAUGE BUTTON (JAUGES NON-XP)
   ================================================================ */

.enc-dd-gauge-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(203, 151, 255, 0.1);
  border: 1px solid rgba(203, 151, 255, 0.2);
  color: #cb97ff;
  cursor: default;
  margin-bottom: 8px;
  transition: background 0.15s;
  box-sizing: border-box;
}
.enc-dd-gauge-btn:hover { background: rgba(203, 151, 255, 0.15); }

.enc-dd-gauge-btn-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Inter', sans-serif;
}

.enc-dd-gauge-btn-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Inter', sans-serif;
}

.enc-dd-gauge-btn-cd {
  font-size: 11px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  opacity: 0.8;
  letter-spacing: 0.04em;
}

/* ================================================================
   ACCOUPLEMENT VIEW — Obsidienne Design
   ================================================================ */

.accoup-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px;
}

/* Parent Selection Grid (3 columns) */
.accoup-parents {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
}

.accoup-parent-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accoup-parent-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 8px;
}

.accoup-parent-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--md-on-surface);
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

.accoup-gender-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.accoup-gender-badge.male {
  color: var(--md-secondary);
  background: rgba(134, 20, 90, 0.2);
}
.accoup-gender-badge.female {
  color: var(--md-primary);
  background: rgba(193, 133, 253, 0.2);
}

/* Placeholder card (empty parent slot) */
.accoup-placeholder {
  height: 180px;
  border-radius: 16px;
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.accoup-placeholder:hover {
  background: rgba(255, 255, 255, 0.07);
}

.accoup-placeholder-inner {
  text-align: center;
}

.accoup-placeholder-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  transition: transform 0.2s;
}
.accoup-placeholder:hover .accoup-placeholder-icon {
  transform: scale(1.1);
}
.accoup-placeholder-icon .material-symbols-outlined {
  font-size: 28px;
  opacity: 0.4;
}

.accoup-placeholder-text {
  font-size: 11px;
  color: var(--md-on-surface-variant);
}

/* Selected parent card */
.accoup-selected-parent {
  height: 180px;
  border-radius: 16px;
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
}
.accoup-selected-parent:hover {
  border-color: rgba(168, 85, 247, 0.5);
}
.accoup-selected-parent .race-card-avatar {
  width: 64px;
  height: 64px;
}
.accoup-selected-parent .race-card-avatar img {
  width: 64px;
  height: 64px;
}
.accoup-selected-parent-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--md-on-surface);
}
.accoup-selected-parent-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
}
.accoup-selected-parent-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}
.accoup-selected-parent-clear:hover {
  background: rgba(255, 110, 132, 0.2);
  color: var(--md-error);
}

/* Center pairing column */
.accoup-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
  min-width: 160px;
}

.accoup-heart {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--md-primary), var(--md-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(203, 151, 255, 0.2);
}
.accoup-heart .material-symbols-outlined {
  color: #000;
  font-size: 22px;
}

.accoup-center-inputs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.accoup-center-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.accoup-center-label {
  display: block;
  font-size: 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.accoup-center-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--md-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.accoup-center-input:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 1px var(--md-primary);
}
.accoup-center-input.secondary {
  color: var(--md-secondary);
}
.accoup-center-input.secondary:focus {
  border-color: var(--md-secondary);
  box-shadow: 0 0 0 1px var(--md-secondary);
}

.accoup-register-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--md-primary), var(--md-primary-container));
  color: var(--md-on-primary);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 11px;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(203, 151, 255, 0.3);
  transition: transform 0.1s, box-shadow 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.accoup-register-btn:hover {
  box-shadow: 0 6px 20px rgba(203, 151, 255, 0.4);
}
.accoup-register-btn:active {
  transform: scale(0.98);
}
.accoup-register-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Grid panel (glass) */
.accoup-grid-panel {
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Gen chips */
.accoup-gen-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accoup-gen-chips-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 12px;
}

.accoup-gen-chip {
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--md-on-surface-variant);
  transition: background 0.2s, color 0.2s;
}
.accoup-gen-chip:hover {
  color: var(--md-on-surface);
  background: rgba(255, 255, 255, 0.1);
}
.accoup-gen-chip.active {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

/* Search bar */
.accoup-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.accoup-search {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--md-on-surface);
  padding: 10px 40px 10px 14px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}
.accoup-search:focus {
  border-color: var(--md-primary);
}
.accoup-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.15s;
}
.accoup-search-clear:hover {
  color: var(--md-on-surface);
}

/* Dragon cards grid */
.accoup-race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.accoup-race-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-align: center;
}
.accoup-race-card:hover {
  border-color: rgba(203, 151, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.accoup-race-card-img {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
}
.accoup-race-card-img .race-card-avatar {
  width: 80px;
  height: 80px;
  transition: transform 0.2s;
}
.accoup-race-card:hover .race-card-avatar {
  transform: scale(1.1);
}
.accoup-race-card-img .race-card-avatar img {
  width: 80px;
  height: 80px;
}

.accoup-race-card-gen {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  font-size: 8px;
  font-weight: 700;
  color: var(--md-tertiary, #ffe083);
}

.accoup-race-card-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--md-on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.accoup-empty {
  text-align: center;
  color: var(--md-on-surface-variant);
  padding: 40px;
  font-style: italic;
  font-size: 13px;
}

/* Drag & Drop */
.accoup-race-card[draggable="true"] {
  cursor: grab;
}
.accoup-race-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.accoup-drop-zone.drag-over {
  border-color: var(--md-primary) !important;
  background: rgba(203, 151, 255, 0.1) !important;
  box-shadow: 0 0 24px rgba(203, 151, 255, 0.2), inset 0 0 16px rgba(203, 151, 255, 0.05);
}

/* ================================================================
   RÉAPPROVISIONNEMENT VIEW — Obsidienne Design
   ================================================================ */

.reappro-view-new {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px;
}

.reappro-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.reappro-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--md-on-surface-variant);
}

.reappro-title-bar {
  height: 3px;
  width: 48px;
  background: var(--md-primary);
  border-radius: 2px;
  margin-top: 6px;
}

/* Top bar (back + qty, sticky top) */
.reappro-top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(23, 23, 33, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 12px;
  padding: 10px 16px;
}

.reappro-qty-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sticky target bar at bottom */
.reappro-target-bar-sticky {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(23, 23, 33, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 16px;
  padding: 12px 20px;
  margin-top: 12px;
}

.reappro-target-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reappro-target-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--md-primary), #7c41b5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(203, 151, 255, 0.3);
  flex-shrink: 0;
}
.reappro-target-icon .material-symbols-outlined {
  color: #fff;
  font-size: 20px;
}

.reappro-target-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-on-surface-variant);
  margin-bottom: 2px;
}

.reappro-target-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--md-primary);
}

.reappro-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.reappro-back-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--md-on-surface);
}

/* Step panels */
.reappro-step-panel {
  background: rgba(23, 23, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 16px;
  overflow: hidden;
  border-left: 4px solid var(--md-outline-variant);
}

.reappro-step-primary {
  border-left-color: var(--md-primary);
}

.reappro-step-final {
  border-left-color: var(--md-primary);
  box-shadow: 0 0 24px rgba(203, 151, 255, 0.08);
}

.reappro-step-header {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
}

.reappro-step-header-primary {
  background: rgba(203, 151, 255, 0.08);
}

.reappro-step-header-final {
  background: rgba(203, 151, 255, 0.12);
}

.reappro-step-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--md-on-surface);
}

.reappro-step-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--md-outline-variant);
  flex-shrink: 0;
}

.reappro-badge-primary {
  background: var(--md-primary);
}

.reappro-step-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--md-on-surface-variant);
}

.reappro-final-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--md-primary);
}

/* Materials grid */
.reappro-materials-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 24px;
}

.reappro-material-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.reappro-mat-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--md-outline-variant);
  padding: 2px;
  transition: transform 0.2s;
}
.reappro-material-card:hover .reappro-mat-avatar {
  transform: scale(1.1);
}
.reappro-mat-avatar .race-card-avatar {
  width: 56px;
  height: 56px;
}
.reappro-mat-avatar .race-card-avatar img {
  width: 56px;
  height: 56px;
}

.reappro-mat-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-on-surface);
}

.reappro-mat-qty {
  font-size: 15px;
  font-weight: 800;
}

.reappro-mat-gender {
  font-weight: 800;
}

/* Arrow separator */
.reappro-arrow-sep {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.reappro-arrow-icon {
  color: var(--md-primary);
  opacity: 0.4;
  font-size: 28px;
  animation: reappro-pulse-bounce 2s ease-in-out infinite;
}

@keyframes reappro-pulse-bounce {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50% { transform: translateY(4px) scale(1.1); opacity: 0.8; }
}

/* Crossings grid inside a gen panel */
.reappro-crossings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
}

.reappro-crossing-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  flex: 1 1 280px;
  max-width: 420px;
}

.reappro-crossing-final {
  background: rgba(203, 151, 255, 0.04);
  border-color: rgba(203, 151, 255, 0.2);
}

.reappro-crossing-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reappro-crossing-op {
  color: var(--md-outline-variant);
  font-size: 24px;
}

.reappro-crossing-parent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.reappro-crossing-parent-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--md-outline-variant);
}
.reappro-crossing-parent-avatar .race-card-avatar {
  width: 66px;
  height: 66px;
}
.reappro-crossing-parent-avatar .race-card-avatar img {
  width: 66px;
  height: 66px;
}

.reappro-crossing-parent-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--md-on-surface);
  text-align: center;
}

.reappro-crossing-parent-gender {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.reappro-crossing-baby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.reappro-crossing-baby-final .reappro-baby-avatar {
  border-color: var(--md-primary);
  box-shadow: 0 4px 16px rgba(203, 151, 255, 0.2);
}

.reappro-baby-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--md-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}
.reappro-baby-avatar .race-card-avatar {
  width: 66px;
  height: 66px;
}
.reappro-baby-avatar .race-card-avatar img {
  width: 66px;
  height: 66px;
}

.reappro-baby-gen-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--md-outline-variant);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

.reappro-baby-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-on-surface);
}

.reappro-baby-qty {
  font-size: 16px;
  font-weight: 800;
  color: var(--md-secondary);
}

/* Crossing controls */
.reappro-crossing-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.reappro-repro-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reappro-repro-input {
  width: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--md-primary);
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
.reappro-repro-input:focus {
  border-color: var(--md-primary);
}

.reappro-invert-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--md-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.reappro-invert-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--md-primary);
}

.reappro-couples-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-on-surface-variant);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 8px;
}

/* Save button inside sticky bar */
.reappro-save-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--md-primary), #7c41b5);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(203, 151, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.reappro-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(203, 151, 255, 0.45);
}

/* ═══════════════════════════════════════════════════
   INVENTAIRE — Obsidienne
   ═══════════════════════════════════════════════════ */
.inv-view-new {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px;
}

/* Header */
.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.inv-title {
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.inv-total {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--md-on-surface-variant);
}

/* Filters row */
.inv-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inv-filters-row {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.inv-search-col {
  flex: 0 1 320px;
}
.inv-gen-col {
  flex: 1 1 auto;
  overflow-x: auto;
}
.inv-filter-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--md-on-surface-variant);
  margin-bottom: 6px;
  padding-left: 2px;
}
.inv-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.inv-btn-reset {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.inv-btn-reset:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--md-error, #ff6e84);
}
.inv-btn-calc {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 12px;
  border: none;
  background: var(--md-primary);
  color: #000;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(203, 151, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.inv-btn-calc:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(203, 151, 255, 0.45);
}

/* Race grid */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 24px;
}

/* Card */
.inv-card-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.inv-gen-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid;
  letter-spacing: 0.05em;
}
.inv-avatar {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.inv-card-new:hover .inv-avatar {
  transform: scale(1.05);
}
.inv-avatar .race-card-avatar {
  width: 80px;
  height: 80px;
}
.inv-avatar .race-card-avatar img {
  width: 80px;
  height: 80px;
}
.inv-card-name-new {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

/* Gender inputs */
.inv-gender-row {
  display: flex;
  gap: 8px;
}
.inv-gender-input {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}
.inv-gender-input.male {
  color: #50a0ff;
}
.inv-gender-input.female {
  color: #ff64a0;
}
.inv-gender-symbol {
  font-size: 14px;
  font-weight: 800;
}
.inv-gender-input input {
  width: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 3px 2px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.inv-gender-input input:focus {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.06);
}

/* ── Calculateur panel ── */
.inv-calc-panel {
  background: rgba(41, 35, 50, 0.6);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.inv-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.inv-calc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inv-calc-icon {
  color: var(--md-primary);
  font-size: 28px;
  padding: 10px;
  background: rgba(203, 151, 255, 0.1);
  border-radius: 16px;
}
.inv-calc-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}
.inv-calc-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.inv-calc-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--md-primary);
}
.inv-calc-stat-label {
  font-size: 12px;
  color: var(--md-on-surface-variant);
}
.inv-calc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--md-on-surface-variant);
  font-size: 14px;
}

/* Step */
.inv-calc-step {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.inv-calc-step-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.inv-calc-step-badge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.inv-calc-step-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
}
.inv-calc-step-subtitle {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--md-on-surface-variant);
}
.inv-calc-step-title {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.inv-calc-step-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Crossing row */
.inv-calc-crossing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Parent */
.inv-calc-parent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.inv-calc-parent-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--md-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.inv-calc-parent-avatar .race-card-avatar {
  width: 66px;
  height: 66px;
}
.inv-calc-parent-avatar .race-card-avatar img {
  width: 66px;
  height: 66px;
}
.inv-calc-parent-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--md-on-surface);
  text-align: center;
}
.inv-calc-parent-gender {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

/* Baby */
.inv-calc-baby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.inv-calc-baby-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--md-secondary, #f673b7);
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.inv-calc-baby-avatar .race-card-avatar {
  width: 66px;
  height: 66px;
}
.inv-calc-baby-avatar .race-card-avatar img {
  width: 66px;
  height: 66px;
}
.inv-calc-baby-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.inv-calc-baby-qty {
  font-size: 16px;
  font-weight: 800;
  color: var(--md-secondary, #f673b7);
}

/* Save row */
.inv-calc-save-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 8px;
}

/* ── Unused stock ── */
.inv-unused-section {
  margin-top: 8px;
}
.inv-unused-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.inv-unused-title {
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.inv-unused-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--md-secondary, #f673b7);
  background: rgba(246, 115, 183, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
}
.inv-unused-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.inv-unused-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.inv-unused-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-unused-avatar .race-card-avatar {
  width: 60px;
  height: 60px;
}
.inv-unused-avatar .race-card-avatar img {
  width: 60px;
  height: 60px;
}
.inv-unused-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.inv-unused-qty {
  font-size: 11px;
  font-weight: 700;
  display: flex;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════
   WORKFLOWS — Obsidienne
   ═══════════════════════════════════════════════════ */
.wf-view-new {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px;
}

/* ── List view ── */
.wf-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.wf-list-title {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.wf-list-subtitle {
  font-size: 14px;
  color: var(--md-on-surface-variant);
  margin-top: 4px;
}
.wf-list-count {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--md-on-surface-variant);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.wf-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wf-io-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  color: var(--md-on-surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.wf-io-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.wf-io-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.wf-export-confirm {
  background: var(--md-primary) !important;
  color: var(--md-on-primary) !important;
  border-color: var(--md-primary) !important;
}
.wf-export-confirm:hover:not(:disabled) {
  filter: brightness(1.15);
}
.wf-export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(157, 120, 255, 0.08);
  border: 1px solid rgba(157, 120, 255, 0.2);
  backdrop-filter: blur(8px);
}
.wf-export-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.wf-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--md-on-surface);
  cursor: pointer;
  user-select: none;
}
.wf-select-all-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--md-primary);
  cursor: pointer;
}
.wf-export-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-primary);
  background: rgba(157, 120, 255, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
}
.wf-card-selectable {
  cursor: pointer;
  position: relative;
}
.wf-card-selectable:hover {
  border-color: rgba(157, 120, 255, 0.3) !important;
}
.wf-card-selected {
  border-color: var(--md-primary) !important;
  box-shadow: 0 0 0 1px var(--md-primary), 0 0 16px rgba(157, 120, 255, 0.15) !important;
}
.wf-card-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.wf-card-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--md-primary);
  cursor: pointer;
}
.wf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  color: var(--md-on-surface-variant);
  font-size: 14px;
  font-weight: 700;
}

/* Cards grid */
.wf-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.wf-card {
  background: rgba(23, 23, 33, 0.6);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.wf-card:hover {
  background: rgba(35, 35, 45, 0.8);
  border-color: rgba(168, 85, 247, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.wf-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.wf-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wf-card-gen {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.wf-card-name {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.wf-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}
.wf-card-avatar .race-card-avatar {
  width: 48px;
  height: 48px;
}
.wf-card-avatar .race-card-avatar img {
  width: 48px;
  height: 48px;
}

/* Progress */
.wf-card-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wf-card-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.wf-card-progress-label {
  font-size: 12px;
  color: var(--md-on-surface-variant);
}
.wf-card-progress-pct {
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  font-weight: 800;
}
.wf-card-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}
.wf-card-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s;
  box-shadow: 0 0 10px rgba(203, 151, 255, 0.4);
}

/* Footer */
.wf-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.wf-card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--md-on-surface-variant);
}
.wf-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wf-delete-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.wf-delete-btn:hover {
  background: rgba(255, 110, 132, 0.15);
  border-color: rgba(255, 110, 132, 0.3);
  color: #ff6e84;
}
.wf-card-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--md-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.wf-card:hover .wf-card-arrow {
  background: var(--md-primary);
  color: #000;
  transform: translateX(2px);
}

/* ── Detail view ── */
.wf-detail-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(23, 23, 33, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 12px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.wf-detail-objective {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.wf-detail-obj-text {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--md-primary);
}
.wf-detail-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wf-detail-progress-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.wf-detail-progress-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--md-on-surface-variant);
}
.wf-detail-progress-pct {
  font-size: 16px;
  font-weight: 800;
  color: var(--md-secondary, #f673b7);
}
.wf-detail-progress-bar {
  width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
}
.wf-detail-progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--md-primary), var(--md-secondary, #f673b7));
  transition: width 0.3s;
}

/* Overview card */
.wf-overview-card {
  background: rgba(26, 18, 33, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}
.wf-overview-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.wf-overview-avatar {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  flex-shrink: 0;
}
.wf-overview-avatar .race-card-avatar {
  width: 64px;
  height: 64px;
}
.wf-overview-avatar .race-card-avatar img {
  width: 64px;
  height: 64px;
}
.wf-overview-gen-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.wf-overview-name {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.wf-overview-meta {
  font-size: 12px;
  color: var(--md-on-surface-variant);
  margin-top: 4px;
}
.wf-overview-stats {
  display: flex;
  gap: 16px;
}
.wf-overview-stat {
  text-align: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.wf-overview-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--md-on-surface-variant);
  margin-bottom: 4px;
}
.wf-overview-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

/* Step headers */
.wf-detail-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.wf-detail-step-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}
.wf-detail-step-label {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--md-on-surface-variant);
}

/* Step connector */
.wf-step-connector {
  width: 2px;
  height: 32px;
  background: linear-gradient(to bottom, var(--md-primary), var(--md-secondary, #f673b7));
  margin: 4px auto;
  border-radius: 2px;
}

/* Materials grid */
.wf-materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.wf-material-card {
  background: rgba(26, 18, 33, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s;
}
.wf-material-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
}
.wf-material-complete {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.05);
}
.wf-material-avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.wf-material-avatar .race-card-avatar {
  width: 44px;
  height: 44px;
}
.wf-material-avatar .race-card-avatar img {
  width: 44px;
  height: 44px;
}
.wf-material-info {
  flex: 1;
  min-width: 0;
}
.wf-material-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.wf-material-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.wf-material-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wf-material-need {
  font-size: 11px;
  color: var(--md-on-surface-variant);
  white-space: nowrap;
}
.wf-material-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.wf-material-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--md-primary);
  white-space: nowrap;
}
.wf-material-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}
.wf-material-bar-fill {
  height: 100%;
  background: var(--md-primary);
  border-radius: 4px;
  transition: width 0.3s;
}
.wf-mat-input {
  width: 52px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--md-primary);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
  outline: none;
  margin-top: 8px;
  transition: border-color 0.2s;
}
.wf-mat-input:focus {
  border-color: var(--md-primary);
}

/* Crossings list */
.wf-crossings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.wf-crossing-card {
  background: rgba(26, 18, 33, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 16px;
  padding: 20px;
}
.wf-crossing-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.wf-crossing-parents {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wf-crossing-parent-av {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.wf-crossing-parent-av .race-card-avatar {
  width: 52px;
  height: 52px;
}
.wf-crossing-parent-av .race-card-avatar img {
  width: 52px;
  height: 52px;
}
.wf-crossing-result {
  display: flex;
  align-items: center;
  gap: 16px;
}
.wf-crossing-baby-av {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: rgba(168, 85, 247, 0.1);
  border: 2px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}
.wf-crossing-baby-av .race-card-avatar {
  width: 60px;
  height: 60px;
}
.wf-crossing-baby-av .race-card-avatar img {
  width: 60px;
  height: 60px;
}
.wf-crossing-result-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wf-crossing-baby-name {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.wf-crossing-baby-obj {
  font-size: 11px;
  color: var(--md-on-surface-variant);
}
.wf-crossing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.wf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.wf-dot-done {
  background: var(--md-primary);
}
.wf-crossing-count {
  font-size: 11px;
  font-weight: 800;
  margin-left: 6px;
}
.wf-crossing-input {
  width: 52px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--md-primary);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
  outline: none;
  margin-top: 12px;
  transition: border-color 0.2s;
}
.wf-crossing-input:focus {
  border-color: var(--md-primary);
}

/* ================================================================
   PARAMETRES VIEW — Obsidienne
   ================================================================ */

.param-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
}

/* Hero */
.param-hero {
  margin-bottom: 4px;
}
.param-hero-title {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
}
.param-hero-sub {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  margin: 0;
}

/* Section card */
.param-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
}
.param-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.param-section-icon {
  font-size: 22px;
  color: var(--md-primary);
}
.param-section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.param-section-desc {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  margin: 0 0 16px;
}

/* Sound grid */
.param-sound-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.param-sound-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--md-on-surface-variant);
}
.param-sound-card:hover {
  background: rgba(157, 120, 255, 0.08);
  border-color: rgba(157, 120, 255, 0.2);
}
.param-sound-card.active {
  background: rgba(157, 120, 255, 0.15);
  border-color: var(--md-primary);
  color: var(--md-primary);
}
.param-sound-icon {
  font-size: 28px;
}
.param-sound-label {
  font-size: 12px;
  font-weight: 600;
}
.param-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(157, 120, 255, 0.1);
  border: 1px solid rgba(157, 120, 255, 0.2);
  color: var(--md-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.param-test-btn:hover {
  background: rgba(157, 120, 255, 0.2);
}
.param-test-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Toggle switch */
.param-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.param-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
}
.param-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}
.param-toggle.active {
  background: var(--md-primary);
  border-color: var(--md-primary);
}
.param-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s;
  pointer-events: none;
}
.param-toggle.active .param-toggle-knob {
  transform: translateX(22px);
}

/* Mobile status */
.param-mobile-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.param-mobile-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.param-mobile-dot.active {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}
.param-mobile-text {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  font-weight: 500;
}
.param-mobile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(157, 120, 255, 0.1);
  border: 1px solid rgba(157, 120, 255, 0.2);
  color: var(--md-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.param-mobile-btn:hover {
  background: rgba(157, 120, 255, 0.2);
}
.param-mobile-btn.active {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}
.param-mobile-btn.active:hover {
  background: rgba(34, 197, 94, 0.15);
}
.param-mobile-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Modal overlay */
.param-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.param-modal-overlay.hidden {
  display: none;
}
.param-modal-box {
  background: rgba(28, 23, 46, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.param-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.param-modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.param-modal-title {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.param-modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.param-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.param-modal-body {
  padding: 20px 24px;
}
.param-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.param-modal-btn-ghost {
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--md-on-surface-variant);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.param-modal-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Ntfy intro */
.param-ntfy-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.param-ntfy-intro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  border-radius: 14px;
  background: rgba(157, 120, 255, 0.06);
  border: 1px solid rgba(157, 120, 255, 0.12);
}
.param-ntfy-intro-card p {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  line-height: 1.6;
  margin: 0;
}
.param-ntfy-activate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--md-primary);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.param-ntfy-activate:hover {
  filter: brightness(1.15);
}
.param-ntfy-activate .material-symbols-outlined {
  font-size: 20px;
}

/* Ntfy steps */
.param-ntfy-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.param-ntfy-step {
  display: flex;
  gap: 14px;
}
.param-ntfy-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--md-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.param-ntfy-step-content {
  flex: 1;
  min-width: 0;
}
.param-ntfy-step-title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.param-ntfy-step-desc {
  font-size: 12px;
  color: var(--md-on-surface-variant);
  line-height: 1.6;
  margin: 0 0 12px;
}
.param-ntfy-step-desc a {
  color: var(--md-primary);
  text-decoration: none;
}
.param-ntfy-step-desc a:hover {
  text-decoration: underline;
}
.param-ntfy-qr-wrap {
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  display: inline-block;
}
.param-ntfy-qr-main {
  padding: 10px;
}

/* Ntfy actions */
.param-ntfy-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.param-ntfy-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(157, 120, 255, 0.1);
  border: 1px solid rgba(157, 120, 255, 0.2);
  color: var(--md-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.param-ntfy-test-btn:hover {
  background: rgba(157, 120, 255, 0.2);
}
.param-ntfy-test-btn .material-symbols-outlined {
  font-size: 16px;
}
.param-ntfy-deactivate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.param-ntfy-deactivate-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}
.param-ntfy-deactivate-btn .material-symbols-outlined {
  font-size: 16px;
}

@media (max-width: 600px) {
  .param-sound-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================================================
   STATISTIQUES VIEW — Obsidienne
   ================================================================ */
.stats-view {
  padding: 0 8px;
}

/* Hero + Period filter */
.stats-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.stats-hero-title {
  font-family: 'Manrope', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.stats-hero-sub {
  font-size: 14px;
  color: var(--md-on-surface-variant);
  margin-top: 6px;
  max-width: 500px;
}
.stats-period-chips {
  display: flex;
  gap: 6px;
}
.stats-period-chip {
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.stats-period-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.stats-period-chip.active {
  background: var(--md-primary);
  color: var(--md-on-primary);
  border-color: var(--md-primary);
}

/* KPI Grid */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stats-kpi-card {
  background: var(--md-surface-container);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stats-kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(157, 120, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.stats-kpi-icon {
  font-size: 20px;
  color: var(--md-primary);
}
.stats-kpi-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--md-on-surface-variant);
}
.stats-kpi-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.stats-kpi-value {
  font-family: 'Manrope', sans-serif;
  font-size: 34px;
  font-weight: 900;
  color: var(--md-on-surface);
  letter-spacing: -0.02em;
}
.stats-kpi-total {
  font-size: 16px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
  letter-spacing: 0;
}

/* Delta badges */
.stats-delta {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.stats-delta-up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.stats-delta-down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}
.stats-delta-neutral {
  color: var(--md-on-surface-variant);
  background: rgba(255, 255, 255, 0.05);
}

/* Two column layout */
.stats-two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

/* Chart panels shared */
.stats-chart-panel,
.stats-race-panel,
.stats-history-panel {
  background: var(--md-surface-container-high);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 22px;
  padding: 28px;
}
.stats-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.stats-chart-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--md-on-surface);
}
.stats-chart-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--md-on-surface);
  background: var(--md-surface-container-highest);
  padding: 5px 12px;
  border-radius: 20px;
}
.stats-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 0;
  color: var(--md-on-surface-variant);
  font-size: 13px;
}

/* Bar chart area */
.stats-chart-area {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.stats-chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 10px;
  color: var(--md-on-surface-variant);
  padding-right: 10px;
  height: 200px;
  position: absolute;
  left: 0;
  top: 0;
}
.stats-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 200px;
  padding-left: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}
.stats-bar-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  position: relative;
}
.stats-bar {
  width: 100%;
  max-width: 10px;
  border-radius: 3px 3px 0 0;
  background: rgba(157, 120, 255, 0.3);
  transition: height 0.3s ease, background 0.2s;
  min-height: 0;
}
.stats-bar-col:hover .stats-bar {
  background: rgba(157, 120, 255, 0.7);
}
.stats-bar-today {
  background: linear-gradient(180deg, var(--md-primary), rgba(157, 120, 255, 0.6));
  box-shadow: 0 0 16px rgba(157, 120, 255, 0.35);
}

/* Bar tooltip */
.stats-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--md-surface-container-highest);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--md-on-surface);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  line-height: 1.4;
}
.stats-tooltip strong {
  color: var(--md-primary);
  font-weight: 800;
}
.stats-bar-col:hover .stats-tooltip {
  opacity: 1;
}

.stats-chart-x-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 36px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--md-on-surface-variant);
}

/* Race distribution panel */
.stats-race-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.stats-donut-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 16px;
}
.stats-donut-svg {
  display: block;
}
.stats-donut-arc {
  transition: opacity 0.2s;
  cursor: default;
}
.stats-donut-arc:hover {
  opacity: 0.75;
  filter: brightness(1.2);
}
.stats-donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stats-donut-num {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--md-on-surface);
}
.stats-donut-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--md-on-surface-variant);
}

/* Race legend */
.stats-race-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats-race-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stats-race-legend-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stats-race-legend-right {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stats-race-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stats-race-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--md-on-surface);
}
.stats-race-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
}
.stats-race-pct {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: var(--md-on-surface);
  min-width: 36px;
  text-align: right;
}

/* History panel — race bars */
.stats-history-panel {
  margin-bottom: 20px;
}
.stats-race-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stats-race-bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stats-race-bar-name {
  width: 130px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  text-align: right;
}
.stats-race-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
}
.stats-race-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.stats-race-bar-count {
  width: 36px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(176, 168, 182, 0.7);
  text-align: right;
}

/* Generation breakdown bars */
.stats-gen-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stats-gen-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-gen-label {
  width: 52px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.stats-gen-bar-wrap {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 5px;
  overflow: hidden;
}
.stats-gen-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}
.stats-gen-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.stats-gen-count {
  font-size: 14px;
  font-weight: 800;
  color: var(--md-on-surface);
  min-width: 28px;
  text-align: right;
}
.stats-gen-rate {
  font-size: 11px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}
.stats-gen-races {
  font-size: 11px;
  color: var(--md-on-surface-variant);
}

/* Weekday activity heatmap */
.stats-weekday-grid {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 0;
}
.stats-weekday-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.stats-weekday-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stats-weekday-block {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  cursor: default;
}
.stats-weekday-block:hover {
  transform: scale(1.08);
}
.stats-weekday-count {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

/* Race success rate */
.stats-success-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats-success-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-success-race {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 220px;
  flex-shrink: 0;
}
.stats-success-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.stats-success-avatar .race-card-avatar {
  width: 48px;
  height: 48px;
}
.stats-success-avatar .race-card-avatar img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.stats-success-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-success-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
}
.stats-success-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.stats-success-rate,
.stats-couple-rate {
  font-size: 13px;
  font-weight: 800;
  min-width: 42px;
  text-align: right;
}
.stats-rate-high { color: #22c55e; }
.stats-rate-mid { color: #eab308; }
.stats-rate-low { color: #ef4444; }
.stats-success-detail,
.stats-couple-detail {
  font-size: 11px;
  color: var(--md-on-surface-variant);
  min-width: 44px;
  text-align: right;
}

/* Best couples */
.stats-couples-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats-couple-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.stats-couple-rank {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--md-primary);
  min-width: 28px;
}
.stats-couple-parents {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stats-couple-av {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.stats-couple-av .race-card-avatar {
  width: 48px;
  height: 48px;
}
.stats-couple-av .race-card-avatar img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.stats-couple-baby {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.stats-couple-baby-av {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.stats-couple-baby-av .race-card-avatar {
  width: 56px;
  height: 56px;
}
.stats-couple-baby-av .race-card-avatar img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Missing races */
.stats-missing-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.stats-missing-gen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats-missing-gen-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}
.stats-missing-races {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stats-missing-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
  max-width: 200px;
}
.stats-missing-av {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  opacity: 0.5;
}
.stats-missing-av .race-card-avatar {
  width: 48px;
  height: 48px;
}
.stats-missing-av .race-card-avatar img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: grayscale(0.6);
}
.stats-missing-name {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.stats-badge-success {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #22c55e !important;
}

/* Responsive */
@media (max-width: 900px) {
  .stats-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-two-col {
    grid-template-columns: 1fr;
  }
  .stats-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-success-race {
    width: 140px;
  }
}

/* ─────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(30, 20, 50, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  font-size: 0.92rem;
  font-family: var(--font-body);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: none;
  min-width: 260px;
  max-width: 400px;
}

.toast-visible {
  animation: toast-in 0.3s ease forwards;
}

.toast-exit {
  animation: toast-out 0.3s ease forwards;
}

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
  line-height: 1.3;
}

.toast-action {
  flex-shrink: 0;
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #bb86fc;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.toast-action:hover {
  background: rgba(187, 134, 252, 0.18);
}

.toast-success {
  border-left: 3px solid #4caf50;
}
.toast-success .toast-icon {
  color: #4caf50;
}

.toast-error {
  border-left: 3px solid #f44336;
}
.toast-error .toast-icon {
  color: #f44336;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

/* ─────────────────────────────────────────────────
   PARAM DATA BACKUP SECTION
   ───────────────────────────────────────────────── */
.param-data-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.param-data-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #e0e0e0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.param-data-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.param-data-btn:active {
  transform: scale(0.97);
}
.param-data-btn .material-symbols-outlined {
  font-size: 1.2rem;
}

.param-data-btn-import {
  border-color: rgba(255, 183, 77, 0.3);
  color: #ffb74d;
}
.param-data-btn-import:hover {
  background: rgba(255, 183, 77, 0.1);
}

/* ─────────────────────────────────────────────────
   CONFIRM MODAL
   ───────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: confirm-fade-in 0.2s ease;
}
.confirm-overlay.confirm-hidden {
  display: none;
}

.confirm-box {
  background: rgba(30, 20, 50, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px 32px 24px;
  min-width: 340px;
  max-width: 440px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: confirm-scale-in 0.2s ease;
}

.confirm-icon {
  font-size: 2.4rem;
  color: #ffb74d;
  display: block;
  margin-bottom: 12px;
}

.confirm-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.confirm-msg {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: #b0b0b0;
  margin: 0 0 24px;
  line-height: 1.4;
}

.confirm-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.confirm-btn:active {
  transform: scale(0.97);
}

.confirm-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
}
.confirm-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
}
.confirm-btn-cancel:focus-visible {
  outline: 2px solid var(--md-primary);
  outline-offset: 2px;
}

.confirm-btn-ok {
  background: #f44336;
  color: #fff;
}
.confirm-btn-ok:hover {
  background: #e53935;
}
.confirm-btn-ok:focus-visible {
  outline: 2px solid #f44336;
  outline-offset: 2px;
}

@keyframes confirm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes confirm-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
