/* ==========================================================================
   JJ Location Bateaux : dashboard de l'équipe
   1. Variables   2. Base   3. Connexion   4. Structure (menu, barre)
   5. Boutons et champs     6. Panneaux, indicateurs, tableaux
   7. Planning    8. Fenêtres latérales (création, fiche)
   9. Administration        10. Responsive
   ========================================================================== */

/* 1. Variables ------------------------------------------------------------ */
:root {
  --sea-950: #062f38;
  --sea-900: #073f4a;
  --sea-800: #0b4f58;
  --sea-700: #0e5f6c;
  --sea-600: #237f8f;
  --sea-500: #2ba3a0;
  --sea-100: #e3f4f2;
  --sea-50: #f3f6f6;
  --accent: #2cc5b5;
  --sun-500: #e8a317;
  --ink: #0b1f24;
  --ink-2: #3c4d50;
  --muted: #5b6b6e;
  --line: #e3e8e8;
  --line-strong: #dce3e3;
  --line-soft: #edf1f1;
  --surface: #ffffff;
  --soft: #f7f9f9;
  --bg: #f3f6f6;
  --success: #0b4f58;
  --success-bg: #e3f4f2;
  --warning: #7a4b00;
  --warning-bg: #fff1d6;
  --danger: #8a2a1c;
  --danger-bg: #fde7e4;
  --info: #0e3f73;
  --info-bg: #dcebfa;
  --neutral-bg: #eef1f1;
  /* Rôles de couleur : mêmes valeurs qu'avant en clair, redéfinis par le thème sombre (section 13). */
  --link: var(--sea-700);
  --primary: var(--sea-900);
  --primary-hover: var(--sea-800);
  --primary-ink: var(--sea-900);
  --accent-ink: var(--sea-800);
  --accent-line: #bfe5df;
  --warning-line: #f2d59b;
  --danger-line: #f5c9c2;
  --danger-solid: #8a2a1c;
  --line-dashed: #bfcbcb;
  --stripe: #ebf0f0;
  --topbar-bg: rgb(243 246 246 / 92%);
  --alert-bg: #ffe9df;
  --alert-ink: #8a3510;
  --return-bg: #fffaf2;
  --overdue-bg: #fff6f5;
  --available-ink: #23845a;
  --partial-ink: #b06200;
  --radius-sm: 12px;
  --radius: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgb(6 47 56 / 5%);
  --shadow: 0 1px 2px rgb(6 47 56 / 5%), 0 18px 40px -24px rgb(6 47 56 / 35%);
  --sidebar-w: 264px;
  --topbar-h: 88px;
  --font: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
}

/* 2. Base ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.1rem;
}

h3 {
  font-size: 1rem;
}

h4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.9rem;
}

p {
  margin: 0 0 0.75rem;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

strong {
  color: var(--ink);
  font-weight: 600;
}

small {
  font-size: 0.8rem;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 0.25rem;
  color: var(--muted);
  vertical-align: -2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dashboard-kicker {
  margin: 0 0 0.25rem;
  color: var(--sea-600);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-help {
  max-width: 70ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* 3. Connexion ---------------------------------------------------------------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 48px 24px;
}

.auth__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  color: var(--ink);
  text-decoration: none;
}

.auth__brand img {
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.auth__brand span {
  display: grid;
  line-height: 1.2;
}

.auth__brand small {
  color: var(--muted);
}

.auth h1 {
  margin-bottom: 0.5rem;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.auth__intro {
  color: var(--muted);
}

.auth__form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.auth__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.auth__back:hover {
  color: var(--ink);
}

/* Bouton d'installation de l'app de gestion, toujours disponible (en plus du bandeau, qui peut avoir été fermé). */
.auth__install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line-strong, #dce3e3);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.auth__install:hover {
  background: var(--soft, #f3f6f6);
}

a.auth__install {
  text-decoration: none;
}

.auth__install[hidden],
.sidebar__link[hidden] {
  display: none;
}

.auth__visual {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--sea-900);
}

.auth__visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgb(6 38 46 / 45%));
}

/* 4. Structure ------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 18px 14px;
  background: var(--sea-950);
  color: rgb(255 255 255 / 75%);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 6px 18px;
  color: #fff;
  text-decoration: none;
}

.sidebar__brand img {
  border-radius: 50%;
  background: #fff;
}

.sidebar__brand span {
  display: grid;
  line-height: 1.2;
}

.sidebar__brand strong {
  color: #fff;
}

.sidebar__brand small {
  color: rgb(255 255 255 / 55%);
  font-size: 0.75rem;
}

.dashboard-tabs {
  display: grid;
  gap: 2px;
}

.sidebar__group {
  margin: 16px 10px 6px;
  color: rgb(255 255 255 / 45%);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-tab {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgb(255 255 255 / 78%);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.dashboard-tab .icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.dashboard-tab:hover {
  background: rgb(255 255 255 / 7%);
  color: #fff;
}

.dashboard-tab.is-active {
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--sun-500);
}

.dashboard-tab__count {
  min-width: 22px;
  margin-left: auto;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--sun-500);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.sidebar__footer {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.6rem 0.75rem;
}

.sidebar__avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sea-600);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-user {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.dashboard-user strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-user small {
  color: rgb(255 255 255 / 55%);
  font-size: 0.75rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgb(255 255 255 / 70%);
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.sidebar__link:hover {
  background: rgb(255 255 255 / 7%);
  color: #fff;
}

.sidebar-backdrop {
  display: none;
}

.app__main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(10px);
}

.topbar__menu {
  display: none;
}

.topbar__title {
  min-width: 0;
}

.topbar h1 {
  font-size: 1.35rem;
}

#dashboard-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.topbar__actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.app__content {
  max-width: 1440px;
  padding: 24px 28px 48px;
}

.dashboard-tab-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

/* 5. Boutons et champs -------------------------------------------------------------- */
.dashboard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.dashboard-button--primary {
  background: var(--sea-600);
  color: #fff;
}

