/* Agafay Quad Marrakech — gestion des réservations
   Identité visuelle : vert foncé, or sable, beige chaud, blanc cassé (désert d'Agafay). */

:root {
  /* Fonds et textes */
  --bg: #f4eee3;
  --surface: #fffdf8;
  --surface-2: #faf5ec;
  --ink: #1d2a23;
  --muted: #6c6a5d;
  --border: #e6dbc7;
  --border-strong: #d6c6a9;

  /* Marque */
  --primary: #1f4a38;          /* vert foncé */
  --primary-hover: #163829;
  --primary-soft: #e6eee8;
  --accent: #b8893e;           /* or sable */
  --accent-strong: #946a28;
  --accent-soft: #f5ead2;
  --ring: rgba(31, 74, 56, .2);

  /* Menu */
  --sidebar: #17362a;
  --sidebar-2: #0f2a1f;
  --sidebar-ink: #efe6d4;
  --sidebar-muted: #a8b4a6;

  /* États */
  --danger: #b03a2e;
  --danger-soft: #f9e6e2;
  --danger-border: #ebc3bc;
  --pending: #a2680b;      --pending-bg: #fbf0d5;
  --confirmed: #2b7a4b;    --confirmed-bg: #e2f1e6;
  --cancelled: #b03a2e;    --cancelled-bg: #f9e6e2;
  --completed: #2d5f8b;    --completed-bg: #e3ecf5;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 42, 35, .05), 0 6px 20px rgba(29, 42, 35, .05);
  --shadow-lg: 0 18px 50px rgba(15, 42, 31, .18);
  --sidebar-w: 256px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; letter-spacing: -.005em; color: var(--primary-hover); }
h2 { font-size: 1.06rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
/* Icônes au trait (style unique, légères, héritent de la couleur du texte). */
svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; text-align: center; }
.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;
}
.req { color: var(--accent-strong); }
.row-link { color: inherit; }
.field-label-static { font-size: .86rem; }
.status-switch button.current:disabled { opacity: 1; }
.kpi-sub small { font-size: .78rem; }

/* ---------- Mise en page ---------- */

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-ink);
  display: flex; flex-direction: column; gap: 22px; padding: 22px 16px;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 700; letter-spacing: .01em; color: #fbf6ea; }
