:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0b5d3b;
  --brand-dark: #08432b;
  --accent: #e8f5ee;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --ok-bg: #dcfce7;
  --ok: #166534;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h1 small { font-size: .9rem; color: var(--muted); font-weight: normal; margin-left: .5rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
code { background: var(--accent); padding: 0 .3em; border-radius: 3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.top {
  background: var(--brand);
  color: #fff;
  padding: .75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand span { font-weight: 400; opacity: .85; margin-left: .35rem; }
.menu { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-left: auto; }
.menu a { color: #fff; text-decoration: none; opacity: .95; }
.menu a:hover { text-decoration: underline; }
.menu a.soon { opacity: .5; cursor: default; }
.inline { display: inline; }
button.link { background: none; border: 0; color: #fff; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

.page { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-erreur { background: var(--danger-bg); color: var(--danger); }
.flash-info { background: var(--accent); color: var(--brand-dark); }

label { display: block; margin-bottom: 1rem; font-weight: 600; }
label small { display: block; font-weight: normal; margin-top: .25rem; }
label.check { font-weight: normal; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea, select {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem;
  border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; background: #fff;
}
input[type="color"] { display: block; margin-top: .3rem; height: 2.6rem; width: 5rem; padding: .2rem; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; }
input.tiny { width: 4.5rem; margin: 0; }
textarea { resize: vertical; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row label { flex: 1 1 140px; }
.actions { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; }

.btn, .btn-secondary, .btn-small {
  display: inline-block; border-radius: 6px; text-decoration: none; cursor: pointer; font: inherit; border: 1px solid transparent;
}
.btn { background: var(--brand); color: #fff; padding: .6rem 1.2rem; font-weight: 600; }
.btn:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: #cbd5e1; padding: .6rem 1.2rem; }
.btn-small { background: var(--accent); color: var(--brand-dark); padding: .3rem .7rem; font-size: .9rem; }

table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th, table.list td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { color: var(--muted); font-weight: 600; font-size: .85rem; }
table.list tr.inactive td { opacity: .55; }
table.list td.center, table.list th.center { text-align: center; }
table.questions input[type="text"] { margin: 0; }
table.questions textarea { margin-top: .35rem; font-size: .85rem; }
table.questions select { margin: 0; min-width: 11rem; }
fieldset.q { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1rem; }
fieldset.q legend { font-weight: 600; padding: 0 .3rem; }
fieldset.q label { font-weight: normal; margin: .25rem 0; display: flex; gap: .5rem; align-items: flex-start; }
fieldset.q input[type="radio"], fieldset.q input[type="checkbox"] { margin-top: .3rem; flex: 0 0 auto; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: #f3f4f6; color: var(--muted); }

ul.types { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
ul.types a { display: flex; flex-direction: column; gap: .25rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); background: #fff; height: 100%; }
ul.types a:hover { border-color: var(--brand); background: var(--accent); }
ul.types .name { font-weight: 600; }
ul.types .meta { color: var(--muted); font-size: .9rem; }
.price { font-size: 1.2rem; }
.placeholder { background: #fff7ed; border: 1px dashed #fdba74; border-radius: 8px; padding: 1rem; margin: 1rem 0; color: #9a3412; }

/* Calendrier de réservation */
.booking { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 2rem; margin: 1.5rem 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cal-nav { display: inline-block; width: 2rem; height: 2rem; line-height: 2rem; text-align: center; border-radius: 50%; text-decoration: none; font-size: 1.4rem; color: var(--brand); background: var(--accent); }
.cal-nav.off { color: #cbd5e1; background: transparent; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: .75rem; color: var(--muted); padding: .2rem 0; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: .95rem; color: #9ca3af; }
.cal-day.empty { visibility: hidden; }
.cal-day.open { background: var(--accent); color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.cal-day.open:hover { background: var(--brand); color: #fff; }
.cal-day.full { color: #9ca3af; text-decoration: line-through; }
.cal-day.closed { color: #d1d5db; }
.cal-day.out { color: #e5e7eb; }
.cal-day.selected { outline: 2px solid var(--brand); outline-offset: 1px; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--brand); }
.cal-legend { font-size: .8rem; color: var(--muted); margin-top: .75rem; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 2px; }
.sw.open { background: var(--accent); border: 1px solid var(--brand); }
.sw.full { background: #e5e7eb; }
.sw.closed { background: #fff; border: 1px solid #d1d5db; }
.slots h2 { margin-top: 0; }
.slot-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.slot { display: block; text-align: center; padding: .6rem .5rem; border: 1px solid var(--brand); border-radius: 6px; color: var(--brand-dark); text-decoration: none; font-weight: 600; background: #fff; }
.slot:hover { background: var(--brand); color: #fff; }
table.hours input[type="time"] { margin: 0; width: 7.5rem; }
.card { overflow-x: auto; }
.card.narrow-form { max-width: 640px; margin-left: auto; margin-right: auto; }
.hp { position: absolute; left: -9999px; top: -9999px; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); border-radius: 6px; padding: .5rem 1rem; font: inherit; cursor: pointer; }
.btn-danger:hover { background: var(--danger-bg); }
.cancel-box { margin-top: 1rem; padding: 1rem; border: 1px dashed #fca5a5; border-radius: 8px; }
.cancel-box label { margin-bottom: .5rem; }
table.list th { white-space: nowrap; }
.tabs a { display: inline-block; padding: .3rem .8rem; border-radius: 999px; text-decoration: none; margin-right: .3rem; color: var(--text); background: #f3f4f6; }
.tabs a.on { background: var(--brand); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.tile { display: block; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); background: #f9fafb; }
.tile strong { display: block; font-size: 1.8rem; color: var(--brand-dark); line-height: 1.1; }
.tile span { font-size: .85rem; color: var(--muted); }
.tile.warn strong { color: var(--danger); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.history { background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; white-space: pre-wrap; font: inherit; font-size: .9rem; }
.searchbar { align-items: flex-end; }
.searchbar label { flex: 1 1 260px; margin-bottom: 0; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

@media (max-width: 700px) {
  .booking { grid-template-columns: 1fr; }
  table.list { font-size: .85rem; }
  table.list th:nth-child(7), table.list td:nth-child(7) { display: none; }
}
.badge.warn { background: #fff7ed; color: #9a3412; }
.badge.ko { background: var(--danger-bg); color: var(--danger); }
