/* ==========================================================================
   Simulateur Triage NNT · LCA-Book
   ========================================================================== */

.stn-widget {
  --stn-ink: #0f172a;
  --stn-muted: #64748b;
  --stn-line: #e2e8f0;
  --stn-bg-card: #ffffff;
  --stn-accent: #2563eb;
  --stn-success: #16a34a;
  --stn-warning: #ea580c;
  --stn-danger: #dc2626;

  margin: 2rem 0;
  padding: 1.75rem 1.5rem;
  background: #f8fafc;
  border: 1px solid var(--stn-line);
  border-radius: 14px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--stn-ink);
}

.stn-header-wrap {
  margin-bottom: 1.5rem;
}

.stn-badge-mission {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}

.stn-intro-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #334155;
  margin: 0.5rem 0 0 0;
}

/* ==================== DASHBOARD / COMPTEURS ==================== */
.stn-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) auto;
  gap: 1rem;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--stn-line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.stn-dash-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stn-dash-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--stn-muted);
}

.stn-dash-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.stn-dash-num {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stn-budget-card .stn-dash-num {
  color: #2563eb;
}

.stn-score-card .stn-dash-num {
  color: #0f172a;
}

.stn-dash-denom {
  font-size: 0.85rem;
  color: var(--stn-muted);
  font-weight: 500;
  white-space: nowrap;
}

.stn-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.stn-progress-bar {
  height: 100%;
  background: #2563eb;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.stn-progress-lives {
  background: #16a34a;
}

.stn-dash-actions {
  display: flex;
  align-items: center;
}

.stn-reset-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.stn-reset-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==================== GRILLE DES 5 GROUPES ==================== */
.stn-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stn-group-card {
  background: #ffffff;
  border: 1px solid var(--stn-line);
  border-top: 4px solid var(--grp-color);
  border-radius: 10px;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.stn-group-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stn-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.stn-grp-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--stn-muted);
}

.stn-grp-risk {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--grp-color);
  background: var(--grp-bg);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--grp-color);
}

.stn-grp-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--stn-ink);
  line-height: 1.25;
}

.stn-grp-sub {
  font-size: 0.75rem;
  color: var(--stn-muted);
  line-height: 1.3;
  min-height: 2rem;
  margin-top: 0.2rem;
}

.stn-grp-pop {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.65rem;
}

.stn-alloc-display {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.stn-alloc-doses {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.stn-alloc-lives {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--grp-color);
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}

.stn-card-progress {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.stn-card-progress-bar {
  height: 100%;
  background: var(--grp-color);
  transition: width 0.2s ease;
}

/* Boutons de contrôle par carte */
.stn-card-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.stn-ctrl-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.stn-ctrl-btn:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.stn-ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stn-btn-clear {
  color: #94a3b8;
  padding: 0.35rem 0.45rem;
}

.stn-btn-clear:hover:not(:disabled) {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

.stn-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--stn-muted);
  font-variant-numeric: tabular-nums;
}

.stn-footer-nnt {
  font-weight: 700;
}

/* ==================== PANNEAU DE VERDICT ==================== */
.stn-verdict-box {
  background: #ffffff;
  border: 1px solid var(--stn-line);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  min-height: 90px;
}

.stn-verdict-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.stn-verdict-content {
  flex: 1;
  min-width: 0;
}

.stn-verdict-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: var(--stn-ink);
}

.stn-verdict-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #334155;
}

.stn-verdict-replay-wrap {
  margin-top: 0.85rem;
}

.stn-verdict-replay-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 0.2s ease;
}

.stn-verdict-replay-btn:hover {
  background: #1d4ed8;
}

/* États du verdict */
.stn-verdict-box.stn-v-optimal {
  border-color: #86efac;
  background: #f0fdf4;
}

.stn-verdict-box.stn-v-optimal .stn-verdict-title {
  color: #15803d;
}

.stn-verdict-box.stn-v-suboptimal {
  border-color: #fed7aa;
  background: #fff7ed;
}

.stn-verdict-box.stn-v-suboptimal .stn-verdict-title {
  color: #c2410c;
}