.brand small { color: var(--accent); font-size: .68rem; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; margin-top: 3px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding-top: 6px; border-top: 1px solid rgba(239, 230, 212, .1); }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-ink); font-weight: 500; opacity: .86;
}
.side-nav a:hover { background: rgba(239, 230, 212, .07); text-decoration: none; opacity: 1; }
.side-nav a.active { background: rgba(184, 137, 62, .16); color: #fff; opacity: 1; }
.side-nav a.active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.side-nav a.active svg { color: var(--accent); }

.topbar, .bottom-nav { display: none; }

main {
  margin-left: var(--sidebar-w);
  padding: 30px 36px 52px;
  max-width: calc(1320px + var(--sidebar-w));
  outline: none;
}
main.is-wide { max-width: calc(1880px + var(--sidebar-w)); }

@media (max-width: 959px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
    background: linear-gradient(90deg, var(--sidebar) 0%, var(--sidebar-2) 100%); color: var(--sidebar-ink);
    padding: 10px 16px; box-shadow: 0 2px 10px rgba(15, 42, 31, .2);
  }
  .topbar .brand img { box-shadow: none; }
  .topbar .brand strong { font-size: 1.02rem; }
  .topbar .brand small { font-size: .62rem; margin-top: 2px; }
  main { margin-left: 0; padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(255, 253, 248, .97); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(29, 42, 35, .06);
  }
  .bottom-nav a[hidden] { display: none; }
  .bottom-nav a {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; color: var(--muted); font-size: .7rem; font-weight: 600; border-radius: 10px;
  }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a.active svg { color: var(--accent-strong); }
  .bottom-nav-new svg {
    background: var(--primary); color: #fff; border-radius: 50%; padding: 4px; width: 28px; height: 28px;
    box-shadow: 0 4px 10px rgba(31, 74, 56, .3);
  }
  .bottom-nav a.bottom-nav-new.active svg { color: #fff; background: var(--accent-strong); }
  h1 { font-size: 1.4rem; }
}

/* ---------- Éléments de base ---------- */

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 16px; margin-bottom: 24px;
}
.page-head p { margin: 4px 0 0; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; margin-bottom: 6px; color: var(--muted); }
.back-link svg { width: 16px; height: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-family: var(--serif); font-size: 1.12rem; font-weight: 700; color: var(--primary-hover); }
.card-head a { font-size: .86rem; font-weight: 600; color: var(--accent-strong); }
.card-body { padding: 16px 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap;
  text-decoration: none; transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(31, 74, 56, .22); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { border-color: var(--border-strong); background: var(--surface); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f2d23; }
.btn-danger-outline { border-color: var(--danger-border); color: var(--danger); background: var(--surface); }
.btn-danger-outline:hover { background: var(--danger-soft); }
.btn-success { background: var(--confirmed); color: #fff; }
.btn-success:hover { background: #22633d; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--border); color: var(--primary-hover); text-decoration: none; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.icon-btn svg { width: 18px; height: 18px; }

/* Statuts des réservations */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: .76rem; font-weight: 650; white-space: nowrap; letter-spacing: .01em;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-pending { color: var(--pending); background: var(--pending-bg); border-color: #f0dca9; }
.badge-confirmed { color: var(--confirmed); background: var(--confirmed-bg); border-color: #bfdec9; }
.badge-cancelled { color: var(--cancelled); background: var(--cancelled-bg); border-color: var(--danger-border); }
.badge-completed { color: var(--completed); background: var(--completed-bg); border-color: #c3d5e8; }

.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .76rem; color: var(--muted); white-space: nowrap;
}

.empty {
  padding: 34px 18px; text-align: center; color: var(--muted);
}
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

.loading { padding: 48px 0; text-align: center; color: var(--muted); }
.loading::before {
  content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
  background: var(--danger-soft); color: #7a241c; border: 1px solid var(--danger-border);
}
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Tableau de bord ---------- */

.dash-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 22px 26px; margin-bottom: 20px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--sidebar) 0%, var(--primary) 60%, #2d5c46 100%);
  color: var(--sidebar-ink); box-shadow: var(--shadow-lg);
}
.dash-hero::after {
  content: ""; position: absolute; right: -40px; bottom: -6px; width: 460px; height: 120px;
  background: url("/img/dunes.svg") no-repeat right bottom / contain; opacity: .55; pointer-events: none;
}
.dash-hero-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.dash-hero-brand img { border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.dash-hero h1 { color: #fbf6ea; font-size: 1.7rem; }
.dash-hero p { margin: 4px 0 0; color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.dash-hero .actions { position: relative; z-index: 1; }
.dash-hero .btn-primary { background: var(--accent); color: #1d2a23; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.dash-hero .btn-primary:hover { background: #c99a4d; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi {
  position: relative; overflow: hidden; padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 6px; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--border); }
a.kpi:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 10px 26px rgba(29, 42, 35, .09); transform: translateY(-1px); }
.kpi-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .84rem; font-weight: 600; }
.kpi-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-size: 1.9rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--primary-hover); line-height: 1.15; }
.kpi-sub { font-size: .82rem; color: var(--muted); }
.kpi-today { background: linear-gradient(160deg, var(--surface) 55%, var(--primary-soft) 100%); }
.kpi-today::before, .kpi-revenue::before { background: var(--primary); }
.kpi-slot::before { background: var(--accent); }
.kpi-slot .kpi-icon { background: var(--accent-soft); color: var(--accent-strong); }
.kpi-revenue { background: linear-gradient(160deg, var(--surface) 55%, var(--accent-soft) 100%); }
.kpi-revenue .kpi-value { font-size: 1.55rem; }
.kpi-pending .kpi-icon { background: var(--pending-bg); color: var(--pending); }

.kpi-mini-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-mini {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 12px; padding: 12px 16px; color: inherit;
}
.kpi-mini .kpi-icon { grid-row: span 2; }
a.kpi-mini:hover { text-decoration: none; border-color: var(--accent); }
.kpi-mini .kpi-icon { width: 32px; height: 32px; }
.kpi-mini .kpi-mini-text { display: flex; flex-direction: column; min-width: 0; }
.kpi-mini .kpi-mini-text span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi-mini .kpi-value { font-size: 1.2rem; white-space: nowrap; }
.kpi-mini .kpi-mini-text { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
.kpi-mini > .kpi-sub { grid-column: 2; font-size: .76rem; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }

/* Tablette : « Aujourd'hui » et « Chiffre d'affaires » en haut, puis les 3 créneaux. */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpi-today { grid-column: span 3; order: 0; }
  .kpi-revenue { grid-column: span 3; order: 1; }
  .kpi-slot { grid-column: span 2; order: 2; }
}
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }
/* Téléphone : aujourd'hui, les 3 créneaux côte à côte, puis le chiffre d'affaires. */
@media (max-width: 760px) {
  .kpis { gap: 10px; }
  .kpi-today { grid-column: 1 / -1; }
  .kpi-revenue { grid-column: 1 / -1; order: 3; }
  .kpi-slot { padding: 12px 10px; gap: 4px; }
  .kpi-slot .kpi-label { flex-direction: column; align-items: flex-start; gap: 6px; font-size: .78rem; }
  .kpi-slot .kpi-value { font-size: 1.35rem; }
  .kpi-slot .kpi-sub { font-size: .72rem; }
  .kpi-mini-row { grid-template-columns: 1fr; gap: 8px; }
  .dash-hero { padding: 18px; }
  .dash-hero::after { width: 300px; opacity: .4; }
  .dash-hero h1 { font-size: 1.35rem; }
  .dash-hero-brand img { width: 46px; height: 46px; }
}
@media (max-width: 520px) {
  .kpi { padding: 14px; }
  .kpi-value { font-size: 1.45rem; }
  .page-head .btn-hide-mobile, .dash-hero .btn-hide-mobile { display: none; }
}

