@font-face { font-family: "Archivo"; src: url("/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #141211; --side: #171514; --card: #1c1a19; --raise: #24211f; --line: #2b2725; --line-2: #3a3532;
  --text: #f6f2ef; --soft: #b0a8a3; --muted: #857c77;
  --wine: #8e1b17; --wine-hi: #a8231e; --wine-deep: #590100; --glow: #e0a774;
  --ok: #58c98a; --warn: #f0b755; --bad: #f08a80;
  --t-green-bg: #1c3327; --t-green-bd: #27513a; --t-green: #b1ebc5;
  --t-amber-bg: #33271a; --t-amber-bd: #6c4830; --t-amber: #fed7aa;
  --t-red-bg: #3a1c1c; --t-red-bd: #5a2a2a; --t-red: #febfc6;
  --t-wine-bg: #3a1716; --t-wine-bd: #6b2622; --t-wine: #f3bcb6;
  --t-blue-bg: #1a2a33; --t-blue-bd: #27444f; --t-blue: #bfe3ee;
  --t-plain-bg: #26221f; --t-plain-bd: #3a3532; --t-plain: #cfc8c3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 "Archivo", system-ui, sans-serif; background: var(--bg); color: var(--text); }
h1, h2 { font-weight: 620; letter-spacing: -0.01em; margin: 0 0 .6rem; }
h1 { font-size: 1.35rem; } h2 { font-size: 1rem; margin-top: 1.7rem; }
.card h2, .zone h2 { margin-top: 0; }
.count { font-size: .8rem; font-weight: 500; color: var(--muted); background: var(--raise); border: 1px solid var(--line); border-radius: 99px; padding: .1rem .55rem; vertical-align: middle; margin-left: .3rem; }

#app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 1rem .75rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .5rem 1rem; font-size: 1rem; }
#tabs { display: grid; gap: 2px; flex: 1; align-content: start; }
.nav-h { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem .6rem .3rem; }
#tabs button { text-align: left; background: none; border: 0; color: var(--soft); font: inherit; padding: .5rem .65rem; border-radius: 7px; cursor: pointer; min-height: 38px; }
#tabs button:hover { color: var(--text); background: var(--card); }
#tabs button.on { background: var(--raise); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--wine-hi); }
.who { display: grid; gap: .25rem; font-size: .82rem; color: var(--soft); padding: .6rem; border-top: 1px solid var(--line); }
#clock { font-size: 1.3rem; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.link { background: none; border: 0; color: var(--soft); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; text-align: left; }
.link:hover { color: var(--text); }
main { padding: 1.25rem 1.5rem 4rem; min-width: 0; max-width: 1400px; }
.head { margin-bottom: .9rem; } .head h1 { margin: 0; }

.card, .zone { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.narrow { max-width: 560px; }
.login { max-width: 340px; margin: 12vh auto; display: grid; gap: .8rem; text-align: center; }
.login label { text-align: left; }
.row { display: flex; gap: .6rem; align-items: end; } .row.between { justify-content: space-between; align-items: center; }
.wrap { flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.grid2 .zone { margin: 0; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
label { display: grid; gap: .25rem; font-size: .8rem; color: var(--soft); margin-bottom: .6rem; }
input, select, textarea { font: inherit; color: var(--text); padding: .5rem .6rem; border: 1px solid var(--line-2); border-radius: 7px; background: var(--bg); min-height: 40px; }
input::placeholder { color: var(--muted); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
.toolbar { margin-bottom: .8rem; } .toolbar input[type=search] { flex: 1; min-width: 240px; }
.btn { font: inherit; font-weight: 600; padding: .5rem .9rem; min-height: 40px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--raise); color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--wine); border-color: var(--wine); } .btn.primary:hover { background: var(--wine-hi); border-color: var(--wine-hi); }
.btn.small { min-height: 34px; padding: .3rem .65rem; font-size: .85rem; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.muted { color: var(--muted); font-size: .85rem; margin: 0; }
.err { color: var(--bad); font-size: .85rem; margin: 0; min-height: 1.2em; }

.zone .big { font-size: 2.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; margin-top: .6rem; }
.zone .big small { font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.bar { height: 6px; background: var(--raise); border-radius: 4px; overflow: hidden; margin: .7rem 0; }
.bar i { display: block; height: 100%; background: var(--wine-hi); }
.bar i.full { background: var(--bad); }
.res { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; display: grid; gap: .25rem; }
.res b { font-size: .9rem; }
.res.busy { border-color: var(--t-wine-bd); background: var(--t-wine-bg); }
.res.closed { opacity: .5; }
.res .t { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--soft); }
.res .btn { justify-self: start; }

.chip { font: inherit; font-size: .82rem; border: 1px solid var(--line-2); background: none; color: var(--soft); border-radius: 99px; padding: .3rem .75rem; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters { margin-bottom: .6rem; }
.tablewrap { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: var(--card); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: var(--raise); }
td.time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: .3rem; }
tr.dim td { color: var(--muted); }
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--raise); border: 1px solid var(--line-2); font-size: .72rem; font-weight: 700; color: var(--soft); margin-right: .55rem; vertical-align: middle; }
.tag { display: inline-block; font-size: .74rem; font-weight: 600; padding: .1rem .5rem; border-radius: 6px; background: var(--t-plain-bg); border: 1px solid var(--t-plain-bd); color: var(--t-plain); white-space: nowrap; }
.tag.in, .tag.green { background: var(--t-green-bg); border-color: var(--t-green-bd); color: var(--t-green); }
.tag.late, .tag.amber { background: var(--t-amber-bg); border-color: var(--t-amber-bd); color: var(--t-amber); }
.tag.bad, .tag.red { background: var(--t-red-bg); border-color: var(--t-red-bd); color: var(--t-red); }
.tag.w, .tag.wine { background: var(--t-wine-bg); border-color: var(--t-wine-bd); color: var(--t-wine); }
.tag.m, .tag.blue { background: var(--t-blue-bg); border-color: var(--t-blue-bd); color: var(--t-blue); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .4rem; margin-top: .5rem; }
.slot { font: inherit; color: var(--text); font-variant-numeric: tabular-nums; padding: .45rem .3rem; border: 1px solid var(--line-2); border-radius: 7px; background: var(--raise); cursor: pointer; text-align: center; }
.slot small { display: block; color: var(--muted); font-size: .7rem; }
.slot:disabled { background: none; color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.slot:not(:disabled):hover { border-color: var(--glow); }
.cart { list-style: none; padding: 0; margin: 0 0 .8rem; }
.cart li { display: flex; justify-content: space-between; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.cart:empty::before { content: "Choisissez un créneau à gauche."; color: var(--muted); font-size: .85rem; }
dialog { border: 1px solid var(--line-2); border-radius: 12px; padding: 1.2rem 1.3rem; width: min(440px, 92vw); background: var(--card); color: var(--text); box-shadow: 0 16px 40px #0009; }
dialog::backdrop { background: #000a; }
dialog .row { justify-content: flex-end; margin-top: .6rem; }
dialog h2 { margin-top: 0; }
#toast { position: fixed; bottom: 1.2rem; left: 50%; translate: -50% 0; background: var(--text); color: var(--bg); font-weight: 600; padding: .6rem 1rem; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; z-index: 30; }
#toast.show { opacity: 1; } #toast.bad { background: var(--bad); }
.list-line { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.list-line:last-child { border-bottom: 0; }

#sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--side); border-left: 1px solid var(--line-2); box-shadow: -16px 0 40px #0008; padding: 1.2rem 1.3rem; overflow-y: auto; z-index: 20; }
#sheet .x { float: right; }
.scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0; }
.score { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; }
.score b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.score span { font-size: .72rem; color: var(--muted); }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .5rem .75rem; gap: .5rem; }
  .brand { padding: 0; } .nav-h { display: none; }
  #tabs { display: flex; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .who { border: 0; padding: 0; grid-auto-flow: column; align-items: center; gap: .7rem; margin-left: auto; }
  #clock { font-size: 1rem; } #who { display: none; }
  .cols, .grid2 { grid-template-columns: 1fr; } .scores { grid-template-columns: 1fr 1fr; }
  main { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
