/* ==========================================================================
   SurfClean — design system (thème sombre)
   Mobile first · CSS natif · aucune dépendance
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0b1220;
  --bg-2: #111b2e;
  --surface: #162338;
  --surface-2: #1b2b44;
  --surface-3: #22344f;
  --border: #263449;
  --border-strong: #34476a;

  /* Texte */
  --text: #f8fafc;
  --text-2: #94a3b8;
  --text-3: #6b7c96;

  /* Marque */
  --primary: #14b8a6;
  --primary-hover: #2dd4bf;
  --primary-ink: #04201d;
  --primary-soft: rgba(20, 184, 166, 0.12);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);

  /* États (toujours accompagnés d'une icône ou d'un libellé) */
  --good: #22c55e;
  --warning: #fbb315;
  --serious: #f18a59;
  --critical: #ef5350;
  --critical-soft: rgba(239, 83, 80, 0.12);

  /* Rythme */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sidebar-w: 248px;
  --gutter: 16px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (min-width: 768px) {
  :root { --gutter: 28px; }
}

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
small { font-size: 0.8125rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(20, 184, 166, 0.35); }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--primary); color: var(--primary-ink); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--xs { width: 14px; height: 14px; }
.icon--lg { width: 24px; height: 24px; }

.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

/* --- Logo ---------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; font-size: 1.0625rem; }
.brand:hover { color: var(--text); }
.brand__mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #14b8a6, #0e7490);
  color: #ecfeff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.brand__mark svg { width: 20px; height: 20px; }
.brand__name span { color: var(--primary); }

/* --- Boutons -------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px;
  font: inherit; font-weight: 600; font-size: 0.9375rem; line-height: 1;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-bd);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { --btn-bg: var(--surface-3); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn--primary { --btn-bg: var(--primary); --btn-fg: var(--primary-ink); --btn-bd: transparent; }
.btn--primary:hover { --btn-bg: var(--primary-hover); }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); }
.btn--ghost:hover { --btn-bg: var(--surface-2); --btn-fg: var(--text); }
.btn--outline { --btn-bg: transparent; }
.btn--danger { --btn-bg: transparent; --btn-fg: #ff8a87; --btn-bd: rgba(239, 83, 80, 0.4); }
.btn--danger:hover { --btn-bg: var(--critical-soft); --btn-fg: #ffb4b1; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 0.875rem; border-radius: 8px; }
.btn--lg { min-height: 50px; padding: 0 22px; font-size: 1rem; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 42px; }
.btn--icon.btn--sm { width: 34px; }
.btn[disabled], .btn.is-loading { opacity: 0.7; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.btn.is-fav { --btn-fg: var(--warning); }
.btn.is-fav svg { fill: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }

/* --- Badges ------------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge--primary { background: var(--primary-soft); color: #5eead4; border-color: rgba(20, 184, 166, 0.3); }
.badge--accent { background: var(--accent-soft); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3); }
.badge--demo { background: rgba(148, 163, 184, 0.08); color: var(--text-2); border-style: dashed; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--warning .dot { background: var(--warning); }
.badge--serious .dot { background: var(--serious); }
.badge--critical .dot { background: var(--critical); }
.badge--good .dot { background: var(--good); }
.badge--status-nouveau { color: #7dd3fc; }
.badge--status-verifie { color: #86efac; }
.badge--status-transmis { color: #5eead4; }
.badge--status-archive { color: var(--text-3); }

.cat {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text);
}
.cat__icon {
  --c: var(--text-2);
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.cat__icon svg { width: 16px; height: 16px; }

/* --- Cartes ------------------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px; min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--bg-2); box-shadow: none; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__head h2 { font-size: 1rem; }
.card__head .muted { font-size: 0.8125rem; }
.card__foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
a.card { color: inherit; transition: border-color 0.15s, transform 0.15s var(--ease), background-color 0.15s; }
a.card:hover { border-color: var(--border-strong); background: var(--surface-2); }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) {
  .grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .grid--main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
}

/* Tuile statistique */
.stat { padding: 16px 18px; }
.stat__label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.8125rem; font-weight: 500; }
.stat__label .icon { width: 16px; height: 16px; color: var(--text-3); }
.stat__value { margin-top: 8px; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.75rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.stat__value small { font-size: 0.875rem; color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.stat__hint { margin-top: 4px; color: var(--text-3); font-size: 0.8125rem; }

/* --- Listes ------------------------------------------------------------------ */
.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); min-width: 0;
}
.list__item:first-child { border-top: 0; padding-top: 0; }
.list__item:last-child { padding-bottom: 0; }
.list__main { flex: 1 1 auto; min-width: 0; }
.list__title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list__meta { color: var(--text-2); font-size: 0.8125rem; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.list__aside { flex: none; text-align: right; color: var(--text-2); font-size: 0.875rem; }
a.list__item { color: inherit; border-radius: 8px; }
a.list__item:hover .list__title { color: var(--primary-hover); }
.list--cards .list__item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; background: var(--surface); }
.list--cards .list__item:first-child { margin-top: 0; padding-top: 14px; }