/* Liste du jour (tableau de bord + calendrier) */
.slot-group + .slot-group { border-top: 1px solid var(--border); }
.slot-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 12px 20px 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-strong); font-weight: 700;
}
.slot-head span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: .8rem; }
.booking-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 20px; color: inherit; border-left: 3px solid transparent;
}
.booking-row:hover { background: var(--surface-2); text-decoration: none; border-left-color: var(--accent); }
.booking-row.is-cancelled .br-main strong { text-decoration: line-through; color: var(--muted); }
.br-main { display: flex; flex-direction: column; min-width: 0; }
.br-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-main span { font-size: .85rem; color: var(--muted); }
.br-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.br-side .amount { font-size: .9rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.br-side .due { font-size: .78rem; color: var(--pending); }
.br-side .paid { font-size: .78rem; color: var(--confirmed); }

.pending-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 20px; border-top: 1px solid var(--border);
}
.pending-item:first-child { border-top: 0; }
.pending-item a { color: inherit; min-width: 0; flex: 1; }
.pending-item a:hover { text-decoration: none; }
.pending-item a:hover strong { color: var(--primary); }

/* ---------- Filtres et tableau ---------- */

.filters {
  display: grid; gap: 12px; padding: 16px 18px; margin-bottom: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}
.filters .field { margin: 0; }
.filters .field-search { grid-column: span 2; }
.filters-footer {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 10px; border-top: 1px dashed var(--border);
}
.filters-count { margin: 0; font-size: .95rem; color: var(--muted); }
.filters-count strong { font-size: 1.15rem; color: var(--primary-hover); font-variant-numeric: tabular-nums; }
.filters-actions { display: flex; gap: 8px; }
@media (max-width: 1280px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters .field-search { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .filters-actions { width: 100%; }
  .filters-actions .btn { flex: 1; }
}

/* Téléchargements : mêmes filtres que le tableau */
.export-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.export-bar[hidden] { display: none; }
.export-label { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 650; color: var(--muted); margin-right: 4px; }
.export-label svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .export-bar .btn { flex: 1 1 100%; justify-content: center; } }

