/* Couleurs du club (vert des logos Entente du Bout du Monde / Locmaria).
   Contrastes WCAG AA : blanc sur primary 6,5:1 ; primary sur fond 6,1:1. */
:root {
  --color-primary: #1e6b34;
  --color-primary-rgb: 30, 107, 52;       /* pour les transparences rgba() */
  --color-primary-dark: #185828;          /* vert dominant des logos */
  --color-primary-soft: #e8f3ea;          /* fonds d'icônes, badges */
  --color-primary-softer: #f3f9f4;        /* surbrillances légères */
  --color-bg: #f3f6f4;
  --color-card: #ffffff;
  --color-text: #1f2433;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-card: 0 2px 10px rgba(31, 36, 51, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

/* --- Auth page --- */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 24px;
  text-align: center;
}

.auth-logo {
  font-size: 40px;
  margin-bottom: 8px;
}

/* --- Logos des clubs --- */

.club-logos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.club-logos img {
  display: block;
  height: auto;
  object-fit: contain;
}

.club-logos-large {
  margin-bottom: 12px;
}

.club-logos-large img {
  width: 104px;
}

.club-logos-small {
  gap: 6px;
}

.club-logos-small img {
  width: 34px;
}

.topbar-home {
  display: flex;
  margin-right: 12px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}

.auth-subtitle {
  color: var(--color-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.auth-form {
  text-align: left;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.password-field {
  position: relative;
  margin-bottom: 12px;
}

.password-field input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 16px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.form-error {
  color: var(--color-danger);
  font-size: 13px;
  margin: 0 0 12px;
}

.error-detail {
  margin-top: 16px;
  font-family: monospace;
  word-break: break-word;
}

.auth-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--color-muted);
}

.auth-hint a {
  color: var(--color-primary);
}

.auth-credit {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--color-muted);
}

.about-card {
  margin-top: 24px;
}

.about-card p {
  margin: 0 0 8px;
}

.about-card .hint {
  margin: 10px 0 0;
  word-break: break-word;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 20px;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

/* --- Authenticated layout --- */

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  z-index: 10;
}

.topbar-title {
  font-weight: 700;
  color: var(--color-primary);
}

.topbar-action {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 14px;
  cursor: pointer;
}

.page-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 100px;
}

.page-title {
  font-size: 22px;
  margin: 8px 0 4px;
}

.page-subtitle {
  color: var(--color-muted);
  margin: 0 0 20px;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.card-placeholder {
  color: var(--color-muted);
  text-align: center;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--color-card);
  box-shadow: 0 -2px 10px rgba(31, 36, 51, 0.08);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--color-muted);
  text-decoration: none;
}

.bottom-nav-item.active {
  color: var(--color-primary);
  font-weight: 600;
}

.bottom-nav-item.disabled {
  opacity: 0.4;
}

.bottom-nav-icon {
  font-size: 20px;
}

.topbar-back {
  font-size: 22px;
  color: var(--color-text);
  text-decoration: none;
  margin-right: 12px;
  padding: 0 4px;
}

.topbar-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title {
  font-size: 16px;
  margin: 24px 0 12px;
}

/* --- Buttons (variantes) --- */

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-border);
}

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

.btn-danger-outline {
  background: none;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.btn-small {
  font-size: 14px;
  padding: 8px 14px;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-dashed {
  width: 100%;
  padding: 16px;
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius-lg);
  background: none;
  color: var(--color-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-dashed:hover {
  background: rgba(var(--color-primary-rgb), 0.06);
}

/* --- Équipes --- */

.team-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 36, 51, 0.12);
}

.team-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--color-primary-soft);
}

.team-card:nth-child(even) .team-avatar {
  background: #eef1ee;
}

.team-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-card-name {
  font-weight: 700;
}

.team-card-meta {
  font-size: 13px;
  color: var(--color-muted);
}

.team-card-chevron {
  font-size: 24px;
  color: var(--color-muted);
}

.team-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.team-header .page-subtitle {
  margin: 0;
}

