/* Front desk screens. Colours, fonts and shapes come from tokens.css (the website's look). */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--soft); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.45; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.loading { padding: 3rem; text-align: center; color: var(--muted); }

/* top bar */
.testbar { background: var(--panel-focus); color: var(--ink); text-align: center; font-weight: 600; font-size: .9rem; padding: .35rem 1rem; }
.top { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; flex-wrap: wrap; }
.top :focus-visible { outline-color: var(--panel-focus); }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; margin-right: .5rem; }
.brand small { font-family: var(--font-body); font-weight: 500; opacity: .75; margin-left: .35rem; }
.nav { display: flex; gap: .4rem; flex: 1 1 auto; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; min-height: var(--chip-h); display: inline-flex; align-items: center; padding: 0 1rem; border-radius: var(--r-chip); font-weight: 600; }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); }
.who { display: flex; align-items: center; gap: .75rem; font-size: .92rem; }
.who b { font-weight: 600; }
.who .btn { min-height: 2.5rem; }

main { max-width: 76rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; display: grid; gap: 1.25rem; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.head p { color: var(--muted); margin-top: .25rem; }
.back { color: var(--accent); text-decoration: none; font-weight: 600; display: inline-flex; min-height: 2.75rem; align-items: center; }

/* buttons, fields, chips, tiles */
.btn { min-height: var(--chip-h); padding: 0 1.2rem; border-radius: var(--r-input); font-weight: 600; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.danger { background: var(--card); color: var(--warn); border-color: var(--warn); }
.btn.big { min-height: 3.25rem; font-size: 1.05rem; width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--accent); font-weight: 600; padding: .25rem 0; min-height: 2.25rem; text-decoration: underline; text-underline-offset: 3px; }
.field { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; min-width: 0; }
.field span.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.input, .field input, .field select, .field textarea { border: 1.5px solid var(--line-strong); border-radius: var(--r-input); background: var(--card); min-height: var(--input-h); padding: .5rem .8rem; font-weight: 500; width: 100%; min-width: 0; }
.field textarea { min-height: 4.5rem; resize: vertical; }
.money { display: flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: var(--r-input); background: var(--card); min-height: var(--input-h); padding-left: .8rem; }
.money:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.money span { color: var(--muted); font-weight: 600; }
.money input { border: 0; background: transparent; width: 100%; min-width: 0; padding: .5rem .8rem .5rem .3rem; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.money input:focus-visible { outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: var(--chip-h); padding: 0 1rem; border-radius: var(--r-chip); border: 1.5px solid var(--line); background: var(--card); font-weight: 500; display: inline-flex; align-items: center; gap: .4rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { font-size: .8rem; opacity: .75; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .6rem; }
.tile { text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r-tile); padding: .75rem .9rem; min-height: 4.25rem; display: grid; gap: .15rem; align-content: start; }
.tile:hover { border-color: var(--accent); }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.tile b { font-weight: 600; }
.tile small { color: var(--muted); }
.tile .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; min-height: var(--chip-h); padding-top: .6rem; }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--accent); margin-top: .05rem; flex-shrink: 0; }
.switch { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; min-height: var(--chip-h); }
.switch input { width: 1.3rem; height: 1.3rem; accent-color: var(--accent); }

