:root {
  --navy: #10213f;
  --navy-light: #1b3363;
  --gold: #c9a227;
  --gold-light: #e6c65c;
  --bg: #f4f5f8;
  --text: #1c2333;
  --text-muted: #6b7280;
  --card-bg: #ffffff;
  --danger: #b3261e;
  --success: #1e7a4c;
  --dormant: #c3c8d1;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 20px 48px;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.brand .logo span {
  color: var(--gold);
}

.brand .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 2px 10px rgba(16, 33, 63, 0.08);
  margin-bottom: 16px;
}

h1, h2, h3 {
  color: var(--navy);
  margin-top: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-of-type {
  margin-top: 0;
}

input[type="text"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8dce3;
  border-radius: 10px;
  font-size: 1rem;
  background: #fbfbfd;
  color: var(--text);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 13px 16px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-light);
}

.btn-gold {
  background: var(--gold);
  color: var(--navy);
}

.btn-secondary {
  background: #eceef2;
  color: var(--navy);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-danger {
  background: #fbeae9;
  color: var(--danger);
  border: 1px solid #f0c6c3;
}

.alert-success {
  background: #e9f6ef;
  color: var(--success);
  border: 1px solid #bfe3cf;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--navy);
  color: #fff;
}

.badge-gold {
  background: var(--gold);
  color: var(--navy);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar .who {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topbar .who strong {
  color: var(--navy);
}

a.link {
  color: var(--navy-light);
}

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.text-center {
  text-align: center;
}

/* ============================================================
   Navigation participant (entre les 4 écrans)
   ============================================================ */

.participant-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 18px;
  border-bottom: 1px solid #e2e5ec;
  padding-bottom: 2px;
}

.participant-nav-link {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.participant-nav-link.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

/* ============================================================
   Formulaires CRM (saisie rapide, clients, invités)
   ============================================================ */

.form-section {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.radio-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  margin: 0;
  color: var(--text);
}

.radio-row input {
  width: auto;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.list-row:last-child {
  border-bottom: none;
}

.list-row .main .title {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.92rem;
}

.list-row .main .sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.list-row .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.list-row .actions a,
.list-row .actions form {
  font-size: 0.78rem;
}

.group-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin: 18px 0 4px;
}

.group-heading:first-child {
  margin-top: 0;
}

.inline-form {
  display: inline;
}

.btn-small {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-small.btn-outline {
  background: #eceef2;
  color: var(--navy);
}

.btn-small.btn-danger {
  background: #fbeae9;
  color: var(--danger);
}

select {
  width: 100%;
}

/* ============================================================
   Dashboard participant (organigramme + compteurs)
   ============================================================ */

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.hero-target {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--navy);
}

.countdown {
  display: flex;
  gap: 8px;
}

.countdown .unit {
  flex: 1;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
}

.countdown .unit .val {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
}

.countdown .unit .lbl {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold-light);
}

.branch-track {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.branch-track .dots {
  display: flex;
  gap: 6px;
}

.branch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dormant);
}

.branch-dot.qualifiee {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.branch-track .label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.branch-track .label strong {
  color: var(--navy);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-tile {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
}

.stat-tile .stat-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  display: block;
}

.stat-tile .stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-tile.span-2 {
  grid-column: 1 / -1;
}

.org-root {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--dormant);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 0.72rem;
}

.org-root .name {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}

.org-root .qualif {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
}

details.branch {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--dormant);
}

details.branch.is-active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.10), transparent 60%);
}

details.branch summary {
  cursor: pointer;
  list-style: none;
}

details.branch summary::-webkit-details-marker {
  display: none;
}

details.branch summary::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

details.branch[open] summary::before {
  transform: rotate(90deg);
}

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

.branch-head .name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
}

.branch-status {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--dormant);
  color: var(--text-muted);
  white-space: nowrap;
}

.branch-status.active {
  background: var(--gold);
  color: var(--navy);
}

.branch-status.actif-badge {
  background: var(--success);
  color: #fff;
}

.branch-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 42px;
}

.sub-list {
  margin-top: 10px;
  padding-left: 24px;
  border-left: 1px dashed var(--dormant);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.legend .item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend .swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
