/* Noche by Night · espace gérant : dense, lisible de loin derrière un comptoir. */
body.admin { font-size: 0.9375rem; }
.muted { color: var(--ink-2); }

/* ---------- Verrou ---------- */
.lock { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.lock[hidden] { display: none; }
.lock-card { max-width: 440px; animation: lockIn .7s var(--ease) both; }
@keyframes lockIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.lock h1 { font-size: 2.5rem; font-weight: 740; font-stretch: 110%; letter-spacing: -0.03em; margin: 36px 0 14px; }
.lock p { color: var(--ink-2); margin-bottom: 28px; }
.lock-back { display: inline-block; margin-left: 16px; color: var(--ink-2); font-size: var(--t-small); }

/* ---------- Coquille ---------- */
.app[hidden] { display: none; }
.a-top {
  position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 var(--pad);
  display: flex; align-items: center; gap: 32px;
  background: rgba(11, 13, 18, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.a-top .brand-sub { color: var(--amber); font-weight: 600; }
.a-tabs { display: flex; gap: 2px; height: 100%; }
.a-tabs a, .a-bottom a {
  position: relative; display: flex; align-items: center; gap: 9px; padding: 0 14px;
  color: var(--ink-2); text-decoration: none; font-weight: 550; transition: color .2s var(--ease);
}
.a-tabs a svg, .a-bottom a svg { width: 18px; height: 18px; }
.a-tabs a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--amber); transform: scaleX(0); transition: transform .35s var(--ease); }
.a-tabs a:hover, .a-tabs a.on { color: var(--ink); }
.a-tabs a.on::after { transform: scaleX(1); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--amber); color: var(--amber-ink); font-size: 0.75rem; font-weight: 700; animation: bump .5s var(--spring); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }
.a-live { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: var(--t-meta); color: var(--ink-2); white-space: nowrap; }
.a-clock { color: var(--ink); font-weight: 600; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.on { background: var(--amber); animation: beacon 2.6s var(--ease) infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(242,180,81,.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(242,180,81,0); } }
.a-bottom { display: none; }

.a-main { max-width: 1240px; margin: 0 auto; padding: 36px var(--pad) 96px; outline: none; }
.a-main.enter { animation: viewIn .45s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.v-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 32px; }
.v-head h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.375rem); font-weight: 740; font-stretch: 108%; letter-spacing: -0.025em; }
.v-sub { margin-top: 8px; color: var(--ink-2); max-width: 70ch; }
.v-sub strong { color: var(--ink); font-weight: 650; }
.btn-s { min-height: 40px; padding: 0 14px; font-size: 0.875rem; border-radius: 10px; }