.date-chip {
  width: 46px; flex: none; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border);
  text-align: center; padding: 6px 0; line-height: 1.1;
}
.date-chip b { display: block; font-size: 1.0625rem; letter-spacing: -0.02em; }
.date-chip span { display: block; font-size: 0.6875rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }

/* --- Formulaires ------------------------------------------------------------ */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid > .span-2 { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid--stack-sm { grid-template-columns: 1fr; } .form-grid--stack-sm > * { grid-column: 1 / -1; } }
.form-section { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-section > legend, .form-label {
  display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 8px; color: var(--text); padding: 0;
}
.form-label .opt, legend .opt { color: var(--text-3); font-weight: 500; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.875rem; }
.hint { color: var(--text-3); font-size: 0.8125rem; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 10px;
  font: inherit; font-size: 1rem; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border-strong); transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: #41587f; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.22); background: #0f1a2c; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--critical); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select option, .select optgroup { background: var(--bg-2); color: var(--text); }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { min-width: 0; }
::-webkit-calendar-picker-indicator { filter: invert(0.75); cursor: pointer; }
.input--sm, .select--sm { min-height: 38px; padding: 7px 12px; font-size: 0.9rem; }
.select.select--sm { padding-right: 34px; background-position: right 10px center; }
.field-error { color: #ff8a87; font-size: 0.8125rem; font-weight: 500; }
.input-affix { position: relative; }
.input-affix .input { padding-right: 52px; }
.input-affix__unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 0.875rem; pointer-events: none; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.9375rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }

/* Choix sous forme de « chips » (cases à cocher / radios) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text-2); font-size: 0.875rem; font-weight: 500;
  transition: all 0.15s var(--ease); user-select: none;
}
.chip input:hover + span { border-color: #41587f; color: var(--text); }
.chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: #99f6e4; }
.chip input:checked + span::before { content: "✓"; font-weight: 700; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Contrôle segmenté */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border-strong); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 44px; padding: 6px 8px; border-radius: 9px; text-align: center;
  color: var(--text-2); font-weight: 600; font-size: 0.875rem; transition: all 0.15s var(--ease);
}
.segmented span small { font-weight: 500; color: var(--text-3); font-size: 0.6875rem; line-height: 1.2; }
.segmented input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.4), inset 0 0 0 1px var(--border-strong); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.segmented .sev { display: inline-flex; align-items: center; gap: 6px; }
.segmented .sev i { width: 8px; height: 8px; border-radius: 50%; }

/* Notation étoiles (radios inversés pour le survol CSS) */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { cursor: pointer; color: var(--border-strong); padding: 4px; transition: color 0.1s; }
.stars label svg { width: 28px; height: 28px; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--warning); }
.stars input:checked ~ label svg, .stars label:hover svg, .stars label:hover ~ label svg { fill: currentColor; }
.stars input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 6px; }
.rating { display: inline-flex; gap: 2px; color: var(--warning); }
.rating svg { width: 14px; height: 14px; fill: currentColor; }
.rating .off { color: var(--border-strong); }