.team-header-actions {
  display: flex;
  gap: 8px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  color: var(--color-muted);
  cursor: pointer;
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.tab:disabled {
  cursor: default;
  opacity: 0.6;
}

/* --- Formulaires & modales --- */

.dialog {
  width: calc(100% - 32px);
  max-width: 440px;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: 0 20px 50px rgba(31, 36, 51, 0.25);
}

.dialog::backdrop {
  background: rgba(31, 36, 51, 0.45);
}

.dialog-form {
  padding: 24px;
}

.dialog-title {
  font-size: 20px;
  margin: 0 0 16px;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.dialog-actions .btn {
  flex: 1;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 16px;
}

.field input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

.required {
  color: var(--color-danger);
}

.optional {
  color: var(--color-muted);
  font-weight: 400;
}

.field-error {
  display: block;
  color: var(--color-danger);
  font-size: 13px;
  margin-top: 4px;
}

.field-hint {
  display: block;
  color: var(--color-muted);
  font-size: 13px;
  margin-top: 4px;
}

.field-error:empty {
  display: none;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 15px;
  cursor: pointer;
}

.field-checkbox input {
  width: 22px;
  height: 22px;
  accent-color: var(--color-primary);
}

.btn-link-danger {
  display: block;
  margin: 16px auto 0;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--color-danger);
  font-size: 14px;
  cursor: pointer;
}

.warning-box {
  background: #fff7e6;
  border: 1px solid #fcd9a0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: #92400e;
}

/* --- Joueuses / parents --- */

.member-panel {
  padding: 16px;
}

.member-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.member-panel-title {
  font-size: 17px;
  margin: 0;
}

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.member-list li + li {
  border-top: 1px solid var(--color-border);
}

.member-row {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  background: none;
  border: none;
  font-size: 15px;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.member-row:hover {
  background: var(--color-bg);
}

.member-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.member-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.member-name,
.member-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-meta {
  font-size: 12px;
  color: var(--color-muted);
}

.member-chevron {
  font-size: 22px;
  color: var(--color-muted);
}

.member-empty {
  padding: 20px 0;
  text-align: center;
  color: var(--color-muted);
}

.badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
}

/* --- Matchs --- */

.match-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 36, 51, 0.12);
}

.match-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--color-primary-soft);
}

.match-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-card-date {
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 600;
}

.match-card-opponent {
  font-weight: 700;
}

.match-card-meta {
  font-size: 13px;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.past-matches {
  margin-top: 20px;
}

.past-matches summary {
  cursor: pointer;
  padding: 8px 0 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.past-matches .match-card {
  opacity: 0.75;
}

.match-detail-team {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.match-facts {
  list-style: none;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}

.match-comment {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--color-primary);
  color: var(--color-muted);
  font-size: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

@media (max-width: 360px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* --- Transport --- */

.subsection-title {
  font-size: 15px;
  margin: 20px 0 10px;
}

.hint {
  margin: -4px 0 12px;
  font-size: 13px;
  color: var(--color-muted);
}

.transport-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  --status-color: var(--color-muted);
}

.transport-summary.status-complete { --status-color: var(--color-success); }
.transport-summary.status-incomplete { --status-color: var(--color-warning); }
.transport-summary.status-insufficient { --status-color: var(--color-danger); }

.progress {
  position: relative;
  flex-shrink: 0;
  width: 84px;
  height: 84px;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 8;
}

.progress-ring-track {
  stroke: var(--color-border);
}

.progress-ring-value {
  stroke: var(--status-color);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.transport-summary-text p {
  margin: 0 0 4px;
}

.transport-status {
  font-weight: 700;
  font-size: 17px;
}

.transport-count {
  color: var(--color-muted);
  font-size: 14px;
}

.transport-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 14px;
}

.transport-warning {
  color: var(--color-danger);
  font-weight: 600;
  text-decoration: none;
}

.vehicle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.vehicle-card {
  padding: 16px;
}

.vehicle-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.vehicle-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--color-primary-soft);
}

.vehicle-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.vehicle-driver {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-meta {
  font-size: 13px;
  color: var(--color-muted);
}

.vehicle-occupancy {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-success);
}

.vehicle-occupancy::before {
  content: "● ";
}

.vehicle-occupancy.is-full {
  color: var(--color-muted);
}

.vehicle-occupancy.is-full::after {
  content: " complet";
  font-weight: 400;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 20px;
  color: var(--color-muted);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--color-bg);
}

.chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.chip {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.chip:hover {
  border-color: var(--color-primary);
}

.chip:active {
  transform: scale(0.97);
}

.chip-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-free {
  justify-content: center;
  border-style: dashed;
  color: var(--color-muted);
  background: none;
}

.chip-free::before {
  content: "⬜";
  font-size: 12px;
}

.roster-panel {
  margin-top: 12px;
  padding: 12px 16px;
}

.roster-panel .member-panel-header {
  margin-bottom: 0;
}

.roster-panel [data-absent-panel] {
  margin-top: 12px;
}

.roster-counts {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.chip-guest {
  position: relative;
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.chip-tag {
  margin-left: auto;
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: #8b5cf6;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* Parent passager : distinct des joueuses (bleu) */
.chip-parent {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.chip-parent .chip-tag {
  background: #2563eb;           /* blanc sur #2563eb : 5,2:1 */
}

.chip-absent {
  opacity: 0.6;
  text-decoration: line-through;
  background: var(--color-bg);
}

.chip-absent:hover {
  opacity: 1;
  text-decoration: none;
}

.dialog-extras {
  display: flex;
  flex-direction: column;
}

.dialog-extras .btn-link-danger {
  margin-top: 8px;
}

.unassigned-panel {
  margin-top: 20px;
  border: 2px solid #fcd9a0;
  background: #fffaf0;
  padding: 16px;
}

.unassigned-panel .subsection-title {
  margin-top: 0;
}

.parents-panel {
  margin-top: 20px;
  padding: 16px;
  border: 2px solid #bfdbfe;
  background: #f8fbff;
}

.parents-panel summary {
  margin: 0;
  cursor: pointer;
}

.parents-panel .hint {
  margin-top: 8px;
}

.transport-priority {
  margin: 6px 0 0;
  color: #b45309;                /* ambre foncé : 5,0:1 sur blanc */
  font-size: 14px;
  font-weight: 600;
}

.choice-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.choice {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  text-align: left;
  cursor: pointer;
}

.choice:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.04);
}

.choice:disabled {
  cursor: default;
  opacity: 0.5;
}

.choice.is-current {
  opacity: 1;
  border: 2px solid var(--color-primary);
}

.choice-text {
  display: flex;
  flex-direction: column;
}

.choice-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

.choice-meta {
  font-size: 13px;
  color: var(--color-muted);
}

.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  font-size: 16px;
}

/* --- Glisser-déposer (SFD §11-12, §23) --- */

.chip[data-action="player"] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

@media (pointer: fine) {
  .chip[data-action="player"] {
    cursor: grab;
  }
}

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none;
  margin: 0;
  border-color: var(--color-primary);
  box-shadow: 0 12px 28px rgba(var(--color-primary-rgb), 0.35);
  rotate: -3deg;
  scale: 1.06;
  cursor: grabbing;
}

.is-drag-source {
  opacity: 0.3;
}

.is-dragging {
  cursor: grabbing;
}

/* Consigne en surcouche : aucun décalage de mise en page pendant le glisser */
.unassigned-panel,
.parents-panel {
  position: relative;
}

.unassigned-panel.drop-available::after,
.parents-panel.drop-available::after {
  content: "⬇ Déposer ici pour retirer du véhicule";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: inherit;
  background: rgba(243, 249, 244, 0.92);
  color: var(--color-primary);
  font-weight: 700;
  text-align: center;
}

.chip-free.drop-available {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.06);
  animation: drop-pulse 1.2s ease-in-out infinite;
}

.vehicle-card.drop-available,
.unassigned-panel.drop-available,
.parents-panel.drop-available {
  outline: 2px dashed rgba(var(--color-primary-rgb), 0.45);
  outline-offset: 2px;
}

.chip-free.drop-target {
  animation: none;
  border-style: solid;
  background: rgba(var(--color-primary-rgb), 0.16);
  transform: scale(1.05);
}

.chip-free.drop-target::before {
  content: "⬇";
}

.vehicle-card.drop-target,
.unassigned-panel.drop-target,
.parents-panel.drop-target {
  outline: 3px solid var(--color-primary);
  background: var(--color-primary-softer);
}

