/* Gestionale, parte 05 di 10: Foglio di sala (vista, stati del tavolo), linea del tempo, eccezioni, clienti doppi, eventi, menù del giorno. Spostato da app.css nella versione X senza cambiare una regola; i file si caricano in ordine (vedi index.html), che è l'ordine di prima. */
/* ---------- Foglio di sala: vista, stati del tavolo, esigenze, coda dei walk-in, compleanni ---------- */
.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.view-bar .btn[aria-pressed="true"], .view-bar .status-btn[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: #fff; }
.st-table[aria-pressed="true"] { background: var(--blue); color: var(--on-blue); }
.btn.st-table[aria-pressed="true"] { border-color: var(--blue); }
.pill-need { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid var(--amber); }
.booking-needs { display: flex; flex-wrap: wrap; gap: 6px; }
.needs-editor {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: var(--r-control);
}
.needs-editor legend { padding: 0 4px; }

.birthdays {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--green-soft); border: 1px solid var(--green); border-radius: var(--r-panel);
}
.walkin-queue {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--black); border-radius: var(--r-panel);
}
.walkin-item { display: grid; grid-template-columns: 4.2rem 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.walkin-item:first-child { border-top: 0; }
.walkin-form { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--field-border); }

/* ---------- Linea del tempo ---------- */
.timeline-stack { display: flex; flex-direction: column; gap: 16px; }
.timeline-scroll { overflow-x: auto; }
.timeline-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.timeline-table th, .timeline-table td { padding: 0; }
.tl-col-name { width: 8.5rem; }
.tl-col-slot { width: 2.1rem; }
.timeline-table th.tl-name {
  position: sticky; left: 0; z-index: 1; padding: 6px 8px; overflow: hidden; text-align: left;
  background: var(--surface); font-weight: 600; text-overflow: ellipsis; white-space: nowrap;
}
.tl-cap { margin-left: 4px; color: var(--muted); font-weight: 400; }
.tl-hour-head {
  padding: 4px 6px; border-left: 1px solid var(--rule); color: var(--muted);
  font-size: 0.8rem; font-weight: 600; text-align: left;
}
.tl-now-head { color: var(--red-text); }
.timeline-table tbody tr { height: 46px; border-top: 1px solid var(--rule); }
.tl-hour { border-left: 1px solid var(--rule); }
.tl-now { box-shadow: inset 2px 0 0 var(--red); }
.timeline-table td.tl-bar { padding: 3px 2px; overflow: hidden; }
.tl-bar-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 38px; padding: 0 8px; overflow: hidden;
  border: 1px solid var(--blue); border-radius: 6px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--blue) 18%, var(--surface)); color: var(--ink); font: inherit; font-size: 0.85rem; font-weight: 600;
}
.tl-bar-btn[disabled] { cursor: default; opacity: 1; }
.tl-bar-time { flex: none; font-size: 0.8rem; font-weight: 700; }
.tl-bar-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-bar-covers { flex: none; padding: 0 6px; border-radius: 999px; background: var(--surface); font-size: 0.8rem; }
.tl-bar.status-arrivata .tl-bar-btn { background: var(--green); border-color: var(--green-dark); color: var(--on-accent); }
.tl-bar.status-uscita .tl-bar-btn { background: var(--grey-soft); border-color: var(--field-border); color: var(--muted); }
.tl-bar.tl-over .tl-bar-btn { outline: 2px solid var(--red); outline-offset: -2px; }

@media (max-width: 520px) {
  .tl-col-name { width: 6rem; }
  .walkin-item { grid-template-columns: 3.4rem 1fr; gap: 10px; }
}

/* ---------- Eccezioni per data ---------- */
.exception-form {
  display: flex; flex-direction: column; gap: 14px; padding: 14px;
  border: 1px solid var(--rule); border-radius: var(--r-control); background: var(--paper);
}
.exception-list li { align-items: flex-start; }
.exception-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.soft-rule { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--rule); }

/* ---------- Clienti doppi ---------- */
.duplicate-group { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-control); }
.duplicate-group .plain-list li { flex-wrap: wrap; }
.merge-preview {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border: 2px solid var(--amber); border-radius: var(--r-control); background: var(--amber-soft); color: var(--amber-ink);
}
.merge-notes { margin: 0; padding-left: 1.2rem; }

/* ---------- Eventi e richieste ---------- */
.event-card { gap: 10px; }
.event-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.event-menu { white-space: pre-line; padding: 10px 12px; border-left: 4px solid var(--amber); background: var(--amber-soft); color: var(--amber-ink); border-radius: var(--r-control); }
.event-bookings { padding-top: 6px; border-top: 1px dashed var(--field-border); }
.request-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.request-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--rule); border-left-width: 6px; border-radius: var(--r-panel); }
.request-card.request-new { border-left-color: var(--amber); }
.request-message { white-space: pre-line; overflow-wrap: anywhere; }
.request-reply { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--field-border); }

/* Menù del giorno (pannello del titolare). */
.menu-daily-text { min-height: 7rem; }
.menu-daily-preview { overflow-wrap: anywhere; }
.past-list { margin-top: 8px; }