/* Tuiles de catégorie (signalement) */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.tile__body {
  --c: var(--text-2);
  display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 14px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--border-strong); transition: all 0.15s var(--ease);
}
.tile__body strong { font-size: 0.875rem; line-height: 1.25; }
.tile__body small { color: var(--text-3); font-size: 0.75rem; line-height: 1.35; }
.tile input:hover + .tile__body { border-color: #41587f; background: var(--surface); }
.tile input:checked + .tile__body { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--bg-2)); box-shadow: inset 0 0 0 1px var(--c); }
.tile input:focus-visible + .tile__body { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile input:checked + .tile__body .cat__icon { background: var(--c); color: #0b1220; }

/* Dépôt de photo */
.dropzone {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px;
  border: 1px dashed var(--border-strong); background: var(--bg-2); cursor: pointer; transition: border-color 0.15s;
}
.dropzone:hover { border-color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; overflow: hidden; }
.dropzone__icon img { width: 100%; height: 100%; object-fit: cover; }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
details.disclosure > summary {
  list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9375rem;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .chev { margin-left: auto; transition: transform 0.2s var(--ease); color: var(--text-3); }
details.disclosure[open] > summary .chev { transform: rotate(90deg); }
details.disclosure > summary .icon:first-child { color: var(--text-3); }
details.disclosure > .disclosure__body { padding: 0 16px 16px; }

.form-actions {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  padding-top: 4px;
}
@media (max-width: 640px) {
  .form-actions--sticky {
    position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 5;
    margin: 0 calc(var(--gutter) * -1); padding: 12px var(--gutter);
    background: rgba(11, 18, 32, 0.92); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  }
  .form-actions--sticky .btn--primary { flex: 1; }
}

.duration-preview {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--primary-soft); color: #99f6e4; font-weight: 600; font-size: 0.9375rem;
}
.duration-preview[hidden] { display: none; }

/* --- Alertes ------------------------------------------------------------------ */
.alerts { display: grid; gap: 10px; margin-bottom: 20px; }
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); font-size: 0.9375rem;
  animation: slide-in 0.3s var(--ease);
}
.alert .icon { margin-top: 1px; }
.alert__close { margin-left: auto; background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 2px; border-radius: 6px; }
.alert__close:hover { color: var(--text); }
.alert--success { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.08); }
.alert--success .icon { color: var(--good); }
.alert--error { border-color: rgba(239, 83, 80, 0.4); background: var(--critical-soft); }
.alert--error .icon { color: var(--critical); }
.alert--info { border-color: rgba(56, 189, 248, 0.35); background: var(--accent-soft); }
.alert--info .icon { color: var(--accent); }
.alert--warning { border-color: rgba(251, 179, 21, 0.35); background: rgba(251, 179, 21, 0.08); }
.alert--warning .icon { color: var(--warning); }
.alert.is-leaving { opacity: 0; transform: translateY(-4px); transition: all 0.25s var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Note honnête sur la nature des données */
.note { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 0.8125rem; line-height: 1.5; }
.note .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--text-3); }

/* --- État vide ------------------------------------------------------------------ */
.empty { text-align: center; padding: 32px 16px; color: var(--text-2); }
.empty__icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-3); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 38ch; margin: 0 auto 16px; font-size: 0.9375rem; }

/* --- Tableaux ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-2);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
.table th.num, .table td.num { text-align: right; }
.table--compact td, .table--compact th { padding: 6px 10px; }
@media (max-width: 760px) {
  .table--responsive thead { display: none; }
  .table--responsive, .table--responsive tbody, .table--responsive tr, .table--responsive td { display: block; width: 100%; }
  .table--responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table--responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .table--responsive td::before { content: attr(data-label); color: var(--text-3); font-size: 0.8125rem; text-align: left; flex: none; }
  .table--responsive td.num { text-align: right; }
  .table--responsive td[data-label=""]::before { display: none; }
}

/* --- Pagination & filtres ------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 0.875rem; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { flex: 1 1 150px; }
.filters .field label { font-size: 0.75rem; color: var(--text-2); font-weight: 500; }
.filters .btn { flex: none; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; }
.tabs a {
  padding: 7px 14px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 0.875rem; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* --- En-tête de page ------------------------------------------------------------ */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head__text { min-width: 0; max-width: 680px; }