.dashboard-button--primary:hover {
  background: var(--sea-800);
}

.dashboard-button--ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.dashboard-button--ghost:hover {
  border-color: var(--sea-600);
  color: var(--sea-800);
}

.dashboard-button--danger {
  border-color: #f3c3bd;
  background: var(--surface);
  color: var(--danger);
}

.dashboard-button--danger:hover {
  background: var(--danger-bg);
}

.dashboard-button--sm {
  min-height: 32px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.dashboard-button--icon {
  width: 40px;
  padding: 0;
}

.dashboard-button--block {
  width: 100%;
  min-height: 46px;
}

.dashboard-button:disabled {
  border-color: var(--line);
  background: var(--neutral-bg);
  color: var(--muted);
  cursor: not-allowed;
}

.dashboard-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-link:hover {
  text-decoration: underline;
}

.dashboard-link--danger {
  color: var(--danger);
}

.dashboard-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.dashboard-field--full {
  grid-column: 1 / -1;
}

.dashboard-field input,
.dashboard-field select,
.dashboard-field textarea,
.admin-table input:not([type="checkbox"]),
.admin-table select,
.date-nav input {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 400;
}

.dashboard-field select,
.admin-table select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2361747a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.6rem center;
  background-repeat: no-repeat;
  background-size: 16px;
}

.dashboard-field textarea {
  min-height: 72px;
  resize: vertical;
}

.dashboard-field input:focus,
.dashboard-field select:focus,
.dashboard-field textarea:focus,
.admin-table input:focus,
.admin-table select:focus,
.date-nav input:focus {
  outline: none;
  border-color: var(--sea-600);
  box-shadow: 0 0 0 3px rgb(17 114 127 / 15%);
}

.dashboard-field input:disabled,
.dashboard-field select:disabled,
.admin-table select:disabled,
.dashboard-field input[readonly] {
  background: var(--neutral-bg);
  color: var(--muted);
}

.dashboard-field--search input {
  padding-left: 2.25rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2361747a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") 0.7rem center / 16px no-repeat;
}

.dashboard-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--sea-600);
}

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
}

.dashboard-filters .dashboard-field--search {
  flex: 1 1 280px;
}