/* Résumé chiffré des réservations trouvées */
.results-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.result-kpi {
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0;
}
.result-kpi span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.result-kpi strong { display: block; font-size: 1.35rem; color: var(--primary-hover); font-variant-numeric: tabular-nums; margin: 2px 0; overflow-wrap: anywhere; }
.result-kpi small { font-size: .74rem; color: var(--muted); }
.result-kpi[data-total="balance"] { border-top-color: var(--pending); }
.result-kpi[data-total="deposits"] { border-top-color: var(--confirmed); }
@media (max-width: 1000px) { .results-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* position: relative — les libellés pour lecteurs d'écran (.sr-only, positionnés) restent dans le cadre défilant */
.table-wrap { overflow-x: auto; position: relative; }
table.bookings { width: 100%; border-collapse: collapse; min-width: 1180px; }
.bookings th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; line-height: 1.25;
  color: var(--muted); font-weight: 700; padding: 10px 8px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); vertical-align: bottom;
}
.bookings td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .85rem; }
/* Colonne « Date et créneau » figée pendant le défilement horizontal du tableau */
.bookings th:first-child, .bookings td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.bookings th:first-child { background: var(--surface-2); }
.bookings tbody tr:hover td:first-child { background: #fbf6ec; }
.table-scroll-hint { display: none; margin: 0 0 6px; font-size: .78rem; color: var(--muted); text-align: right; }
.table-scroll-hint.is-visible { display: block; }
.bookings tbody tr { cursor: pointer; transition: background-color .12s; }
.bookings tbody tr:hover { background: #fbf6ec; }
.bookings tbody tr:last-child td { border-bottom: 0; }
/* Statut visible d'un coup d'œil : liseré coloré au début de chaque ligne */
.bookings tbody tr td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.bookings tbody tr.status-pending td:first-child { box-shadow: inset 4px 0 0 var(--pending); }
.bookings tbody tr.status-confirmed td:first-child { box-shadow: inset 4px 0 0 var(--confirmed); }
.bookings tbody tr.status-completed td:first-child { box-shadow: inset 4px 0 0 var(--completed); }
.bookings tbody tr.status-cancelled td:first-child { box-shadow: inset 4px 0 0 var(--cancelled); }
.bookings tr.is-cancelled td { color: var(--muted); }
.bookings .t-right { text-align: right; }
.bookings .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bookings .cell-sub { display: block; font-size: .78rem; color: var(--muted); }
.bookings .actions { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.bookings .details-btn { white-space: nowrap; }
.bookings .details-btn svg { width: 15px; height: 15px; }
.bookings .id { color: var(--accent-strong); font-size: .76rem; font-weight: 650; }
.bookings .c-client strong { white-space: nowrap; }
.bookings .c-price strong { color: var(--primary-hover); }
.bookings .due { color: var(--pending); }
.bookings .paid { color: var(--confirmed); }
.bookings .c-activity { min-width: 170px; max-width: 260px; }
.bookings .c-pickup { min-width: 150px; max-width: 220px; }

/* Téléphone et petite tablette : chaque réservation devient une fiche avec intitulés */
@media (max-width: 860px) {
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.bookings { min-width: 0; }
  table.bookings, .bookings tbody { display: block; }
  .bookings thead { display: none; }
  .bookings tbody tr {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px;
    background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent);
    border-radius: var(--radius); padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
  }
  /* La couleur du statut est portée par la bordure de la fiche : pas de liseré ni de colonne figée ici. */
  .bookings tbody tr[class*="status-"] td:first-child, .bookings tbody tr td:first-child { box-shadow: none; position: static; background: transparent; }
  .table-scroll-hint.is-visible { display: none; }
  .bookings tbody tr.status-pending { border-left-color: var(--pending); }
  .bookings tbody tr.status-confirmed { border-left-color: var(--confirmed); }
  .bookings tbody tr.status-completed { border-left-color: var(--completed); }
  .bookings tbody tr.status-cancelled { border-left-color: var(--cancelled); }
  .bookings tbody tr:hover { background: var(--surface); }
  .bookings td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; }
  .bookings td[data-label]::before {
    content: attr(data-label); display: block; font-size: .66rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 1px;
  }
  .bookings td.c-client { grid-column: 1 / 5; grid-row: 1; font-size: 1rem; }
  .bookings td.c-status { grid-column: 5 / 7; grid-row: 1; text-align: right; }
  .bookings td.c-date { grid-column: 1 / 4; }
  .bookings td.c-phone { grid-column: 4 / 7; }
  .bookings td.c-activity { grid-column: 1 / -1; }
  .bookings td.c-duration { grid-column: 1 / 3; }
  .bookings td.c-people { grid-column: 3 / 5; }
  .bookings td.c-source { grid-column: 5 / 7; }
  .bookings td.c-price, .bookings td.c-deposit, .bookings td.c-balance {
    grid-column: span 2; text-align: left; padding-top: 8px; border-top: 1px dashed var(--border); white-space: normal;
  }
  .bookings td.c-pickup { grid-column: 1 / -1; }
  .bookings td.c-author { grid-column: 1 / 4; align-self: center; }
  .bookings td.c-actions { grid-column: 4 / 7; align-self: center; }
  .bookings .cell-sub { display: inline; margin-left: 6px; }
  .bookings td.c-client .cell-sub { display: block; margin-left: 0; }
  .bookings td.c-date .cell-sub::before { content: "· "; }
}

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: .9rem; }
.pagination .btns { display: flex; gap: 8px; }

/* ---------- Formulaires ---------- */