.eyebrow { color: var(--primary); font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.02em; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.eyebrow a { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.eyebrow a:hover { color: var(--text); }
.lead { color: var(--text-2); margin-top: 8px; font-size: 0.9375rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 14px; }
.section-title h2 { font-size: 1.0625rem; }

/* --- Gabarit application (connecté) --------------------------------------------- */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; gap: 8px; padding: 18px 14px;
  background: var(--bg-2); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform 0.25s var(--ease); overflow-y: auto;
}
.sidebar.is-open { transform: none; box-shadow: var(--shadow-pop); }
.sidebar__brand { padding: 4px 8px 14px; display: flex; align-items: center; justify-content: space-between; }
.sidebar__cta { display: grid; gap: 8px; padding: 4px 4px 12px; }
.nav { display: grid; gap: 2px; }
.nav__label { padding: 14px 10px 6px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: 0.9375rem; transition: background-color 0.15s, color 0.15s;
}
.nav a .icon { width: 19px; height: 19px; color: var(--text-3); transition: color 0.15s; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav a.is-active .icon { color: var(--primary); }
.nav a .count { margin-left: auto; font-size: 0.75rem; background: var(--accent-soft); color: #7dd3fc; padding: 1px 8px; border-radius: 999px; }
.sidebar__user { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, #1e3a5f, #164e63); color: #a5f3fc; font-weight: 700; font-size: 0.8125rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.avatar--lg { width: 56px; height: 56px; font-size: 1.125rem; }
.sidebar__user .who { min-width: 0; flex: 1; line-height: 1.3; }
.sidebar__user .who b { display: block; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.sidebar__user .who span { font-size: 0.75rem; color: var(--text-3); }
.scrim { position: fixed; inset: 0; background: rgba(3, 7, 18, 0.6); z-index: 35; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.scrim.is-visible { opacity: 1; pointer-events: auto; }

.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 var(--gutter);
  background: rgba(11, 18, 32, 0.85); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { margin-right: auto; }
.content { padding: 24px var(--gutter) calc(96px + env(safe-area-inset-bottom)); max-width: 1240px; margin: 0 auto; }

/* Barre d'onglets mobile */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(17, 27, 46, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.tabbar a, .tabbar summary {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px;
  color: var(--text-3); font-size: 0.6875rem; font-weight: 600; list-style: none; cursor: pointer;
}
.tabbar summary::-webkit-details-marker { display: none; }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a.is-active { color: var(--primary); }
.tabbar__fab { position: relative; display: flex; justify-content: center; }
.tabbar__fab summary { padding: 0; }
.tabbar__fab summary .fab {
  width: 52px; height: 52px; margin-top: -22px; border-radius: 16px; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 20px -6px rgba(20, 184, 166, 0.6), 0 0 0 4px var(--bg);
  transition: transform 0.2s var(--ease);
}
.tabbar__fab[open] summary .fab { transform: rotate(45deg); }
.tabbar__menu {
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  width: min(300px, calc(100vw - 32px)); padding: 8px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop);
  display: grid; gap: 4px; animation: pop 0.18s var(--ease);
}
.tabbar__menu a { flex-direction: row; gap: 12px; padding: 12px; font-size: 0.9375rem; color: var(--text); font-weight: 600; }
.tabbar__menu a:hover { background: var(--surface-2); }
.tabbar__menu a small { display: block; font-weight: 400; color: var(--text-2); font-size: 0.75rem; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px) scale(0.98); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .scrim, .topbar__menu, .tabbar { display: none; }
  .app-main { margin-left: var(--sidebar-w); }
  .topbar { display: none; }
  .content { padding: 32px 40px 56px; }
}

/* --- Gabarit public --------------------------------------------------------------- */
.public-header {
  position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.82); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.public-header__inner { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: 24px; }
.public-nav { display: none; gap: 4px; }
.public-nav a { color: var(--text-2); font-weight: 500; padding: 8px 12px; border-radius: 8px; font-size: 0.9375rem; }
.public-nav a:hover, .public-nav a.is-active { color: var(--text); background: var(--surface); }
.public-header__actions { margin-left: auto; display: flex; gap: 8px; }
@media (min-width: 760px) { .public-nav { display: flex; } }
.public-main { max-width: 1200px; margin: 0 auto; padding: 28px var(--gutter) 64px; }
.footer { border-top: 1px solid var(--border); color: var(--text-3); font-size: 0.8125rem; }
.footer__inner { max-width: 1200px; margin: 0 auto; padding: 24px var(--gutter); display: flex; gap: 12px 24px; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--text-2); }
.public-mobile-nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 var(--gutter) 10px; }
.public-mobile-nav a { color: var(--text-2); font-size: 0.875rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.public-mobile-nav a.is-active { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
@media (min-width: 760px) { .public-mobile-nav { display: none; } }

/* --- Accueil ------------------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; border: 1px solid var(--border);
  padding: clamp(28px, 6vw, 64px); min-height: 440px; display: flex; align-items: flex-end;
  background: var(--bg-2);
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,18,32,0.1) 0%, rgba(11,18,32,0.55) 45%, rgba(11,18,32,0.96) 100%); }
.hero__content { position: relative; z-index: 1; max-width: 640px; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); letter-spacing: -0.035em; line-height: 1.05; font-weight: 700; }
.hero p { color: #cbd5e1; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); margin-top: 16px; max-width: 52ch; }
.hero .row { margin-top: 28px; }
.hero__credit { position: absolute; right: 14px; top: 12px; z-index: 1; font-size: 0.6875rem; color: rgba(255,255,255,.5); }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 20px; }
@media (min-width: 760px) { .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric { background: var(--surface); padding: 18px 20px; }
.metric b { display: block; font-size: 1.625rem; letter-spacing: -0.03em; font-weight: 650; }
.metric span { color: var(--text-2); font-size: 0.8125rem; }

.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.feature .feature__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: 0.9375rem; }
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.step { position: relative; padding-top: 44px; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0;
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 0.875rem;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--primary);
}
.step h3 { margin-bottom: 4px; }
.step p { color: var(--text-2); font-size: 0.9375rem; }

/* --- Authentification ----------------------------------------------------------------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; }
@media (min-width: 980px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.auth__panel { display: flex; flex-direction: column; padding: 24px var(--gutter); }
.auth__form { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.auth__form h1 { font-size: 1.75rem; }
.auth__aside { display: none; position: relative; overflow: hidden; border-left: 1px solid var(--border); }
@media (min-width: 980px) { .auth__aside { display: block; } }
.auth__aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.auth__aside::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,18,32,.2), rgba(11,18,32,.92)); }
.auth__quote { position: absolute; z-index: 1; left: 48px; right: 48px; bottom: 48px; }
.auth__quote p { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; }
.auth__quote span { display: block; margin-top: 12px; color: var(--text-2); font-size: 0.875rem; }
.demo-box { margin-top: 24px; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--bg-2); font-size: 0.8125rem; color: var(--text-2); }
.demo-box code { color: #99f6e4; font-size: 0.8125rem; }

/* --- Spots & prévisions -------------------------------------------------------------- */
.spot-card { display: flex; flex-direction: column; gap: 12px; }
.spot-card__head { display: flex; gap: 12px; align-items: flex-start; }
.spot-card__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.spot-card h3 a { color: var(--text); }
.spot-card h3 a:hover { color: var(--primary-hover); }
.spot-card__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.conditions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .conditions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cond { padding: 14px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--border); min-width: 0; }
.cond__label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 0.75rem; font-weight: 500; }
.cond__label .icon { width: 14px; height: 14px; }
.cond__value { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.cond__value small { font-size: 0.8125rem; color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.cond__sub { color: var(--text-3); font-size: 0.75rem; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.arrow { display: inline-block; width: 14px; height: 14px; color: var(--accent); transform: rotate(var(--deg, 0deg)); }

.hourly { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(78px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.hour { scroll-snap-align: start; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); font-size: 0.8125rem; }
.hour b { display: block; font-size: 1rem; letter-spacing: -0.02em; margin: 4px 0 2px; }
.hour .t { color: var(--text-2); font-weight: 600; }
.hour .s { color: var(--text-3); font-size: 0.75rem; display: flex; align-items: center; justify-content: center; gap: 3px; }
.hour.is-now { border-color: var(--primary); background: var(--primary-soft); }

.tides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.tide { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); font-size: 0.8125rem; }
.tide b { font-size: 0.9375rem; display: block; }
.tide .icon { color: var(--accent); }
.tide--basse .icon { transform: scaleY(-1); color: var(--text-3); }
.tide-wrap { margin-top: 4px; }
.tide-curve { width: 100%; height: 64px; }
.tide-curve__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tide-curve__area { fill: rgba(56, 189, 248, 0.1); stroke: none; }
.tide-axis { display: flex; justify-content: space-between; color: var(--text-3); font-size: 0.6875rem; margin-top: 4px; font-variant-numeric: tabular-nums; }

.days { display: grid; gap: 8px; }
.day { display: grid; grid-template-columns: 82px 1fr 1fr 1fr; gap: 8px; align-items: center; font-size: 0.875rem; padding: 8px 0; border-top: 1px solid var(--border); }
.day:first-child { border-top: 0; }
.day span { color: var(--text-2); }
.day b { font-weight: 600; }

.unavailable { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: var(--bg-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 0.9375rem; }
.unavailable .icon { color: var(--text-3); margin-top: 2px; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.kv > div { background: var(--bg-2); padding: 12px 14px; min-width: 0; }
.kv dt { color: var(--text-3); font-size: 0.75rem; }
.kv dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.kv--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .kv--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --- Graphiques ------------------------------------------------------------------------ */
.chart { margin: 0; }
.chart__plot { position: relative; height: 180px; display: flex; }
.chart__grid { position: absolute; inset: 0 0 0 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart__grid span { position: relative; border-top: 1px solid var(--border); height: 0; }
.chart__grid span:last-child { border-top-color: var(--border-strong); }
.chart__grid em { position: absolute; left: 0; top: -16px; font-style: normal; font-size: 0.6875rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chart__bars { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 4px; padding-left: 28px; }
.chart__col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.chart__bar { width: 100%; max-width: 24px; min-height: 0; background: #2f6f8f; border-radius: 4px 4px 0 0; transition: background-color 0.15s; }
.chart__col.is-current .chart__bar { background: var(--primary); }
.chart__col.is-zero .chart__bar { min-height: 2px; background: var(--border-strong); }
.chart__col:hover .chart__bar, .chart__col:focus-visible .chart__bar { background: var(--primary-hover); }
.chart__val { position: absolute; left: 50%; transform: translate(-50%, -4px); font-size: 0.75rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.chart__tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 3;
  padding: 6px 10px; border-radius: 8px; background: #0a1424; border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; color: var(--text); opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.chart__col:hover .chart__tip, .chart__col:focus-visible .chart__tip { opacity: 1; }
.chart__col:first-child .chart__tip { left: 0; transform: none; }
.chart__col:last-child .chart__tip { left: auto; right: 0; transform: none; }
.chart__labels { display: flex; gap: 4px; padding-left: 28px; margin-top: 8px; }
.chart__labels span { flex: 1; text-align: center; font-size: 0.6875rem; color: var(--text-3); overflow: hidden; text-overflow: clip; white-space: nowrap; }
@media (max-width: 520px) { .chart__labels span:nth-child(even) { visibility: hidden; } }
.chart__data { margin-top: 12px; font-size: 0.8125rem; }
.chart__data summary { color: var(--text-3); cursor: pointer; display: inline-block; }
.chart__data summary:hover { color: var(--text-2); }
.chart__data .table { margin-top: 8px; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hbars__head { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; margin-bottom: 6px; }
.hbars__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.hbars__label a { color: var(--text); }
.hbars__label a:hover { color: var(--primary-hover); }
.hbars__label small { color: var(--text-3); font-weight: 400; }
.hbars__value { color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.8125rem; }
.hbars__key { --key: var(--text-2); width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--key); background: color-mix(in srgb, var(--key) 16%, transparent); flex: none; }
.hbars__track { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.hbars__bar { --bar: var(--primary); display: block; height: 100%; border-radius: 999px; background: var(--bar); min-width: 3px; transition: width 0.6s var(--ease); }

/* --- Carte ----------------------------------------------------------------------------- */
.map-layout { display: grid; gap: 16px; }
@media (min-width: 1024px) { .map-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.map { height: min(70vh, 640px); min-height: 380px; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; background: var(--bg-2); z-index: 0; }
.map--sm { height: 260px; min-height: 0; }
.map-legend { display: grid; gap: 4px; }
.legend-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 0.875rem; cursor: pointer; }
.legend-item:hover { background: var(--surface-2); }
.legend-item input { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; }
.legend-item .count { margin-left: auto; color: var(--text-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.legend-swatch { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #0b1220; box-shadow: 0 0 0 2px var(--surface); }
.legend-swatch svg { width: 12px; height: 12px; }
.legend-swatch--spot { background: transparent; border: 2px solid var(--text); width: 16px; height: 16px; margin: 0 3px; }

.leaflet-container { font-family: var(--font) !important; background: #0d1626 !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop) !important; }
.leaflet-popup-content-wrapper { border-radius: 12px !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 0.8125rem; line-height: 1.45; }
.leaflet-popup-content b { font-size: 0.9375rem; }
.leaflet-popup-content a { color: var(--primary) !important; font-weight: 600; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-2) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-control-attribution { background: rgba(11, 18, 32, 0.75) !important; color: var(--text-3) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.map-pin { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #0b1220; box-shadow: 0 0 0 2px #0b1220, 0 4px 10px rgba(0,0,0,.5); }
.map-pin svg { width: 14px; height: 14px; }
.map-pin--approx { box-shadow: 0 0 0 2px #0b1220, 0 0 0 4px rgba(255,255,255,.35); }
.map-spot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #f8fafc; background: #0b1220; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
.map-spot--fav { border-color: var(--warning); }

/* --- Photo ----------------------------------------------------------------------------- */
.photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); }
.photo img { width: 100%; max-height: 420px; object-fit: contain; }

/* --- Erreurs --------------------------------------------------------------------------- */
.error-page { text-align: center; padding: 64px 16px; max-width: 520px; margin: 0 auto; }
.error-page .code { font-size: 4.5rem; font-weight: 700; letter-spacing: -0.05em; line-height: 1; background: linear-gradient(180deg, var(--text), var(--text-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { margin-top: 12px; }
.error-page p { color: var(--text-2); margin: 10px 0 24px; }

/* --- Animation d'entrée discrète ---------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .content > *, .public-main > * { animation: rise 0.35s var(--ease) both; }
  .content > *:nth-child(2), .public-main > *:nth-child(2) { animation-delay: 0.03s; }
  .content > *:nth-child(3), .public-main > *:nth-child(3) { animation-delay: 0.06s; }
  .content > *:nth-child(4), .public-main > *:nth-child(4) { animation-delay: 0.09s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .sidebar, .tabbar, .topbar, .page-actions, .form-actions { display: none !important; }
  .app-main { margin: 0 !important; }
  body { background: #fff; color: #000; }
}

/* Fond de carte OpenStreetMap assombri pour le thème sombre (les marqueurs ne sont pas filtrés) */
.leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(0.92) contrast(0.88) saturate(0.6); }