.block { margin-bottom: 36px; }
.block h2 { font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.block h2 .count { font-size: var(--t-meta); color: var(--ink-2); font-weight: 600; background: var(--bg-2); padding: 2px 8px; border-radius: 6px; }
.empty { color: var(--ink-2); padding: 18px 0; border-top: 1px solid var(--line); }

/* ---------- Lignes de rendez-vous ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr) 110px auto; gap: 20px; align-items: center;
  padding: 14px 0 14px 0; border-bottom: 1px solid var(--line);
  transition: opacity .3s var(--ease), transform .32s var(--ease), background-color .6s var(--ease);
}
.row.pending { padding-left: 16px; }
.row.pending::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--amber); }
.row-time strong { display: block; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.row-time span { font-size: var(--t-meta); color: var(--ink-2); }
.row.late .row-time span { color: var(--alert); font-weight: 600; }
.row-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.row-who strong { font-size: 1rem; font-weight: 650; }
.row-who a { text-decoration: none; }
.row-who a:hover { color: var(--ink); text-decoration: underline; }
.code { font-size: var(--t-meta); letter-spacing: .04em; }
.row-items { margin-top: 3px; color: var(--ink); font-size: 0.875rem; }
.row-total { text-align: right; font-weight: 650; font-size: 1rem; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row.fresh { animation: fresh 2.4s var(--ease); }
@keyframes fresh { 0% { background: var(--amber-soft); transform: translateX(-10px); opacity: 0; } 15% { transform: none; opacity: 1; } 60% { background: var(--amber-soft); } 100% { background: transparent; } }
.row.leaving { opacity: 0; transform: translateX(24px); }
.done summary { list-style: none; cursor: pointer; }
.done summary::-webkit-details-marker { display: none; }
.done summary h2::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg); margin: -4px 0 0 6px; transition: transform .3s var(--ease); }
.done[open] summary h2::after { transform: rotate(225deg); margin-top: 4px; }
.rows-done .row { opacity: .72; }
.state { font-size: var(--t-meta); font-weight: 600; color: var(--ink-2); }
.state.collected { color: var(--ink); }

/* ---------- Stock ---------- */
.search input {
  width: min(320px, 100%); height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-1); color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.table { border-top: 1px solid var(--line); }
.t-head, .t-row { display: grid; grid-template-columns: minmax(220px, 2fr) 0.8fr 0.7fr 0.8fr 1.5fr 0.6fr; gap: 16px; align-items: center; }
.t-head { padding: 12px 0; font-size: var(--t-meta); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.t-group { padding: 22px 0 8px; font-size: var(--t-meta); font-weight: 650; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.t-row { padding: 8px 0; border-bottom: 1px solid var(--line); transition: opacity .3s var(--ease); }
.t-row.hidden-row { opacity: .5; }
.t-prod { display: flex; align-items: center; gap: 12px; }
.t-prod strong { display: block; font-weight: 600; }
.t-mini { width: 28px; height: 46px; display: grid; place-items: center; flex: none; }
.t-mini svg { height: 100%; width: auto; }
.flag { display: inline-block; font-size: 0.75rem; font-weight: 600; margin-top: 1px; }
.flag.low { color: var(--amber); }
.flag.out { color: var(--alert); }
.t-av { font-weight: 700; font-size: 1rem; }
.t-av.low { color: var(--amber); }
.t-av.zero { color: var(--alert); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; height: 40px; overflow: hidden; vertical-align: middle; }
.qty button { width: 36px; height: 100%; border: 0; background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.qty button:hover { background: var(--bg-2); }
.qty button[disabled] { opacity: .35; cursor: not-allowed; }
.qty button svg { width: 13px; height: 13px; }
.qty input, .qty output { width: 52px; height: 100%; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; color: var(--ink); text-align: center; font-weight: 650; display: grid; place-items: center; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty input:focus { outline: none; background: var(--bg-2); }
.link { margin-left: 10px; border: 0; background: none; color: var(--amber); font-weight: 650; cursor: pointer; padding: 8px 4px; }
.link:hover { text-decoration: underline; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; flex: none; }
.switch input { position: absolute; z-index: 1; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span[aria-hidden] { position: absolute; inset: 0; border-radius: 12px; background: var(--bg-3); transition: background-color .25s var(--ease); }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-2); transition: transform .35s var(--spring), background-color .25s var(--ease); }
.switch input:checked + span { background: var(--amber); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--amber-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- Ventes ---------- */
.seg { display: inline-flex; padding: 3px; background: var(--bg-1); border-radius: 11px; border: 1px solid var(--line); }
.seg button { height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 600; transition: background-color .25s var(--ease), color .25s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--bg-3); color: var(--ink); }
.sales-top { margin-bottom: 28px; }
.big { font-size: clamp(2.75rem, 2rem + 3vw, 4.5rem); font-weight: 760; font-stretch: 110%; letter-spacing: -0.04em; line-height: 1; }
.big.ticking { color: var(--amber); transition: color .4s var(--ease); }
.chart { margin: 0 0 44px; }
.chart figcaption { font-size: var(--t-meta); color: var(--ink-2); margin-bottom: 14px; }
.chart svg { width: 100%; height: auto; max-height: 300px; overflow: visible; }
.chart .axis { stroke: var(--line-2); }
.chart .bar rect { fill: var(--bg-3); transform-box: fill-box; transform-origin: bottom; animation: barUp .8s calc(var(--i) * 40ms) var(--ease) both; }
.chart .bar.cur rect { fill: var(--amber); }
.chart .bar:hover rect { fill: var(--ink-3); }
.chart .bar.cur:hover rect { fill: var(--amber-hi); }
.chart text { fill: var(--ink-2); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart text.v { fill: var(--ink); font-weight: 600; }
@keyframes barUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.sales-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.toplist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.toplist li { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl-name { display: flex; gap: 10px; align-items: baseline; }
.tl-name .muted { font-size: var(--t-meta); }
.tl-bar { display: block; height: 4px; border-radius: 2px; background: var(--bg-2); margin-top: 7px; overflow: hidden; }
.tl-bar span { display: block; height: 100%; background: var(--ink-2); border-radius: 2px; transform-origin: left; animation: barX .9s var(--ease) both; }
.toplist li:first-child .tl-bar span { background: var(--amber); }
@keyframes barX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tl-q { font-weight: 700; font-size: 1rem; }
.feed { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.feed li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed li:first-child { animation: fresh 1.6s var(--ease); }
.feed li span:last-child { font-weight: 650; }

/* ---------- Créneaux ---------- */
.slots-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.rules { border-top: 1px solid var(--line); }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rule select, .hours-edit input[type=time] {
  height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-1); color: var(--ink);
}
.rule select:focus, .hours-edit input:focus { outline: none; border-color: var(--amber); }
.hours-edit { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.hours-edit li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 61px; }
.hours-edit strong { width: 92px; font-weight: 600; }
.hours-edit li.off strong { color: var(--ink-2); }
.plan { position: sticky; top: 96px; }
.plan-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.plan-days button { flex: none; min-width: 64px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.plan-days button span { display: block; font-size: 0.75rem; color: var(--ink-2); }
.plan-days button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.plan-days button[aria-pressed="true"] span { color: var(--bg-3); }
.plan-help { color: var(--ink-2); font-size: var(--t-meta); margin: 14px 0; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pslot { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-1); color: var(--ink); cursor: pointer; text-align: left; transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .3s var(--spring); }
.pslot:hover:not([disabled]) { border-color: var(--ink-3); }
.pslot:active:not([disabled]) { transform: scale(.96); }
.pslot strong { font-size: 0.9375rem; }
.pfill { display: flex; gap: 3px; }
.pfill i { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-3); }
.pfill i.on { background: var(--ink-2); }
.pslot.full .pfill i.on { background: var(--amber); }
.pslot small { font-size: 0.75rem; color: var(--ink-2); }
.pslot.blocked { background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(236,232,224,.05) 6px 12px); border-style: dashed; }
.pslot.blocked strong { color: var(--ink-2); text-decoration: line-through; }
.pslot.past { opacity: .4; cursor: default; }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 1000px) {
  .a-tabs { display: none; }
  .a-bottom {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(17, 20, 27, 0.94);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .a-bottom a { flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 0.75rem; justify-content: center; border-radius: 10px; }
  .a-bottom a.on { color: var(--ink); background: var(--bg-2); }
  .a-bottom a.on svg { color: var(--amber); }
  .a-bottom .badge { position: absolute; top: 3px; left: calc(50% + 6px); }
  .a-main { padding-bottom: 120px; }
  .slots-layout, .sales-cols { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .plan { position: static; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .a-top { height: 58px; }
  .a-live > span:nth-child(2) { display: none; }
  .a-main { padding-top: 24px; }
  .v-head { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .v-head .btn { width: 100%; }
  .row, .row.pending { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 6px 14px; padding: 14px 0 14px 12px; }
  .row:not(.pending) { padding-left: 0; }
  .row-time strong { font-size: 1.125rem; }
  .row-time { align-self: start; padding-top: 2px; }
  .row-total { grid-column: 3; grid-row: 1; align-self: start; }
  .row-main { grid-column: 2 / 4; grid-row: 1; padding-right: 92px; }
  .row-actions { grid-column: 1 / -1; justify-content: stretch; margin-top: 6px; }
  .row-actions .btn { flex: 1; }
  .rows-done .row-actions { justify-content: flex-start; }
  .t-head { display: none; }
  .t-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 0; }
  .t-row > [data-label] { display: flex; justify-content: space-between; align-items: center; grid-column: 1 / -1; font-size: 0.875rem; }
  .t-row > [data-label]::before { content: attr(data-label); color: var(--ink-2); font-weight: 400; font-size: var(--t-meta); }
  .t-row > [data-label="Prix"], .t-row > [data-label="Réservé"] { display: none; }
  .t-prod { grid-column: 1 / -1; }
  .search, .search input { width: 100%; }
  .hours-edit li { flex-wrap: wrap; }
  .hours-edit strong { width: auto; flex: 1; }
  .rule { flex-wrap: wrap; }
}
