/* The WhatsApp inbox, in the night look of the staff screens. */
:root {
  color-scheme: dark;
  --bg: #0d0b0a;
  --surface: #1a1614;
  --surface-2: #241f1c;
  --ink: #ece3c8;
  --ink-soft: #b9ae93;
  --line: #3a322d;
  --orange: #ff7743;
  --pink: #f8bbcc;
  --green: #2ee6a6;
  --note: #3b3216;
  --radius: 10px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); }
a { color: var(--orange); }
h1, h2 { margin: 0; line-height: 1.15; }
.soft { color: var(--ink-soft); margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; appearance: none; border: 0; border-radius: var(--radius); padding: 0.6rem 1rem; background: var(--orange); color: #000; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { min-height: 36px; padding: 0.3rem 0.7rem; font-size: 0.9rem; white-space: nowrap; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
input, textarea { width: 100%; padding: 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 16px; }
.alert { margin: 0; padding: 0.6rem 0.8rem; border-radius: var(--radius); background: #4a1d12; color: var(--ink); }
.tag { font-style: normal; font-size: 0.75rem; padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-soft); }
.tag.human { border-color: var(--orange); color: var(--orange); }
.badge { display: inline-block; min-width: 1.4rem; padding: 0 0.35rem; border-radius: 99px; background: var(--orange); color: #000; font-size: 0.8rem; text-align: center; }

/* Login and plain pages */
.login, .narrow { width: min(100% - 32px, 28rem); margin: 3rem auto; }
.login { display: grid; gap: 1rem; }
.card { display: grid; gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.form label { display: grid; gap: 0.4rem; }
.form label span { font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* The inbox: list and thread side by side, one at a time on a phone */
.inbox { display: grid; grid-template-columns: minmax(18rem, 24rem) 1fr; grid-template-rows: auto 1fr; height: 100svh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 16px; border-bottom: 1px solid var(--line); }
.top strong { margin-right: auto; }
.top form { margin: 0; }
.list { overflow-y: auto; border-right: 1px solid var(--line); min-width: 0; }
.tabs { position: sticky; top: 0; display: flex; background: var(--bg); border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 0.7rem 0.3rem; text-align: center; color: var(--ink-soft); text-decoration: none; font-size: 0.875rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab.on { color: var(--ink); border-bottom-color: var(--orange); }
.tab b { font-weight: 400; color: var(--ink-soft); }
.list ul { list-style: none; margin: 0; padding: 0; }
.list li a { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.5rem; padding: 0.75rem 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.list li.open a { background: var(--surface-2); }
.list .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { display: flex; gap: 0.3rem; align-items: center; justify-self: end; }
.list .preview { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .time { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.8rem; }
.empty { padding: 1rem 16px; color: var(--ink-soft); }

.thread { display: grid; grid-template-rows: auto 1fr auto auto; min-width: 0; min-height: 0; }
.thread.empty { place-items: center; color: var(--ink-soft); }
.head { display: grid; gap: 0.6rem; padding: 0.75rem 16px; border-bottom: 1px solid var(--line); }
.head .back { display: none; text-decoration: none; }
.banner { display: grid; gap: 0.25rem; padding: 0.6rem 0.8rem; border-left: 3px solid var(--orange); border-radius: 6px; background: var(--surface); }
.banner p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.actions form { margin: 0; }
.handback { display: flex; gap: 0.5rem; flex: 1 1 20rem; }
.handback input { flex: 1; min-width: 0; }

.messages { overflow-y: auto; padding: 1rem 16px; display: flex; flex-direction: column; gap: 0.5rem; min-height: 0; }
.bubble { max-width: min(36rem, 85%); padding: 0.45rem 0.7rem; border-radius: var(--radius); background: var(--surface-2); }
.bubble p { margin: 0; }
.bubble .who { font-size: 0.75rem; color: var(--ink-soft); font-weight: 700; }
.bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .time { font-size: 0.75rem; color: var(--ink-soft); text-align: right; }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; }
.bubble.out.agent { background: #2b2140; }
.bubble.note { align-self: center; background: var(--note); border: 1px dashed #8a7a3c; }
.tick.read { color: var(--green); }
.tick.failed { color: #ff8a73; }
.menu { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.chip { display: inline-block; padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 99px; font-size: 0.85rem; cursor: default; }
details.menu { display: block; }
.menu .section { font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.3rem; }
.menu .row { font-size: 0.9rem; }
.event { align-self: center; margin: 0.25rem 0; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }

#problem { margin: 0 16px; }
.compose { display: grid; gap: 0.4rem; padding: 0.75rem 16px; border-top: 1px solid var(--line); }
.reply { display: flex; gap: 0.5rem; align-items: end; }
.reply textarea { flex: 1; resize: vertical; }
.window { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.window.closed { color: var(--pink); }
.note summary { cursor: pointer; color: var(--ink-soft); font-size: 0.9rem; }
.note form { display: grid; gap: 0.4rem; margin-top: 0.4rem; }

@media (max-width: 800px) {
  .inbox { grid-template-columns: 1fr; }
  .list { border-right: 0; }
  .inbox.has-chat .list { display: none; }
  .inbox:not(.has-chat) .thread { display: none; }
  .head .back { display: inline; }
  .top .soft, .top .wide { display: none; }
  .top { gap: 0.5rem; }
}

/* The bookings page */
.page { min-height: 100svh; }
.bookings { width: min(100% - 32px, 48rem); margin: 1rem auto 3rem; }
.bookings ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.bookings li { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.bookings li p { margin: 0; }
.bookings form { margin: 0; }