.dashboard-panel__header > .dashboard-filters:last-child {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.dashboard-feedback {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.dashboard-feedback:empty {
  display: none;
}

.dashboard-feedback.is-success { color: var(--success); }
.dashboard-feedback.is-error { color: var(--danger); }
.dashboard-feedback.is-pending { color: var(--warning); }

.dashboard-alert {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--neutral-bg);
  color: var(--ink-2);
  font-size: 0.875rem;
}

.dashboard-alert.is-success { background: var(--success-bg); color: var(--success); }
.dashboard-alert.is-error { background: var(--danger-bg); color: var(--danger); }
.dashboard-alert.is-pending { background: var(--warning-bg); color: var(--warning); }

.dashboard-alert ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.dashboard-empty {
  margin: 0;
  padding: 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.dashboard-empty--success {
  border-color: #b8dfc9;
  background: var(--success-bg);
  color: var(--success);
}

/* 6. Panneaux, indicateurs, tableaux -------------------------------------------------- */
.dashboard-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.dashboard-panel__header > div:first-child {
  display: grid;
  gap: 0.25rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px;
}

[data-stats-body] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.dashboard-stat {
  display: grid;
  gap: 0.15rem;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-stats--inside .dashboard-stat {
  background: var(--bg);
  box-shadow: none;
}

.dashboard-stat span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.dashboard-stat strong {
  color: var(--ink);
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.dashboard-stat small {
  color: var(--muted);
}

.dashboard-stat--accent {
  border-color: #f6d7ad;
  background: linear-gradient(180deg, #fff8ee, var(--surface));
}

/* position: relative garde les libellés masqués (position absolue) dans la zone qui défile. */
.booking-table-wrap,
.planning-table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.booking-table,
.finance-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.booking-table th,
.booking-table td,
.finance-table th,
.finance-table td,
.admin-table th,
.admin-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.booking-table thead th,
.finance-table thead th,
.admin-table thead th {
  background: #f8fafa;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.booking-table tbody tr:last-child > *,
.finance-table tbody tr:last-child > *,
.admin-table tbody tr:last-child > * {
  border-bottom: 0;
}

.booking-table td strong,
.finance-table th strong,
.admin-table td strong {
  display: block;
}

.booking-table td small,
.finance-table th small,
.admin-table td small {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-weight: 400;
}

.admin-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

.booking-row {
  cursor: pointer;
  transition: background-color 0.12s;
}

.booking-row:hover {
  background: var(--sea-50);
}

.is-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.is-action {
  width: 1%;
  text-align: right !important;
  white-space: nowrap;
}

small.is-due {
  color: var(--warning) !important;
  font-weight: 600;
}

.finance-table tr.is-muted {
  color: var(--muted);
}

.booking-table-empty {
  padding: 2rem !important;
  color: var(--muted);
  text-align: center !important;
}

.badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.validation-badge,
.booking-status,
.money-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.validation-badge::before,
.booking-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.validation-badge.is-validated,
.validation-badge.is-reserved,
.booking-status.is-reserved {
  background: var(--success-bg);
  color: var(--success);
}

.validation-badge.is-pending,
.money-badge {
  background: var(--warning-bg);
  color: var(--warning);
}

.validation-badge.is-rejected,
.validation-badge.is-cancelled,
.booking-status.is-cancelled {
  background: var(--danger-bg);
  color: var(--danger);
}

.validation-badge.is-completed,
.booking-status.is-completed {
  background: var(--neutral-bg);
  color: var(--muted);
}

/* 7. Planning ------------------------------------------------------------------------ */
.date-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.date-nav input {
  width: auto;
}

.planning-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.planning-table th,
.planning-table td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.planning-table tbody tr:last-child > * {
  border-bottom: 0;
}

.planning-table thead th {
  padding: 10px 8px;
  background: #f8fafa;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  text-align: left;
}

.planning-table thead th:first-child {
  width: 150px;
}

.planning-table thead small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.planning-table tbody th {
  padding-left: 14px;
  text-align: left;
}

.planning-table tbody th strong {
  display: block;
  font-size: 0.9rem;
}

.planning-table tbody th small {
  color: var(--muted);
  font-weight: 500;
}

.planning-table td.is-na {
  color: var(--line-strong);
  text-align: center;
}

.slot-pill {
  display: grid;
  align-content: center;
  gap: 0.05rem;
  width: 100%;
  min-height: 52px;
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: left;
}

button.slot-pill {
  cursor: pointer;
}

.slot-pill strong,
.slot-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-pill.is-free {
  border: 1px dashed #b9dcc8;
  background: #f4fbf7;
  color: var(--success);
  font-weight: 600;
}

.slot-pill.is-free em {
  display: none;
  font-style: normal;
}

.slot-pill.is-free:hover {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-bg);
}

.slot-pill.is-free:hover span {
  display: none;
}

.slot-pill.is-free:hover em {
  display: inline;
}

.slot-pill.is-booked {
  border-color: #f2d3a8;
  background: var(--warning-bg);
  color: #6b4100;
}

.slot-pill.is-booked strong {
  color: var(--ink);
}

.slot-pill.is-booked.is-validated {
  border-color: #b9d9de;
  background: var(--sea-50);
  color: var(--sea-800);
}

.slot-pill.is-booked:hover {
  box-shadow: var(--shadow);
}

.slot-pill.is-blocked {
  background: var(--neutral-bg);
  color: var(--muted);
}

.slot-pill.is-closed {
  background: repeating-linear-gradient(135deg, #fdeceb, #fdeceb 6px, #fbe2df 6px, #fbe2df 12px);
  color: var(--danger);
}

.slot-pill.is-past {
  color: var(--line-strong);
}

.day-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-list__item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

.day-list__item:last-child {
  border-bottom: 0;
}

.day-list__time,
.day-list__main {
  display: grid;
  min-width: 0;
}

.day-list__time span,
.day-list__main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-list__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.day-list__phone .icon {
  width: 15px;
  height: 15px;
}

.day-list__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

/* 8. Fenêtres latérales ---------------------------------------------------------------- */
.drawer {
  width: min(100vw, 620px);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: -24px 0 60px -20px rgb(6 38 46 / 35%);
  overflow: hidden;
}

.drawer--wide {
  width: min(100vw, 860px);
}

.drawer[open] {
  animation: drawer-in 0.22s ease-out;
}

.drawer::backdrop {
  background: rgb(6 38 46 / 45%);
  backdrop-filter: blur(2px);
}

@keyframes drawer-in {
  from {
    opacity: 0.6;
    transform: translateX(32px);
  }
}

.drawer__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer__header h2 {
  font-size: 1.25rem;
}

.drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 28px;
}

.team-booking-form {
  display: grid;
  align-content: start;
  gap: 20px;
  padding-bottom: 0;
}

.drawer__footer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 0.6rem;
  margin: 0 -24px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.form-section {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-section > legend {
  float: left;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-section > legend + * {
  clear: both;
}

.form-section > * + * {
  margin-top: 0.75rem;
}

.form-section > legend + * {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-date-board {
  display: grid;
  gap: 0.6rem;
}

.team-date-board__empty {
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.team-date-board__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.team-date-board__header > div:first-child {
  display: grid;
}

.team-date-board__header span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.team-date-board__legend {
  display: flex;
  gap: 0.75rem;
}

.team-date-board__legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.team-date-board__legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.team-date-board__legend .is-available { background: #2f9e67; }
.team-date-board__legend .is-partial { background: var(--sun-500); }
.team-date-board__legend .is-unavailable { background: var(--line-strong); }

.team-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}

.team-date-tile {
  display: grid;
  justify-items: center;
  padding: 0.4rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  line-height: 1.2;
  cursor: pointer;
}

.team-date-tile span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: capitalize;
}

.team-date-tile strong {
  font-size: 0.8rem;
}

.team-date-tile small {
  font-size: 0.68rem;
  font-weight: 600;
}

.team-date-tile.is-available small { color: var(--available-ink); }
.team-date-tile.is-partial small { color: var(--partial-ink); }

.team-date-tile:hover:not(:disabled) {
  border-color: var(--sea-500);
}

.team-date-tile:disabled {
  background: var(--bg);
  cursor: not-allowed;
  opacity: 0.5;
}

.team-date-tile.is-selected {
  border-color: var(--sea-600);
  background: var(--sea-600);
}

.team-date-tile.is-selected span,
.team-date-tile.is-selected strong,
.team-date-tile.is-selected small {
  color: #fff;
}

.booking-options__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.booking-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.55rem 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.booking-option > span {
  display: grid;
}

.booking-option small {
  color: var(--muted);
  font-size: 0.72rem;
}

.booking-option input {
  width: 58px;
  min-height: 36px;
  padding: 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}

.booking-option.is-disabled {
  background: var(--bg);
  opacity: 0.55;
}

.booking-options__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Fiche de réservation */
.sheet-summary {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 20px;
}

.sheet-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sheet-facts > div {
  padding: 0.75rem 0.9rem;
}

.sheet-facts > div + div {
  border-left: 1px solid var(--line);
}

.sheet-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sheet-facts dd {
  display: grid;
  margin: 0.15rem 0 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
}

.sheet-facts dd small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sheet-block {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sheet-block--wide {
  grid-column: 1 / -1;
}

.sheet-block > h3 {
  margin-bottom: 0.75rem;
}

.sheet-list {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.45rem 0.75rem;
  margin: 0;
  font-size: 0.875rem;
}

.sheet-list dt {
  color: var(--muted);
}

.sheet-list dd {
  display: grid;
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sheet-list dd small {
  color: var(--muted);
}

.sheet-message {
  white-space: pre-line;
}

.sheet-validation {
  background: linear-gradient(180deg, var(--sea-50), var(--surface) 70%);
}

.sheet-checks {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.sheet-checks li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 500;
}

.sheet-checks li::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--neutral-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2361747a' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.sheet-checks li.is-ok::before {
  background: var(--success-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317683f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.sheet-checks li.is-ko::before {
  background: var(--warning-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a5300' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.sheet-doc-groups {
  display: grid;
  gap: 0.75rem;
}

.sheet-doc-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sheet-docs {
  display: grid;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.sheet-doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.sheet-doc__name {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sheet-doc__name small {
  color: var(--muted);
}

.sheet-doc__actions {
  display: flex;
  gap: 0.75rem;
}

.sheet-fold {
  padding: 0;
}

.sheet-fold > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
}

.sheet-fold > summary::-webkit-details-marker {
  display: none;
}

.sheet-fold > summary span {
  color: var(--muted);
  font-size: 0.8rem;
}

.sheet-fold > summary::after {
  content: "";
  width: 18px;
  height: 18px;
  margin-left: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2361747a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 18px no-repeat;
  transition: transform 0.2s;
}

.sheet-fold[open] > summary::after {
  transform: rotate(180deg);
}

.sheet-fold > summary:hover {
  background: var(--bg);
}

.sheet-fold > :not(summary) {
  padding: 4px 18px 18px;
}

.sheet-form {
  display: grid;
  gap: 18px;
}

.sheet-form .form-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sheet-form .form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.sheet-history {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.sheet-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--line);
}

.sheet-history li:last-child {
  border-bottom: 0;
}

.sheet-history li strong {
  font-weight: 600;
}

.sheet-history li span {
  color: var(--ink-2);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  background: var(--sea-950);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

.toast.is-error {
  background: var(--danger-solid);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* 9. Administration ---------------------------------------------------------------------- */
.admin-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-card--highlight {
  border-color: var(--sea-100);
  background: linear-gradient(180deg, var(--sea-50), var(--surface) 60%);
}

.admin-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 0.85rem;
  align-items: end;
}

.admin-form > h3 {
  margin-bottom: 0.25rem;
}

.admin-form .dashboard-check {
  min-height: 40px;
}

.admin-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.admin-fieldset {
  margin: 0.25rem 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-fieldset legend {
  padding: 0 0.35rem;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-fieldset .dashboard-check {
  display: inline-flex;
  margin: 0.25rem 1.25rem 0.25rem 0;
}

.admin-boats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}

.admin-boat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-boat:hover {
  border-color: var(--sea-100);
  box-shadow: var(--shadow-sm);
}

.admin-boat h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.05rem;
}

.admin-boat.is-inactive {
  background: var(--bg);
}

.admin-boat__model {
  margin: 0.1rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-boat__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.admin-boat__facts li {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--sea-50);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.admin-boat__count {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-warnings {
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.75rem 0.5rem 1.6rem;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 0.8rem;
}

.admin-table--inputs td,
.admin-table--rates td {
  padding: 0.45rem 0.5rem;
}

.admin-table--inputs td:first-child input,
.admin-table--inputs td:nth-child(7) input {
  min-width: 170px;
}

.admin-table--inputs input:not([type="checkbox"]),
.admin-table--rates input:not([type="checkbox"]) {
  min-width: 80px;
  min-height: 36px;
  font-size: 0.85rem;
}

.month-picker {
  display: flex;
  gap: 2px;
}

.month-picker label {
  position: relative;
  cursor: pointer;
}

.month-picker input {
  position: absolute;
  opacity: 0;
}

.month-picker span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.month-picker input:checked + span {
  border-color: var(--sea-600);
  background: var(--sea-600);
  color: #fff;
}

.month-picker input:focus-visible + span {
  outline: 2px solid var(--sun-500);
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.occupancy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.occupancy__bar {
  width: 90px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-bg);
}

.occupancy__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sea-500);
}

/* 10. Responsive -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-list__item {
    grid-template-columns: 110px minmax(0, 1fr) auto;
  }

  .day-list__phone {
    grid-column: 2;
  }

  .day-list__badges {
    grid-column: 3;
    grid-row: 1;
  }

  .day-list__item > .booking-sheet-open {
    grid-column: 3;
  }

  .admin-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(84vw, 300px);
    transform: translateX(-100%);
    transition: transform 0.22s ease-out;
  }

  .sidebar.is-open {
    transform: none;
    box-shadow: 24px 0 60px -20px rgb(0 0 0 / 45%);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    background: rgb(6 38 46 / 45%);
  }

  .topbar__menu {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
  }

  .auth {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth__visual {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14.5px;
  }

  .topbar {
    padding: 10px 16px;
  }

  .topbar h1 {
    font-size: 1.15rem;
  }

  #dashboard-meta {
    display: none;
  }

  .topbar__actions .dashboard-button--primary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .topbar__actions .dashboard-button--primary {
    width: 40px;
    padding: 0;
  }

  .app__content {
    padding: 16px 12px 40px;
  }

  .dashboard-panel {
    padding: 14px;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-stat {
    padding: 12px 14px;
  }

  .dashboard-stat strong {
    font-size: 1.35rem;
  }

  .date-nav {
    flex-wrap: wrap;
    width: 100%;
  }

  .date-nav input {
    flex: 1;
  }

  .day-list__item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem 0.75rem;
  }

  .day-list__time {
    grid-column: 1;
  }

  .day-list__main,
  .day-list__phone {
    grid-column: 1;
  }

  .day-list__badges {
    grid-column: 2;
    grid-row: 1 / span 2;
    flex-direction: column;
    align-items: flex-end;
  }

  .day-list__item > .booking-sheet-open {
    grid-column: 2;
    grid-row: 3;
  }

  /* Tableaux en cartes sur téléphone */
  .booking-table thead,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) thead {
    display: none;
  }

  .booking-table,
  .booking-table tbody,
  .booking-table tr,
  .booking-table td,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates),
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) tbody,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) tr,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) td,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) tbody th {
    display: block;
    width: 100%;
  }

  .booking-table tr,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) tr {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line);
  }

  .booking-table td,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) td,
  .admin-table:not(.admin-table--inputs):not(.admin-table--rates) tbody th {
    padding: 0.15rem 0;
    border: 0;
    text-align: left !important;
  }

  .booking-table .is-action,
  .admin-table .is-action {
    width: auto;
    padding-top: 0.5rem;
  }

  .booking-table-wrap {
    border-radius: var(--radius);
  }

  .form-grid,
  .form-grid--3,
  .booking-options__list,
  .sheet-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sheet-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-facts > div:nth-child(3) {
    border-left: 0;
  }

  .sheet-facts > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .sheet-doc {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sheet-doc__actions {
    grid-column: 1 / -1;
  }

  .drawer__header,
  .drawer__body {
    padding-inline: 16px;
  }

  .drawer__footer {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* 11. En mer et zones -------------------------------------------------------------------- */
.dashboard-tab__count--alert {
  background: #ff6b5e;
  color: #fff;
}

.sea-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sea-map {
  /* Couche propre : les calques de Leaflet (z-index 400 à 1000) ne passent plus devant la barre du haut. */
  position: relative;
  z-index: 0;
  isolation: isolate;
  min-height: 520px;
  height: 62vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #aad3df;
}

.sea-list,
.zones-side {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
}

.sea-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.85rem;
}

.sea-item.is-at_sea { border-left-color: #2f9e67; }
.sea-item.is-return { border-left-color: var(--sun-500); background: var(--return-bg); }
.sea-item.is-overdue { border-left-color: var(--danger); background: var(--overdue-bg); }

.sea-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.sea-item p {
  margin: 0 0 0.2rem;
}

.sea-item__time {
  color: var(--ink);
  font-weight: 600;
}

.sea-item__where {
  color: var(--muted);
}

.sea-item__actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.4rem;
}

.zone-form {
  display: grid;
  gap: 0.75rem;
}

.zones-list {
  display: grid;
  gap: 6px;
}

.zone-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.zone-row:hover,
.zone-row.is-active {
  border-color: var(--sea-600);
  background: var(--sea-50);
}

.zone-row span {
  display: grid;
  min-width: 0;
}

.zone-row small {
  color: var(--muted);
}

.zone-swatch {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid;
  border-radius: 4px;
}

.zone-swatch.is-allowed { border-color: #11727f; background: rgb(26 140 153 / 25%); }
.zone-swatch.is-caution { border-color: #e98a1f; border-style: dashed; background: rgb(245 161 66 / 30%); }
.zone-swatch.is-forbidden { border-color: #b42318; background: rgb(217 45 32 / 35%); }

.zone-vertex {
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--sea-700);
  box-shadow: 0 1px 4px rgb(0 0 0 / 40%);
  cursor: move;
}

.map-port span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--sea-700);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
}

.map-fleet span {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #17683f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
  transform: translate(-50%, -50%);
}

.map-fleet.is-return span { background: #c26a00; }
.map-fleet.is-overdue span { background: var(--danger-solid); }

.leaflet-container {
  font-family: inherit;
}

@media (max-width: 1100px) {
  .sea-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sea-map {
    min-height: 360px;
    height: 50vh;
  }

  .sea-list,
  .zones-side {
    max-height: none;
  }
}

/* 12. Nouveau design (maquette 2026) ------------------------------------------------------ */
h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 em,
h2 em,
.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  justify-self: start;
  margin: 0 0 0.6rem;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: var(--sea-100);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Connexion : visuel arrondi à gauche, formulaire à droite. */
.auth {
  gap: 12px;
  padding: 12px;
  background: var(--surface);
}

.auth__card {
  order: 2;
  width: min(100%, 420px);
  padding: clamp(24px, 4vw, 56px) 8px;
}

.auth__brand {
  display: none;
}

.auth h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(30px, 2.8vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.auth__intro {
  font-size: 15.5px;
}

.auth__form {
  gap: 14px;
}

.auth .dashboard-field {
  font-size: 14px;
}

.auth .dashboard-field input {
  min-height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 16px;
}

.auth .dashboard-button--block {
  min-height: 54px;
  border-radius: 14px;
  font-size: 16px;
}

.auth__back {
  align-self: center;
  min-height: 44px;
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
}

.auth__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  order: 1;
  min-height: 240px;
  padding: clamp(24px, 3.4vw, 48px);
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #d6ecee 0%, #a8d5db 34%, #6db5c0 50%, #1f7584 62%, #0b4f5b 80%, #062f38 100%);
  color: #fff;
}

/* La photo de fond seulement : le logo de la pastille ne doit pas être étiré. */
.auth__visual > img {
  position: absolute;
  inset: 0;
}

.auth__visual::after {
  background: linear-gradient(180deg, rgb(4 38 45 / 15%) 0%, rgb(4 38 45 / 0%) 30%, rgb(4 38 45 / 55%) 70%, rgb(4 38 45 / 85%) 100%);
}

.auth__visual > :not(img) {
  position: relative;
  z-index: 1;
}

.auth__pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  /* Posée sur la photo : reste claire quel que soit le thème. */
  background: rgb(255 255 255 / 85%);
  color: #0b1f24;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.auth__pill img {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.auth__tagline {
  display: grid;
  gap: 12px;
  max-width: 26em;
}

.auth__tagline strong {
  color: #fff;
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.auth__tagline strong .serif {
  color: #fff;
}

/* Menu latéral clair */
.sidebar {
  gap: 18px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.sidebar__brand {
  gap: 12px;
  margin: 0;
  padding: 4px 6px;
  color: var(--ink);
}

.sidebar__brand strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sidebar__brand small {
  color: var(--muted);
  font-size: 12.5px;
}

.sidebar__new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.sidebar__new:hover {
  background: var(--primary-hover);
}

.dashboard-tabs {
  gap: 4px;
}

.sidebar__group {
  margin: 12px 12px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dashboard-tab {
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.dashboard-tab .icon {
  width: 20px;
  height: 20px;
  opacity: 1;
  stroke-width: 1.8;
}

.dashboard-tab:hover {
  background: var(--sea-50);
  color: var(--ink);
}

.dashboard-tab.is-active {
  background: var(--sea-100);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: none;
}

.dashboard-tab__count {
  padding: 1px 8px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 12.5px;
  font-weight: 600;
}

.dashboard-tab__count--alert {
  background: var(--alert-bg);
  color: var(--alert-ink);
}

.sidebar__footer {
  gap: 8px;
  padding-top: 0;
  border-top: 0;
}

.sidebar__user {
  order: 2;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--bg);
}

.sidebar__avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(160deg, #cdebee 0%, #237f8f 100%);
}

.dashboard-user strong {
  color: var(--ink);
  font-size: 14px;
}

.dashboard-user small {
  color: var(--muted);
  font-size: 12.5px;
}

.sidebar__link {
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
}

.sidebar__link:hover {
  background: var(--sea-50);
  color: var(--ink);
}

#logout-dashboard {
  order: 3;
}

/* Barre du haut et contenu */
.topbar {
  padding: 16px clamp(16px, 2.2vw, 28px) 8px;
  border-bottom: 0;
  background: var(--topbar-bg);
}

.topbar h1 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

#dashboard-meta {
  font-size: 14.5px;
}

.app__content {
  padding: 12px clamp(16px, 2.2vw, 28px) 48px;
}

.dashboard-tab-panel {
  gap: 20px;
}

/* Le bouton du menu latéral suffit sur grand écran. */
@media (min-width: 1024px) {
  #open-team-booking {
    display: none;
  }
}

.dashboard-button {
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 15px;
}

.dashboard-button--primary {
  background: var(--primary);
}

.dashboard-button--primary:hover {
  background: var(--primary-hover);
}

.dashboard-button--ghost {
  border-color: var(--line-strong);
}

.dashboard-button--ghost:hover {
  border-color: var(--primary-ink);
  color: var(--primary-ink);
}

.dashboard-button--danger {
  border-color: var(--danger-line);
}

.dashboard-button--sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
}

.dashboard-button--icon {
  width: 44px;
  padding: 0;
}

.dashboard-button--block {
  min-height: 52px;
  border-radius: 14px;
  font-size: 16px;
}

.dashboard-field {
  gap: 6px;
  font-size: 14px;
}

.dashboard-field input,
.dashboard-field select,
.dashboard-field textarea,
.admin-table input:not([type="checkbox"]),
.admin-table select,
.date-nav input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 15px;
}

.dashboard-field select,
.admin-table select {
  padding-right: 2.2rem;
}

.dashboard-field textarea {
  padding: 12px 14px;
}

.dashboard-field input:focus,
.dashboard-field select:focus,
.dashboard-field textarea:focus,
.admin-table input:focus,
.admin-table select:focus,
.date-nav input:focus {
  border-color: var(--sea-600);
  box-shadow: 0 0 0 4px rgb(44 197 181 / 22%);
}

.dashboard-field--search input {
  min-height: 48px;
  padding-left: 42px;
  border-radius: 14px;
  background-position: 14px center;
  background-size: 18px;
}

input[type="checkbox"] {
  accent-color: var(--primary);
}

.dashboard-alert {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14.5px;
}

.dashboard-empty {
  border-color: var(--line-dashed);
  border-radius: 18px;
}

/* Panneaux et indicateurs */
.dashboard-panel {
  gap: 16px;
  padding: 20px;
  border: 0;
  border-radius: 24px;
  box-shadow: none;
}

.dashboard-panel h2 {
  font-size: 18px;
}

.dashboard-help {
  color: var(--muted);
  font-size: 14px;
}

.dashboard-stats {
  gap: 12px;
}

.dashboard-stat {
  gap: 4px;
  padding: 18px 20px;
  border: 0;
  border-radius: 20px;
  box-shadow: none;
}

.dashboard-stats--inside .dashboard-stat {
  background: var(--soft);
}

.dashboard-stat > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

.stat-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--sea-100);
  color: var(--accent-ink);
}

.stat-icon .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.dashboard-stat strong {
  font-size: 32px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.dashboard-stat small {
  font-size: 13.5px;
}

.dashboard-stat--accent {
  border: 1.5px solid var(--warning-line);
  background: var(--surface);
}

.dashboard-stat--accent .stat-icon {
  background: var(--warning-bg);
  color: var(--warning);
}

.booking-table-wrap,
.planning-table-wrap {
  border: 0;
  border-radius: 18px;
}

.booking-table,
.finance-table,
.admin-table {
  font-size: 15px;
}

.booking-table th,
.booking-table td,
.finance-table th,
.finance-table td,
.admin-table th,
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.booking-table thead th,
.finance-table thead th,
.admin-table thead th {
  padding-block: 14px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.booking-table td small,
.finance-table th small,
.admin-table td small {
  font-size: 13px;
}

.booking-row:hover {
  background: var(--soft);
}

.validation-badge,
.booking-status,
.money-badge {
  gap: 6px;
  padding: 4px 10px;
  font-size: 13px;
}

.validation-badge::before,
.booking-status::before {
  width: 7px;
  height: 7px;
}

.validation-badge.is-validated::before,
.validation-badge.is-reserved::before,
.booking-status.is-reserved::before {
  background: #1fa597;
}

.validation-badge.is-pending::before {
  background: #e8a317;
}

.validation-badge.is-rejected::before,
.validation-badge.is-cancelled::before,
.booking-status.is-cancelled::before {
  background: #d9503b;
}

.validation-badge.is-completed::before,
.booking-status.is-completed::before {
  background: #8a9a9d;
}

/* Planning : cartes de réservation colorées, créneaux libres en pointillés. */
.date-nav {
  gap: 6px;
}

.date-nav input {
  font-weight: 600;
}

.planning-table {
  border-spacing: 0 8px;
}

.planning-table th,
.planning-table td {
  padding: 0 4px;
  border-bottom: 0;
}

.planning-table thead th {
  padding: 0 8px 4px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.planning-table thead th:first-child {
  width: 176px;
}

.planning-table tbody th {
  padding-left: 4px;
}

.planning-table tbody th strong {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
}

.planning-table tbody th small {
  font-size: 12.5px;
  font-weight: 400;
}

.slot-pill {
  gap: 1px;
  min-height: 66px;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 13px;
}

.slot-pill strong {
  font-size: 15px;
  font-weight: 600;
}

.slot-pill.is-free {
  justify-items: center;
  border: 1.5px dashed var(--line-dashed);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  text-align: center;
}

.slot-pill.is-free:hover {
  border-color: var(--primary-ink);
  background: var(--sea-100);
  color: var(--primary-ink);
}

.slot-pill.is-booked {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.slot-pill.is-booked.is-validated {
  border-color: var(--accent-line);
  background: var(--sea-100);
  color: var(--accent-ink);
}

.slot-pill.is-blocked,
.slot-pill.is-past {
  background: var(--bg);
  color: var(--muted);
}

.slot-pill.is-closed {
  background: repeating-linear-gradient(135deg, var(--bg) 0 8px, var(--stripe) 8px 16px);
  color: var(--muted);
}

.planning-table td.is-na {
  color: var(--muted);
}

.day-list__item {
  padding: 12px 0;
  border-bottom-color: var(--line-soft);
}

/* Fenêtres latérales */
.drawer {
  box-shadow: -24px 0 60px -20px rgb(6 47 56 / 35%);
}

.drawer::backdrop {
  background: rgb(6 31 36 / 40%);
}

.drawer__header {
  padding: 22px 24px 12px;
  border-bottom: 0;
}

.drawer__header h2 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.drawer__body {
  padding: 4px 24px 0;
}

.drawer__body > :last-child:not(.drawer__footer) {
  margin-bottom: 28px;
}

.form-section legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toast {
  border-radius: 14px;
  background: var(--primary);
}

.auth__tagline span {
  font-size: inherit;
}

.auth__tagline > span {
  color: rgb(255 255 255 / 88%);
  font-size: 16px;
}

.sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

@media (max-width: 720px) {
  .dashboard-stat strong {
    font-size: 26px;
  }
}

@media (max-width: 1023px) {
  .auth__visual {
    display: flex;
    min-height: 220px;
  }

  .auth__tagline > span {
    display: none;
  }

  .topbar {
    padding-top: 12px;
  }

  .topbar__menu {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
}

/* Suivi GPS de l'application Android (onglet En mer) */
.sea-item__tracking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sea-item__tracking::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a9a9d;
}

.sea-item__tracking.is-active {
  color: var(--accent-ink);
}

.sea-item__tracking.is-active::before {
  background: #1fa597;
  box-shadow: 0 0 0 3px rgb(31 165 151 / 20%);
}

/* 13. Photos et tarifs des navires -------------------------------------------------------- */
/* Fiche navire : photo en bandeau, puis texte et bouton côte à côte. */
.admin-boat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 1rem;
  align-items: start;
}

.admin-boat__photo {
  grid-column: 1 / -1;
  width: 100%;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--soft);
}

.admin-boat__body {
  min-width: 0;
}

/* Tarifs (ordinateur) : nom de période lisible en entier, mois sur toute la hauteur de la ligne. */
.admin-table--rates td:first-child {
  min-width: 170px;
}

.admin-table--rates td.rate-remove {
  width: 1%;
  white-space: nowrap;
}

.boat-photo__body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.boat-photo__preview {
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.boat-photo__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.boat-photo__preview.is-empty span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.boat-photo__side {
  display: grid;
  gap: 8px;
  align-content: start;
  font-weight: 400;
}

.boat-photo__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.boat-photo__pick {
  position: relative;
  cursor: pointer;
}

.boat-photo__pick:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.boat-photo__url summary {
  width: fit-content;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.boat-photo__url input {
  margin-top: 8px;
}

.admin-table--rates tr.is-invalid > td {
  background: var(--danger-bg);
}

.admin-table--rates tr.is-invalid > td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

@media (max-width: 720px) {
  .boat-photo__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-boat__photo {
    height: 130px;
  }

  /* Tarifs en cartes : une période par carte, mois en grosses cases faciles à toucher. */
  .admin-table--rates thead {
    display: none;
  }

  .admin-table--rates,
  .admin-table--rates tbody {
    display: block;
  }

  .admin-table--rates tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .admin-table--rates tr.is-invalid {
    background: var(--danger-bg);
    box-shadow: inset 3px 0 0 var(--danger);
  }

  .admin-table--rates tr.is-invalid > td,
  .admin-table--rates tr.is-invalid > td:first-child {
    background: none;
    box-shadow: none;
  }

  .admin-table--rates td {
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 0 !important;
    border: 0 !important;
  }

  .admin-table--rates td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
  }

  .admin-table--rates td:first-child,
  .admin-table--rates td:nth-child(2),
  .admin-table--rates td.rate-remove {
    grid-column: 1 / -1;
  }

  .admin-table--rates td:first-child {
    min-width: 0;
  }

  .admin-table--rates .month-picker {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  .admin-table--rates .month-picker span {
    width: 100%;
    height: 40px;
    font-size: 14px;
  }

  .admin-table--rates input:not([type="checkbox"]) {
    min-width: 0;
  }

  .admin-table--rates td.rate-remove {
    width: auto;
    justify-items: start;
  }
}

/* 14. Thème sombre ------------------------------------------------------------------------- */
/* Interrupteur du menu latéral (dashboard-theme.js). */
.theme-toggle__switch {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--muted);
  transition: background-color 0.15s;
}

.theme-toggle__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
  transition: transform 0.15s;
}

.theme-toggle[aria-checked="true"] .theme-toggle__switch {
  background: var(--sea-600);
}

.theme-toggle[aria-checked="true"] .theme-toggle__switch::after {
  transform: translateX(14px);
}

/* Le thème est posé sur <html> avant l'affichage : data-theme="dark". */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f0f1;
  --ink-2: #bccacc;
  --muted: #8fa1a4;
  --line: #23363b;
  --line-strong: #31474d;
  --line-soft: #1b2c30;
  --line-dashed: #3b5359;
  --surface: #122024;
  --soft: #17282d;
  --bg: #0b1518;
  --neutral-bg: #1c2e33;
  --stripe: #121f23;
  --sea-50: #153034;
  --sea-100: #133f40;
  --link: #7fd8cc;
  --primary: #1b7480;
  --primary-hover: #1f7f8c;
  --primary-ink: #8fe3d7;
  --accent-ink: #7fd8cc;
  --accent-line: #22585a;
  --success: #7fd8cc;
  --success-bg: #133f40;
  --warning: #f3c56b;
  --warning-bg: #3a2c12;
  --warning-line: #5e4818;
  --danger: #ff9b8c;
  --danger-bg: #3d1c19;
  --danger-line: #6a2c25;
  --danger-solid: #b8372a;
  --info: #9cc8f5;
  --info-bg: #13304d;
  --topbar-bg: rgb(11 21 24 / 92%);
  --alert-bg: #47201a;
  --alert-ink: #ffb49c;
  --return-bg: #241d10;
  --overdue-bg: #2a1614;
  --available-ink: #5fd39a;
  --partial-ink: #f0a845;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 18px 40px -24px rgb(0 0 0 / 70%);
}

/* ::backdrop n'hérite pas des variables dans tous les navigateurs : valeur directe. */
:root[data-theme="dark"] .drawer::backdrop {
  background: rgb(0 0 0 / 55%);
}

/* Icônes de la liste de vérification : trait éclairci pour rester lisible sur fond sombre. */
:root[data-theme="dark"] .sheet-checks li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fa1a4' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] .sheet-checks li.is-ok::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237fd8cc' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] .sheet-checks li.is-ko::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3c56b' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E");
}

/* Bulles de la carte : Leaflet les veut blanches, le texte du thème y serait illisible. */
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip {
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: 0 3px 14px rgb(0 0 0 / 50%);
}

:root[data-theme="dark"] .leaflet-popup-content a {
  color: var(--link);
}
