/* =========================================================
   Rapport d'intervention — Sutton
   Esthétique : outdoor pro, vert forêt + blanc cassé chaud
   ========================================================= */

:root {
  --bg: #F6F4EF;
  --bg-warm: #EFEBE3;
  --panel: #FFFFFF;
  --panel-2: #FAF8F3;
  --ink: #1A2520;
  --ink-2: #2E3B35;
  --muted: #6B7670;
  --muted-2: #94978E;
  --border: #E2DED5;
  --border-strong: #C9C3B6;
  --primary: #2D5C42;
  --primary-hover: #3A7355;
  --primary-soft: #DFE9E2;
  --primary-ink: #173626;
  --accent: #C44536;
  --accent-soft: #F5DDD8;
  --warning: #E8B547;
  --shadow-sm: 0 1px 2px rgba(26, 37, 32, 0.04), 0 1px 3px rgba(26, 37, 32, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 37, 32, 0.06), 0 2px 4px rgba(26, 37, 32, 0.04);
  --shadow-lg: 0 12px 32px rgba(26, 37, 32, 0.08), 0 4px 8px rgba(26, 37, 32, 0.04);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mono { font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ========== App layout ========== */
.app {
  display: grid;
  grid-template-columns: 304px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } }

/* ========== Sidebar ========== */
.sidebar {
  background: var(--ink);
  color: #E7EAE8;
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (max-width: 900px) {
  .sidebar { position: relative; height: auto; padding: 16px 18px; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3A7355, #2D5C42 60%);
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: rgba(231, 234, 232, 0.55); margin-top: 2px; font-weight: 400; }

.report-meta {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-meta-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(231,234,232,0.5); font-weight: 500; }
.report-meta-value { font-family: 'Geist Mono', monospace; font-size: 12.5px; color: #E7EAE8; font-weight: 500; }

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(231,234,232,0.4);
  font-weight: 500;
  margin-bottom: 4px;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(231,234,232,0.7);
  text-align: left;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: #E7EAE8; }
.nav-item.active {
  background: rgba(58, 115, 85, 0.18);
  color: #FFFFFF;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--primary-hover);
  border-radius: 0 2px 2px 0;
}
.nav-num {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05);
  color: rgba(231,234,232,0.6);
  font-weight: 500;
}
.nav-item.active .nav-num { background: var(--primary-hover); color: white; }
.nav-item.done .nav-num {
  background: rgba(58, 115, 85, 0.35);
  color: white;
}
.nav-check { width: 14px; height: 14px; color: rgba(231,234,232,0.4); }
.nav-item.done .nav-check { color: var(--primary-hover); }

.progress-overall {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.progress-row { display: flex; justify-content: space-between; align-items: center; }
.progress-label { font-size: 11px; color: rgba(231,234,232,0.55); text-transform: uppercase; letter-spacing: 0.08em; }
.progress-value { font-family: 'Geist Mono', monospace; font-size: 13px; color: white; font-weight: 500; }
.progress-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary-hover), #4A8A66); transition: width 0.3s; }

.draft-saved {
  font-size: 11px;
  color: rgba(231,234,232,0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}
.draft-saved .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4A8A66;
  box-shadow: 0 0 6px #4A8A66;
}

/* ========== Main column ========== */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: rgba(246, 244, 239, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
@media (max-width: 900px) { .topbar { padding: 14px 20px; } }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.step-counter {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 6px;
}
.topbar-title { font-size: 14px; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.12s;
  background: white;
  color: var(--ink);
  border-color: var(--border);
}
.btn:hover { background: var(--panel-2); border-color: var(--border-strong); }
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn-danger { color: var(--accent); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--accent-soft); }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn svg { width: 16px; height: 16px; }

/* ========== Content ========== */
.content {
  flex: 1;
  padding: 40px 48px 80px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 900px) { .content { padding: 24px 18px 60px; } }

.step-header { margin-bottom: 28px; }
.step-eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}
.step-title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  line-height: 1.1;
}
.step-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  max-width: 60ch;
  line-height: 1.55;
}

/* ========== Cards / sections ========== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 18px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.card-title-icon {
  width: 28px; height: 28px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 7px;
  display: grid; place-items: center;
}
.card-title-icon svg { width: 16px; height: 16px; }
.card-subtitle { color: var(--muted); font-size: 13px; }

/* ========== Form grid ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-8 { grid-column: span 8; }
@media (max-width: 720px) {
  .col-6, .col-4, .col-3, .col-8 { grid-column: span 12; }
}

/* ========== Field ========== */
.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.label-req { color: var(--accent); font-weight: 600; }
.label-hint { color: var(--muted-2); font-weight: 400; font-size: 12px; }