@keyframes drop-pulse {
  50% { background: rgba(var(--color-primary-rgb), 0.14); }
}

/* Joueuse arrivée à un nouvel emplacement (action locale ou autre parent) */
.chip-enter {
  animation: chip-pop 0.35s ease-out;
}

@keyframes chip-pop {
  from { opacity: 0; transform: scale(0.85); }
  60% { transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

dialog[open] {
  animation: dialog-in 0.18s ease-out;
}

dialog[open]::backdrop {
  animation: fade-in 0.18s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  *::backdrop {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Page match : deux colonnes sur tablette / ordinateur (maquette écran 9) --- */

@media (min-width: 900px) {
  .page-wide {
    max-width: 1100px;
  }

  .match-layout {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    grid-template-rows: auto auto auto auto auto auto 1fr;
    grid-template-areas:
      "detail     vehicles"
      "title      vehicles"
      "summary    vehicles"
      "roster     vehicles"
      "unassigned vehicles"
      "parents    vehicles"
      ".          vehicles";
    column-gap: 24px;
    align-items: start;
  }

  .match-layout > .match-detail { grid-area: detail; }
  .match-layout > .transport-title { grid-area: title; }
  .match-layout > .transport-summary { grid-area: summary; }
  .match-layout > .roster-panel { grid-area: roster; }
  .match-layout > .unassigned-panel { grid-area: unassigned; }
  .match-layout > .parents-panel { grid-area: parents; }
  .match-layout > .vehicles-block { grid-area: vehicles; }

  .vehicles-block > .subsection-title {
    margin-top: 8px;
  }

  .vehicle-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* --- Historique (SFD §17, maquette écran 8) --- */

.author-line {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--color-muted);
}

.link-button {
  padding: 0 2px;
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 8px 16px;
}

.history-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
}

.history-item + .history-item {
  border-top: 1px solid var(--color-border);
}

.history-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: var(--color-bg);
}

.history-body {
  min-width: 0;
}

.history-description {
  margin: 0 0 4px;
  font-size: 15px;
}

.history-meta {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.history-meta a {
  color: var(--color-primary);
}

/* --- Paramètres / administration --- */

.settings-card {
  margin-bottom: 14px;
}

.settings-title {
  font-size: 16px;
  margin: 0 0 8px;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.settings-form {
  margin-top: 8px;
}

.settings-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.settings-inline select,
.settings-inline input[type="date"] {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  font-size: 16px;
}

.settings-inline .field {
  margin-bottom: 0;
}

.admin-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--color-primary-soft);
}

.admin-banner p {
  margin: 0;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.danger-zone {
  border: 2px solid var(--color-danger);
}

.danger-zone .settings-title {
  color: var(--color-danger);
}

.admin-stats {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.admin-stats li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: 14px;
}

.activity-reset {
  margin-bottom: 10px;
}

.blocked-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.blocked-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
}

.blocked-item + .blocked-item {
  border-top: 1px solid var(--color-border);
}

.diagnostic-detail {
  word-break: break-word;
}

/* --- Toast (retour utilisateur, SFD §18) --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-card);
  z-index: 50;
  animation: toast-in 0.2s ease;
}

.toast-info {
  background: var(--color-primary);
}

.toast-warning {
  background: #92400e;
}

.toast-error {
  background: #b91c1c;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Responsive (tablette / desktop) --- */

@media (min-width: 768px) {
  .page-content {
    padding-bottom: 40px;
  }

  .bottom-nav {
    max-width: 640px;
    margin: 0 auto;
    left: 0;
    right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* --- Pages légales (mentions, confidentialité) --- */

.legal-section {
  margin-bottom: 16px;
  line-height: 1.5;
}

.legal-section h2 {
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--color-primary);
}

.legal-section p,
.legal-section ul {
  margin: 0 0 8px;
}

.legal-section ul {
  padding-left: 20px;
}

.legal-section a,
.legal-footer-link a,
.auth-legal a {
  color: var(--color-primary);
}

.legal-missing {
  color: var(--color-danger, #c0392b);
}

.legal-footer-link {
  text-align: center;
  font-size: 14px;
}

.auth-legal {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--color-muted);
}