.form-grid { display: grid; gap: 16px; }
.form-section { padding: 20px; }
.form-section h2 { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.12rem; color: var(--primary-hover); }
.form-section h2 .step {
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--font);
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong);
  font-size: .8rem; font-weight: 750; border: 1px solid #ecdcb9;
}
.fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 16px; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
@media (max-width: 1080px) { .fields { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .span-2, .fields .full-mobile { grid-column: 1 / -1; }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: .85rem; font-weight: 650; color: #2c3a32; }
.field label .req { color: var(--accent-strong); }
.field .hint { font-size: .78rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fffefb;
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #c6b38f; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
.field.has-error input, .field.has-error select, .field.has-error textarea {
  border-color: var(--danger); background: #fffaf9;
}
.field .error { font-size: .8rem; color: var(--danger); font-weight: 550; }
.field .error:empty { display: none; }
/* Téléphone : pays (indicatif) + numéro, côte à côte ; empilés sur les très petits écrans */
.phone-input { display: grid; grid-template-columns: minmax(8rem, 42%) minmax(0, 1fr); gap: 8px; }
.phone-input select { min-width: 0; text-overflow: ellipsis; }
@media (max-width: 340px) { .phone-input { grid-template-columns: 1fr; } }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 52px; }
.input-suffix span {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .8rem; font-weight: 600; pointer-events: none;
}

.balance-box {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid #ecdcb9; min-height: 44px;
}
.balance-box .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.balance-box output { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.balance-box.is-paid { background: var(--confirmed-bg); border-color: #bfdec9; }
.balance-box.is-paid output { color: var(--confirmed); }
.balance-box.is-invalid { background: var(--danger-soft); border-color: var(--danger-border); }
.balance-box.is-invalid output { color: var(--danger); }

.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%);
}
@media (max-width: 959px) {
  .form-actions { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .form-actions .btn { flex: 1; }
}

/* ---------- Fiche réservation ---------- */

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .detail-grid { grid-template-columns: 1fr; } }
.dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; }
.dl div { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.dl div:nth-last-child(-n+2) { border-bottom: 0; }
.dl dt { font-size: .72rem; color: var(--accent-strong); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dl dd { margin: 3px 0 0; font-weight: 500; word-break: break-word; }
.dl .full { grid-column: 1 / -1; }
.dl .pre { white-space: pre-wrap; font-weight: 400; }
@media (max-width: 560px) {
  .dl { grid-template-columns: 1fr; }
  .dl div:nth-last-child(2) { border-bottom: 1px solid var(--border); }
}
.money-lines { display: flex; flex-direction: column; }
.money-lines div { display: flex; justify-content: space-between; padding: 11px 20px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.money-lines div:last-child { border-bottom: 0; font-weight: 750; font-size: 1.08rem; background: var(--surface-2); }
.money-lines .due { color: var(--pending); }
.money-lines .paid { color: var(--confirmed); }
.status-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 20px; }
.status-switch button { justify-content: flex-start; }
.status-switch button.current { border-color: currentColor; cursor: default; }
.status-switch button.s-pending { color: var(--pending); }
.status-switch button.s-confirmed { color: var(--confirmed); }
.status-switch button.s-cancelled { color: var(--cancelled); }
.status-switch button.s-completed { color: var(--completed); }
.status-switch button.current.s-pending { background: var(--pending-bg); }
.status-switch button.current.s-confirmed { background: var(--confirmed-bg); }
.status-switch button.current.s-cancelled { background: var(--cancelled-bg); }
.status-switch button.current.s-completed { background: var(--completed-bg); }
.contact-actions { display: flex; gap: 8px; padding: 0 20px 16px; flex-wrap: wrap; }
.meta { padding: 12px 20px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); }

/* ---------- Calendrier ---------- */

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .calendar-layout { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cal-head h2 { text-transform: capitalize; font-family: var(--serif); font-size: 1.15rem; color: var(--primary-hover); }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow {
  padding: 9px 6px; text-align: center; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent-strong); font-weight: 700; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.cal-day {
  min-height: 92px; padding: 6px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  transition: background-color .12s;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: #fbf6ec; }
.cal-day.other { background: #f8f3e9; color: #b5aa96; }
.cal-day .d { font-size: .85rem; font-weight: 650; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .d { background: var(--primary); color: #fff; }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.cal-day .count { font-size: .76rem; font-weight: 700; color: var(--primary-hover); }
.cal-day .people { font-size: .72rem; color: var(--muted); }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.cal-dots .pending, .cal-legend .pending { background: var(--pending); }
.cal-dots .confirmed, .cal-legend .confirmed { background: var(--confirmed); }
.cal-dots .cancelled, .cal-legend .cancelled { background: var(--cancelled); }
.cal-dots .completed, .cal-legend .completed { background: var(--completed); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 18px; font-size: .78rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@media (max-width: 640px) {
  .cal-day { min-height: 58px; padding: 4px 3px; align-items: center; }
  .cal-day .people { display: none; }
  .cal-day .count { font-size: .68rem; }
  .cal-dots { justify-content: center; }
  .cal-dow { font-size: .62rem; padding: 6px 2px; letter-spacing: .04em; }
}
.day-panel .card-head { flex-wrap: wrap; }
.day-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 20px; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.day-summary strong { color: var(--primary-hover); }

/* ---------- Notifications et boîte de dialogue ---------- */

.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px));
}
@media (max-width: 959px) { .toasts { right: 16px; left: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); max-width: none; } }
.toast {
  padding: 12px 16px; border-radius: var(--radius-sm); background: var(--sidebar); color: #fff;
  border-left: 4px solid var(--accent);
  box-shadow: 0 10px 28px rgba(15, 42, 31, .25); font-weight: 550; font-size: .92rem;
  animation: toast-in .2s ease-out;
}
.toast.error { background: var(--danger); border-left-color: #f2b8ad; }
.toast.success { background: var(--primary); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.dialog {
  border: 0; border-radius: var(--radius); padding: 24px; width: min(440px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg); color: var(--ink); background: var(--surface);
}
.dialog h2 { font-family: var(--serif); font-size: 1.2rem; color: var(--primary-hover); }
.dialog::backdrop { background: rgba(15, 42, 31, .45); }
.dialog p { color: var(--muted); margin: 10px 0 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Packs, activités, paiements, paramètres ---------- */

.pack-tag {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 2px 9px 2px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid #ecdcb9;
  font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pack-tag svg { width: 14px; height: 14px; }
.bookings .cell-sub.cell-wrap { white-space: normal; }
.cal-packs { font-size: .7rem; color: var(--accent-strong); font-weight: 650; }
@media (max-width: 640px) { .cal-packs { display: none; } }

.items-editor { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.items-rows { display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 110px 130px auto; gap: 10px 12px; align-items: start;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.item-row .icon-btn { margin-top: 28px; }
@media (max-width: 1100px) {
  .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .item-row [data-item-field=details] { grid-column: 2; }
  .item-row .icon-btn { grid-column: 3; grid-row: 1; }
  .item-row [data-item-field=duration_hours] { grid-column: 1; grid-row: 2; }
  .item-row [data-item-field=price] { grid-column: 2; grid-row: 2; }
}
.items-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.items-total { font-size: .9rem; color: var(--muted); }
.items-total strong { color: var(--ink); }
.items-editor > .error { font-size: .8rem; color: var(--danger); font-weight: 550; }
.items-editor > .error:empty { display: none; }
@media (max-width: 560px) {
  .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; padding: 8px; }
  .item-row [data-item-field=activity_code] { grid-column: 1 / 3; grid-row: 1; }
  .item-row .icon-btn { grid-column: 3; grid-row: 1; }
  .item-row [data-item-field=details] { grid-column: 1 / -1; grid-row: 2; }
  .item-row [data-item-field=duration_hours] { grid-column: 1; grid-row: 3; }
  .item-row [data-item-field=price] { grid-column: 2 / -1; grid-row: 3; }
}

/* Transport */
.transport-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.transport-choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fffefb;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.transport-choice:hover { border-color: var(--accent); }
.transport-choice.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.transport-choice input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.transport-choice span { display: flex; flex-direction: column; gap: 2px; }
.transport-choice small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.field.has-error .transport-choice { border-color: var(--danger); }
.transport-panel { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.transport-panel[hidden] { display: none; }
.transport-notes { margin-top: 14px; }
@media (max-width: 760px) { .transport-choices { grid-template-columns: 1fr; } }
.transport-line { color: var(--ink) !important; font-weight: 500; }
.bookings .transport-chip { display: block; font-size: .74rem; }
@media (max-width: 860px) { .bookings .transport-chip { display: inline; margin-left: 6px; } .bookings .transport-chip::before { content: "· "; } }
.link-btn {
  display: inline; padding: 0; margin-left: 6px; border: 0; background: none;
  color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.link-btn[hidden] { display: none; }
.item-details { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.item-figures { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.item-figures .muted { font-size: .85rem; }
.settings-hint { margin: 12px 20px 0; }
.activity-text { display: block; white-space: pre-wrap; }
.activity-text-detail { margin: 2px 0 0; white-space: pre-wrap; font-weight: 500; }
[data-field=activity_text] textarea { min-height: 64px; }

.static-value {
  display: flex; align-items: center; min-height: 44px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--confirmed-bg); color: var(--confirmed); font-weight: 750;
}

.detail-pack { margin: 2px 0 8px; }
.item-list { list-style: none; margin: 4px 0 0; padding: 0; }
.item-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.item-list li:last-child { border-bottom: 0; }
.item-list li.total { font-weight: 700; }

.sub-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-strong); margin-bottom: 6px; }
.payments-list { list-style: none; margin: 0 0 14px; padding: 0; }
.payments-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.payments-list li div { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.payments-empty { margin: 0 0 14px; }
.payment-form, .pack-editor {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.payment-form h3, .pack-editor h3 { font-size: .98rem; font-family: var(--serif); color: var(--primary-hover); }
.fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1080px) { .fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.settings-list { display: flex; flex-direction: column; gap: 10px; }
.act-row {
  display: grid; grid-template-columns: minmax(160px, 2fr) 150px auto minmax(140px, 1fr) auto;
  gap: 8px 14px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.act-row.is-inactive { background: var(--surface-2); }
.act-row.is-inactive input[name=name] { color: var(--muted); }
.act-row.act-new { grid-template-columns: minmax(160px, 2fr) 150px auto; border-style: dashed; border-color: var(--border-strong); }
.act-meta { align-self: center; }
.act-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
@media (max-width: 900px) {
  .act-row, .act-row.act-new { grid-template-columns: 1fr 1fr; }
  .act-row .act-meta { grid-column: 1 / -1; }
  .act-row .act-actions { grid-column: 1 / -1; justify-content: stretch; }
  .act-row .act-actions .btn { flex: 1; }
}
.pack-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pack-card {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.pack-card.is-inactive { background: var(--surface-2); color: var(--muted); }
.pack-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pack-info strong { display: inline-flex; align-items: center; gap: 6px; }
.pack-info p { margin: 0; }

/* ---------- Comptes : menu, connexion, espace Client, utilisateurs ---------- */

.side-nav a[hidden], .btn[hidden] { display: none; }
.side-user {
  border-top: 1px solid rgba(239, 230, 212, .1); padding: 14px 4px 0; font-size: .86rem;
  display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center;
}
.side-user::before {
  content: attr(data-initial); grid-row: span 2;
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(184, 137, 62, .22); color: var(--accent); font-weight: 750; font-size: .95rem;
}
.side-user strong { display: block; color: #fff; }
.side-user small { color: var(--sidebar-muted); }
.side-user-actions { grid-column: 1 / -1; display: flex; gap: 14px; margin-top: 10px; }
.side-user-actions a, .side-user-actions button {
  background: none; border: 0; padding: 0; color: var(--sidebar-ink); font: inherit; font-size: .82rem;
  text-decoration: none; opacity: .8; cursor: pointer; border-bottom: 1px dotted rgba(239, 230, 212, .4);
}
.side-user-actions a:hover, .side-user-actions button:hover { opacity: 1; color: var(--accent); }
.topbar-account { display: inline-flex; align-items: center; gap: 6px; color: var(--sidebar-ink); font-size: .85rem; }
.topbar-account:hover { text-decoration: none; color: var(--accent); }

.bookings .author-line { display: block; font-size: .76rem; margin-top: 3px; white-space: nowrap; }
@media (max-width: 860px) { .bookings .author-line { display: block; margin-left: 0; } }
.origin-badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid #ecdcb9;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}

/* Page de connexion : panneau de marque + formulaire */
.auth-page, .client-page { margin: 0; background: var(--bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: 48px 56px; color: var(--sidebar-ink);
  background: radial-gradient(circle at 80% 18%, rgba(232, 201, 131, .16) 0, rgba(232, 201, 131, 0) 26%),
              linear-gradient(160deg, #1d4434 0%, var(--sidebar) 45%, var(--sidebar-2) 100%);
}
.auth-brand::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: url("/img/dunes.svg") no-repeat center bottom / cover; opacity: .9; pointer-events: none;
}
.auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.auth-logo img { border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.auth-logo strong { display: block; font-family: var(--serif); font-size: 1.6rem; color: #fbf6ea; line-height: 1.1; }
.auth-logo small { display: block; margin-top: 4px; color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; }
.auth-tagline { position: relative; z-index: 1; max-width: 420px; }
.auth-tagline h2 { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.2; color: #fbf6ea; }
.auth-tagline p { margin: 12px 0 0; color: rgba(239, 230, 212, .82); font-size: 1rem; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; margin: 0; max-width: none; }
.auth-card { width: min(420px, 100%); padding: 32px 30px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 2px; }
.auth-card form { display: flex; flex-direction: column; gap: 15px; margin-top: 6px; }
.auth-card form[hidden], .auth-card [hidden] { display: none; }
.auth-card code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.auth-card .btn-primary { min-height: 48px; font-size: 1rem; }
.auth-mobile-logo { display: none; }
.auth-foot { margin-top: 10px; text-align: center; font-size: .78rem; color: var(--muted); }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-wrap { min-height: 100vh; align-items: stretch; padding: 0 0 32px; flex-direction: column; justify-content: flex-start; }
  .auth-mobile-logo {
    display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%;
    padding: 34px 16px 70px; margin-bottom: -46px; text-align: center; color: var(--sidebar-ink);
    background: url("/img/dunes.svg") no-repeat center bottom / 140% auto, linear-gradient(160deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  }
  .auth-mobile-logo img { border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
  .auth-mobile-logo strong { font-family: var(--serif); font-size: 1.35rem; color: #fbf6ea; }
  .auth-mobile-logo small { color: var(--accent); font-size: .68rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
  .auth-card { align-self: center; position: relative; z-index: 1; width: calc(100% - 32px); max-width: 440px; padding: 26px 22px; }
}

/* Espace Client (sans logo ni menu administratif) */
.client-wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px 40px; }
.client-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--accent-soft); }
.client-head h1 { font-size: 1.7rem; }
.client-head p { margin: 6px 0 0; }
.client-page .form-section h2 { margin-bottom: 14px; }
.client-actions { margin-top: 4px; }
.client-actions .btn { min-height: 50px; font-size: 1rem; }
.client-success { padding: 30px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; border-top: 4px solid var(--accent); }
.client-success h2 { font-family: var(--serif); font-size: 1.3rem; color: var(--primary-hover); }
.client-success[hidden], #request-form[hidden] { display: none; }
/* Espace client / agence (compte individuel) : onglets et « Mes réservations » */
.client-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line, #e5ddd0); }
.client-tabs[hidden], #my-bookings[hidden], .my-detail[hidden] { display: none; }
.client-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.client-tab.active { color: var(--primary-hover); border-bottom-color: var(--accent); }
.my-toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.my-toolbar .field { flex: 1 1 240px; margin: 0; }
.my-exports { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) { .my-exports { width: 100%; } .my-exports .btn { flex: 1 1 100%; justify-content: center; } }
.my-list { display: grid; gap: 8px; }
.my-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; font: inherit; color: inherit; cursor: pointer; }
.my-item:hover, .my-item:focus-visible { border-color: var(--accent); }
.my-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.my-item-main small { overflow-wrap: anywhere; }
.my-detail { margin-top: 16px; padding: 20px; }
.my-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.my-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; margin: 0 0 14px; }
.my-dl dt { font-size: .78rem; color: var(--muted); }
.my-dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.my-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#edit-cancel[hidden], #request-see[hidden] { display: none; }
#edit-cancel { margin-top: 8px; }
.my-detail .alert-success { color: var(--confirmed); background: var(--confirmed-bg); border-color: #bfdec9; }
.client-foot { margin-top: 28px; text-align: center; font-size: .82rem; }
.client-foot .link-btn { color: var(--muted); font-weight: 500; }

.config-checklist { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.config-checklist li { display: flex; gap: 8px; align-items: baseline; }
.config-checklist li.ok span { color: var(--confirmed); font-weight: 700; }
.config-checklist li.ko span { color: var(--cancelled); font-weight: 700; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: .85em; word-break: break-all; }
.notif-actions { justify-content: flex-start; margin-top: 12px; }
.notif-preview {
  white-space: pre-wrap; margin: 12px 0 0; padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font: inherit; font-size: .9rem;
}
.notif-preview[hidden] { display: none; }
.notif-history { display: flex; flex-direction: column; }
.notif-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.notif-row:first-child { border-top: 0; }
.notif-meta { display: flex; flex-direction: column; min-width: 0; }
.notif-text { grid-column: 1 / -1; margin: 0; font-size: .88rem; color: var(--ink); word-break: break-word; }
.notif-error { grid-column: 1 / -1; margin: 0; font-size: .82rem; color: var(--danger); word-break: break-word; }
.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px 16px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.user-row.is-inactive { background: var(--surface-2); color: var(--muted); }
.user-row .who strong { display: block; }
.user-row .who span { font-size: .82rem; color: var(--muted); }
.user-row .meta-col { font-size: .82rem; color: var(--muted); }
.role-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; border: 1px solid transparent; }
.role-admin { background: var(--primary-soft); color: var(--primary); border-color: #c9dbcf; }
.role-staff { background: var(--completed-bg); color: var(--completed); border-color: #c3d5e8; }
.role-client { background: var(--accent-soft); color: var(--accent-strong); border-color: #ecdcb9; }
.role-partner { background: #f1ebf6; color: #6a4a86; border-color: #ddd0e8; }
.user-editor { margin-top: 8px; grid-column: 1 / -1; }
@media (max-width: 700px) { .user-row { grid-template-columns: 1fr; } }

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