.input, .select, .textarea {
  width: 100%;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 92, 66, 0.12);
}
.textarea { resize: vertical; min-height: 80px; font-family: inherit; line-height: 1.5; }
.input-mono { font-family: 'Geist Mono', monospace; font-size: 14px; }

.input-with-icon { position: relative; }
.input-with-icon .input { padding-left: 38px; }
.input-with-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }

.input-prefix-suffix {
  display: flex; align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.input-prefix-suffix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,92,66,0.12); }
.input-prefix-suffix .prefix, .input-prefix-suffix .suffix {
  padding: 0 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  display: grid; place-items: center;
  border-right: 1px solid var(--border);
  font-family: 'Geist Mono', monospace;
}
.input-prefix-suffix .suffix { border-right: none; border-left: 1px solid var(--border); }
.input-prefix-suffix .input { border: none; box-shadow: none; }

/* ========== Chips (single / multi-select) ========== */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); background: var(--panel-2); }
.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.chip-square { border-radius: 8px; }
.chip-large { padding: 11px 16px; font-size: 14px; }

/* ========== Big code selector ========== */
.code-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 720px) { .code-grid { grid-template-columns: repeat(2, 1fr); } }
.code-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  background: white;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}
.code-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.code-card.selected {
  border-color: var(--ink);
  background: var(--panel-2);
  box-shadow: var(--shadow-md);
}
.code-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  margin: 0 auto 10px;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--border);
}
.code-card.selected .code-dot {
  box-shadow: 0 0 0 2px var(--ink);
}
.code-label { font-weight: 600; font-size: 14px; color: var(--ink); }
.code-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ========== Toggle / switch ========== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.toggle-row:hover { border-color: var(--border-strong); }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.toggle-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.toggle {
  width: 42px; height: 24px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.18s cubic-bezier(.32,.72,.42,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(18px); }

/* ========== Searchable patrouilleur select ========== */
.patrouiller-pick {
  border: 1px dashed var(--border-strong);
  background: var(--panel-2);
  padding: 14px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.12s;
}
.patrouiller-pick:hover { border-color: var(--primary); background: var(--primary-soft); }
.patrouiller-pick.filled { background: white; border: 1px solid var(--border); border-style: solid; }
.patrouiller-pick-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.patrouiller-pick-empty .patrouiller-pick-avatar {
  background: var(--bg-warm);
  color: var(--muted-2);
  border: 1px dashed var(--border-strong);
}
.patrouiller-pick-info { flex: 1; min-width: 0; }
.patrouiller-pick-role { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.patrouiller-pick-name { font-size: 14px; font-weight: 500; color: var(--ink); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patrouiller-pick-empty .patrouiller-pick-name { color: var(--muted-2); font-weight: 400; }

/* ========== Modal (patrouilleur picker) ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 37, 32, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s cubic-bezier(.32,.72,.42,1);
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.modal-option {
  padding: 11px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.08s;
}
.modal-option:hover { background: var(--panel-2); }
.modal-option-id { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--muted); width: 60px; flex-shrink: 0; }
.modal-option-name { font-size: 14px; }
.modal-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }

/* ========== Footer (step nav) ========== */
.footer {
  position: sticky;
  bottom: 0;
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 14px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
@media (max-width: 900px) { .footer { padding: 12px 18px; } }
.footer-hint { font-size: 12.5px; color: var(--muted); }

/* ========== Body diagram ========== */
.body-diagram-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .body-diagram-wrap { grid-template-columns: 1fr; } }
.body-diagram {
  background: var(--panel-2);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
}
.body-diagram svg { width: 100%; max-width: 180px; height: auto; }
.body-diagram .region { fill: #D6D9D2; cursor: pointer; transition: fill 0.1s; stroke: white; stroke-width: 1; }
.body-diagram .region:hover { fill: #B5BCAF; }
.body-diagram .region.selected { fill: var(--accent); }

/* ========== Injury card ========== */
.injury-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: var(--panel-2);
  margin-bottom: 12px;
}
.injury-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.injury-num {
  background: var(--accent);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
}

/* ========== Pain scale ========== */
.pain-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.pain-num {
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
  transition: all 0.1s;
  font-size: 14px;
}
.pain-num:hover { background: white; border-color: var(--border-strong); }
.pain-num.selected { color: white; border-color: transparent; transform: scale(1.05); }
.pain-num.selected[data-level="0"] { background: #3FA66B; }
.pain-num.selected[data-level="1"], .pain-num.selected[data-level="2"], .pain-num.selected[data-level="3"] { background: #6BAB54; }
.pain-num.selected[data-level="4"], .pain-num.selected[data-level="5"], .pain-num.selected[data-level="6"] { background: #E8B547; color: var(--ink); }
.pain-num.selected[data-level="7"], .pain-num.selected[data-level="8"] { background: #E08A3C; }
.pain-num.selected[data-level="9"], .pain-num.selected[data-level="10"] { background: var(--accent); }
.pain-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ========== ABCDE / AVPU stack ========== */
.assess-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.assess-row:last-child { border-bottom: none; }
.assess-letter {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Geist Mono', monospace;
}
.assess-letter[data-l="A"] { background: #C44536; }
.assess-letter[data-l="B"] { background: #E08A3C; }
.assess-letter[data-l="C"] { background: #E8B547; color: var(--ink); }
.assess-letter[data-l="D"] { background: #3FA66B; }
.assess-letter[data-l="E"] { background: #2D5C42; }
.assess-content { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; align-items: center; }
@media (max-width: 720px) { .assess-content { grid-template-columns: 1fr; } }
.assess-label { font-weight: 500; font-size: 14px; }
.assess-hint { font-size: 12px; color: var(--muted); }

/* ========== Recap ========== */
.recap-section {
  margin-bottom: 18px;
}
.recap-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.recap-edit { font-size: 12px; color: var(--muted); cursor: pointer; text-transform: none; letter-spacing: 0; }
.recap-edit:hover { color: var(--primary); }
.recap-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 8px 16px; }
.recap-key { color: var(--muted); font-size: 13px; }
.recap-val { color: var(--ink); font-size: 13px; font-weight: 500; }
.recap-val.empty { color: var(--muted-2); font-style: italic; font-weight: 400; }

/* ========== Signature pad ========== */
.signature {
  background: white;
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  height: 180px;
  position: relative;
  cursor: crosshair;
}
.signature canvas { width: 100%; height: 100%; display: block; border-radius: 10px; }
.signature-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 13px;
  pointer-events: none;
}
.signature.signed { border-style: solid; border-color: var(--primary-soft); }
.signature.signed .signature-placeholder { display: none; }

/* ========== Submitted screen ========== */
.submitted {
  text-align: center;
  padding: 80px 20px;
}
.submitted-check {
  width: 80px; height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: grid; place-items: center;
  color: var(--primary);
  animation: bounce 0.5s cubic-bezier(.36,.66,.4,1.7);
}
@keyframes bounce { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.submitted-check svg { width: 40px; height: 40px; }
.submitted h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 8px; }
.submitted p { color: var(--muted); margin: 0 0 28px; }
.submitted-meta {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
}

/* ========== Sidebar view switcher ========== */
.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.view-switch button {
  background: transparent;
  border: none;
  color: rgba(231,234,232,0.6);
  padding: 8px 10px;
  font-size: 12.5px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.view-switch button:hover { color: #E7EAE8; }
.view-switch button.active {
  background: rgba(58, 115, 85, 0.35);
  color: white;
}
.view-switch button svg { width: 14px; height: 14px; }

/* ========== Stats row ========== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .stats-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.stat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.stat-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-feature-settings: "tnum";
  line-height: 1;
}
.stat-sub {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 4px;
}

/* ========== Report table ========== */
.report-table {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 16px;
}
.report-table-header,
.report-row {
  display: grid;
  grid-template-columns: 130px 80px 100px 1.4fr 1.2fr 1fr 130px;
  gap: 12px;
  padding: 12px 18px;
  align-items: center;
}
.report-table-header {
  background: var(--panel-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.report-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.report-row:last-child { border-bottom: none; }
.report-row:hover { background: var(--panel-2); }

.report-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

@media (max-width: 900px) {
  .report-table-header { display: none; }
  .report-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "num code" "date status" "patient patient" "endroit endroit" "type type";
    gap: 4px 12px;
  }
  .report-row > div:nth-child(1) { grid-area: num; }
  .report-row > div:nth-child(2) { grid-area: date; }
  .report-row > div:nth-child(3) { grid-area: code; justify-self: end; }
  .report-row > div:nth-child(4) { grid-area: patient; }
  .report-row > div:nth-child(5) { grid-area: endroit; }
  .report-row > div:nth-child(6) { grid-area: type; color: var(--muted) !important; }
  .report-row > div:nth-child(7) { grid-area: status; justify-self: end; }
}

/* ========== Code badge ========== */
.code-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
}
.code-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}

/* ========== Status pill ========== */
.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  white-space: nowrap;
}
.status-pill.warn { background: #FCEDD0; color: #7A5400; }
.status-pill.alert { background: var(--accent-soft); color: #6A1F18; font-family: 'Geist Mono', monospace; }

/* tablet adjustments */
@media (max-width: 1100px) {
  .step-title { font-size: 28px; }
}