/* cards and the dark total panel */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.25rem 1.5rem; display: grid; gap: 1rem; min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 1.25rem; align-items: start; }
.panel { background: var(--ink); color: #fff; border-radius: var(--r-card); padding: 1.25rem 1.5rem; display: grid; gap: .75rem; position: sticky; top: 1rem; }
.panel :focus-visible { outline-color: var(--panel-focus); }
.panel .row { display: flex; justify-content: space-between; gap: 1rem; color: #cfe0e4; }
.panel .total { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.panel .label { color: #cfe0e4; font-size: .9rem; }
.panel .btn { width: 100%; }
.panel hr { border: 0; border-top: 1px solid #2b5462; margin: .25rem 0; width: 100%; }
.pill { display: inline-flex; align-items: center; min-height: 1.6rem; padding: 0 .6rem; border-radius: 2rem; font-size: .8rem; font-weight: 600; background: var(--soft); color: var(--muted); }
.pill.owes { background: #fff3e1; color: var(--warn); }
.pill.paid { background: #e4f3eb; color: #1f6b4a; }
.pill.closed { background: var(--ink); color: #fff; }

/* guests list */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.list table { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: .7rem 1rem; background: var(--soft); border-bottom: 1px solid var(--line); }
.list td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover td { background: var(--accent-soft); }
.list td a { color: var(--ink); font-weight: 600; text-decoration: none; }
.list .right { text-align: right; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.summary { display: flex; gap: 1.5rem; flex-wrap: wrap; color: var(--muted); }
.summary b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* bill */
.group { display: grid; gap: .1rem; }
.group h3 { display: flex; justify-content: space-between; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: .25rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--soft); align-items: baseline; }
.line .date { color: var(--muted); font-size: .88rem; }
.line .what b { font-weight: 600; }
.line .what small { display: block; color: var(--muted); font-size: .84rem; }
.line .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.line.off .what b, .line.off .amt { text-decoration: line-through; color: var(--muted); }
.line.fix .amt { color: var(--warn); }
.pay { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; color: #cfe0e4; }
.pay b { color: #fff; }

/* add items */
.basket { display: grid; gap: .5rem; }
.bitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .75rem; align-items: center; padding-bottom: .5rem; border-bottom: 1px solid #2b5462; }
.bitem small { color: #cfe0e4; display: block; }
.stepper { display: inline-flex; align-items: center; gap: .25rem; }
.stepper button { width: 2.75rem; height: 2.75rem; border-radius: var(--r-input); border: 1.5px solid #fff; background: transparent; color: #fff; font-size: 1.2rem; font-weight: 700; }
.stepper span { min-width: 2rem; text-align: center; font-weight: 700; }

/* sign in */
.signin { max-width: 44rem; margin: 3rem auto; padding: 0 1.25rem; display: grid; gap: 1.25rem; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; }
.names .tile { min-height: 4.5rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 5rem); gap: .6rem; justify-content: center; }
.pinpad button { height: 4rem; border-radius: var(--r-tile); border: 1.5px solid var(--line); background: var(--card); font-size: 1.5rem; font-weight: 600; font-family: var(--font-head); }
.pinpad button:active { background: var(--accent-soft); }
.dots { display: flex; justify-content: center; gap: .8rem; }
.dots i { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--ink); }
.dots i.on { background: var(--ink); }
.error { color: var(--warn); font-weight: 600; }
.notice { background: #fff3e1; border: 1px solid #e7c48f; color: var(--warn); border-radius: var(--r-tile); padding: .75rem 1rem; font-weight: 500; }
.notice.ok { background: #e4f3eb; border-color: #a9d5bd; color: #1f6b4a; }

/* day close */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1rem; }
.kv .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv .strong { font-weight: 700; font-size: 1.1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }

/* dialog inside the page */
.sheet { position: fixed; inset: 0; background: rgba(8, 38, 49, .45); display: grid; place-items: center; padding: 1rem; z-index: 30; }
.sheet .card { width: min(30rem, 100%); }

.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: var(--r-tile); font-weight: 600; z-index: 40; max-width: calc(100% - 2rem); box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--warn); }

@media (max-width: 760px) {
  .two { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
}
@media (max-width: 700px) {
  main { padding: 1rem 1rem 3rem; }
  .line { grid-template-columns: minmax(0, 1fr) auto; }
  .line .date { grid-column: 1 / -1; }
  .list .hide-sm { display: none; }
}
.stepper.onlight button { border-color: var(--ink); color: var(--ink); background: var(--card); }
.narrow { max-width: 24rem; }
.center { justify-items: center; }
.nights { min-width: 3rem; text-align: center; font-weight: 700; font-size: 1.2rem; }
.stack { display: grid; gap: 1.25rem; min-width: 0; }
.onpanel { color: #fff; }
.onpanel .money, .onpanel textarea { color: var(--ink); }
