/* Property console. Denser and quieter than the guest site: a tool used all
   day by front desk staff, so contrast, tabular numbers and big hit targets win
   over atmosphere. Brand tokens still apply so it feels like their property. */

:root {
  color-scheme: light;
  --ink: #15180F; --paper: #F5F1E6; --moss: #27402A; --clay: #B0501D; --sand: #E6DCC6;
  --bg: color-mix(in oklab, var(--paper) 55%, #fff);
  --surface: #fff;
  --text: #1b1c17;
  --muted: #6d6b63;
  --line: #e7e3da;
  --line-2: #d8d3c7;
  --direct: var(--moss);
  --direct-soft: color-mix(in oklab, var(--moss) 14%, #fff);
  --ota: #8a8578;
  --ota-soft: #eeebe4;
  --accent: var(--clay);
  --r: 14px;
  --sans: 'Archivo', 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --display: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ shell ---- */
.shell { min-height: 100svh; }
.side { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #e9e6dd; }
.side__brand { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .8rem 1rem .2rem; }
.side__brand b { font: 400 1.15rem/1 var(--display); color: #fff; }
.side__brand span { font: 400 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.side__nav { display: flex; gap: .25rem; overflow-x: auto; padding: .5rem .75rem .6rem; scrollbar-width: none; }
.side__nav::-webkit-scrollbar { display: none; }
.side__nav button { flex-shrink: 0; display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: 0 .9rem; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; opacity: .75; white-space: nowrap; }
.side__nav button.is-on { background: rgb(255 255 255 / .12); opacity: 1; font-weight: 600; }
.side__nav i { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; display: inline-grid; place-items: center; }
.side__foot { display: none; }

.main { padding: 1rem clamp(.9rem, 3vw, 2rem) 3rem; display: grid; gap: 1rem; min-width: 0; }
.main__h h1 { font: 400 1.7rem/1.1 var(--display); letter-spacing: -.01em; margin-top: .15rem; }

/* ------------------------------------------------------------ atoms ---- */
.cbtn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 38px; padding: 0 .9rem; border-radius: 10px; border: 1px solid var(--moss); background: var(--moss); color: #fff; font-weight: 600; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.cbtn:hover { filter: brightness(1.08); }
.cbtn[disabled] { opacity: .45; cursor: default; filter: none; }
.cbtn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.cbtn--ghost.is-on { border-color: var(--moss); box-shadow: inset 0 0 0 1px var(--moss); }
.cbtn--sm { min-height: 30px; padding: 0 .6rem; font-size: .78rem; }
.cselect { min-height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 .6rem; font-size: .85rem; max-width: 100%; }
.chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--ota-soft); color: #5b574d; }
.chip--direct { background: var(--direct-soft); color: var(--direct); }
.chip--ota { background: var(--ota-soft); color: #5b574d; }
.empty { padding: 1rem; color: var(--muted); list-style: none; }
.empty--big { padding: 3rem 1rem; text-align: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.panel__h { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.panel__h h2 { font-size: .95rem; font-weight: 600; }
.panel__h span { font-size: .78rem; color: var(--muted); }
.panel__note { padding: .2rem 1rem 1rem; font-size: .82rem; }
.cols { display: grid; gap: 1rem; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.kpi { display: grid; gap: .15rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.kpi span { font-size: .75rem; color: var(--muted); }
.kpi b { font: 400 1.6rem/1.1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi small { font-size: .74rem; color: var(--muted); }
.kpi--accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi--accent span, .kpi--accent small { color: rgb(255 255 255 / .7); }

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border-radius: var(--r); background: color-mix(in oklab, var(--accent) 10%, #fff); border: 1px solid color-mix(in oklab, var(--accent) 35%, #fff); animation: pulse 1.6s ease 2; }
.banner div { display: grid; gap: .15rem; min-width: 0; }
.banner span { font-size: .82rem; color: var(--muted); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 18%, transparent); } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.toolbar__label { font-size: .85rem; color: var(--muted); }
.seg { display: flex; gap: .3rem; flex-wrap: wrap; }
.legend { display: flex; gap: .4rem; margin-left: auto; }

.toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem); padding: .8rem 1.1rem; border-radius: 12px; background: var(--ink); color: #fff; font-size: .88rem; box-shadow: 0 16px 40px -12px rgb(0 0 0 / .45); animation: toast .25s ease both; transition: opacity .3s, transform .3s; }
.toast.is-out { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ------------------------------------------------------------ today ---- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row__main { display: grid; gap: .1rem; min-width: 0; }
.row__main span { font-size: .8rem; color: var(--muted); }
.row__meta { grid-column: 1; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row .cbtn { grid-column: 2; grid-row: 1 / span 2; }
.row__due { font-size: .78rem; font-weight: 600; color: var(--accent); }
.row__paid { font-size: .78rem; color: var(--muted); }
.row--fresh { background: color-mix(in oklab, var(--accent) 7%, #fff); }
.row--focus { box-shadow: inset 3px 0 0 var(--accent); }

.hks { list-style: none; margin: 0; padding: .8rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .45rem; }
.hk { display: grid; gap: .1rem; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); cursor: default; }
.hk b { font-variant-numeric: tabular-nums; }
.hk span { font-size: .7rem; color: var(--muted); }
.hk--occupied { background: var(--direct-soft); border-color: transparent; }
.hk--arriving { border-color: var(--moss); border-style: dashed; }
.hk--dirty { background: color-mix(in oklab, var(--accent) 12%, #fff); border-color: transparent; cursor: pointer; }
.hk--dirty span { color: var(--accent); font-weight: 600; }

/* --------------------------------------------------------- calendar ---- */
.cal2 { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.cal2__in { min-width: 900px; }
.cal2__row { display: grid; grid-template-columns: 110px 1fr; border-bottom: 1px solid var(--line); }
.cal2__row--head { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.cal2__unit { position: sticky; left: 0; z-index: 1; display: flex; align-items: center; padding: 0 .8rem; background: var(--surface); border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; font-weight: 600; font-size: .85rem; }
.cal2__unit--wide { font-size: .78rem; font-weight: 500; }
.cal2__group { padding: .45rem .8rem; background: var(--bg); font: 500 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); position: sticky; left: 0; }
.cal2__track { position: relative; display: grid; grid-template-columns: repeat(14, 1fr); grid-template-rows: 40px; }
.cal2__track > i { grid-row: 1; border-right: 1px solid var(--line); }
.cal2__track > i.is-today { background: color-mix(in oklab, var(--accent) 7%, transparent); }
.cal2__track--head { grid-template-rows: auto; }
.cal2__d { display: grid; justify-items: center; padding: .4rem 0; border-right: 1px solid var(--line); }
.cal2__d small { font-size: .66rem; color: var(--muted); text-transform: uppercase; }
.cal2__d b { font-variant-numeric: tabular-nums; }
.cal2__d.is-we { background: var(--bg); }
.cal2__d.is-today b { color: #fff; background: var(--accent); border-radius: 999px; padding: 0 .45rem; }
.bar { grid-row: 1; align-self: center; height: 28px; margin: 0 3px; padding: 0 .5rem; border: 0; border-radius: 7px; text-align: left; cursor: pointer; overflow: hidden; font-size: .74rem; font-weight: 600; white-space: nowrap; min-width: 0; }
.bar span { display: block; overflow: hidden; text-overflow: ellipsis; }
.bar--direct { background: var(--moss); color: #fff; }
.bar--ota { background: #d9d4c8; color: #3f3c34; }
.bar--fresh { background: var(--accent); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }

/* -------------------------------------------------------- enquiries ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.lane { scroll-snap-align: start; display: grid; gap: .55rem; align-content: start; padding: .6rem; background: color-mix(in oklab, var(--ink) 4%, var(--bg)); border-radius: var(--r); min-width: 0; }
.lane__h { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .2rem .3rem .3rem; }
.lane__h h2 { font-size: .9rem; }
.lane__h span { font-size: .75rem; color: var(--muted); }
.card { display: grid; gap: .3rem; padding: .8rem .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card--fresh { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card p { font-size: .82rem; }
.card__sub { color: var(--muted); font-size: .76rem !important; }
.card__foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .25rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- billing ---- */
.billing { display: grid; gap: 1rem; }
.folios { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.folios ul { list-style: none; margin: 0; padding: .4rem; display: flex; gap: .4rem; overflow-x: auto; }
.folio-item { display: grid; gap: .1rem; min-width: 190px; text-align: left; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.folio-item span { font-size: .75rem; color: var(--muted); }
.folio-item em { font-style: normal; font-size: .75rem; font-weight: 600; color: var(--accent); }
.folio-item.is-on { border-color: var(--moss); box-shadow: inset 0 0 0 1px var(--moss); }
.folio-item.is-fresh { background: color-mix(in oklab, var(--accent) 7%, #fff); }
.folio__h { display: grid; gap: .8rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.folio__h h2 { font: 400 1.5rem/1.15 var(--display); margin: .2rem 0; }
.folio__h p { font-size: .8rem; }
.folio__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.folio .tbl { min-width: 600px; }
.tbl caption { text-align: left; padding: .85rem 1rem; font-weight: 600; font-size: .95rem; border-bottom: 1px solid var(--line); }
.tbl th { text-align: left; font: 500 .68rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .65rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td small { color: var(--muted); font-size: .7rem; }
.tbl tfoot td { border-bottom: 0; font-weight: 600; }
.tbl tfoot tr:first-child td { border-top: 2px solid var(--text); }
.tbl tfoot .muted td { font-weight: 400; }
.tbl__due td { font: 400 1.25rem/1.2 var(--display); }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; background: rgb(15 16 10 / .5); animation: toast .2s ease both; }
.modal__card { width: min(820px, 100%); max-height: 92svh; overflow: auto; background: var(--surface); border-radius: 16px; padding: 1.2rem; }
.modal__title { font: 400 1.3rem/1.2 var(--display); margin-bottom: 1rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .4rem; }
.invoice { display: grid; gap: 1rem; }
.invoice__h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--text); }
.invoice__h h2 { font: 400 1.6rem/1 var(--display); margin-bottom: .4rem; }
.invoice__h p, .invoice__to p { font-size: .82rem; }
.invoice__meta { text-align: right; }
.invoice__meta h3 { font: 500 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .4rem; }
.invoice .tbl td, .invoice .tbl th { padding-inline: .5rem; }
.invoice__note { font-size: .75rem; }

/* ------------------------------------------------------- restaurant ---- */
.resto { display: grid; gap: 1rem; }
.tables { list-style: none; margin: 0; padding: .8rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.tbl-btn { width: 100%; display: grid; gap: .1rem; justify-items: start; padding: .65rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; min-height: 78px; }
.tbl-btn b { font-size: 1.05rem; }
.tbl-btn span { font-size: .7rem; color: var(--muted); }
.tbl-btn em { font-style: normal; font-size: .72rem; font-weight: 600; color: var(--muted); }
.tbl-btn.is-busy { background: var(--direct-soft); border-color: transparent; }
.tbl-btn.is-busy em { color: var(--moss); }
.tbl-btn.is-on { box-shadow: 0 0 0 2px var(--moss); }
.order__lines { list-style: none; margin: 0; padding: .3rem 1rem; }
.order__lines li:not(.empty) { display: grid; grid-template-columns: 1fr auto 5rem; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.order__qty { display: inline-flex; align-items: center; gap: .4rem; font-variant-numeric: tabular-nums; }
.order__sum { padding: .6rem 1rem; display: grid; gap: .25rem; }
.order__sum div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.order__total { font: 400 1.3rem/1.3 var(--display); }
.order__actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem 1rem; }
.menu { border-top: 1px solid var(--line); padding: .6rem 1rem 1rem; }
.menu__cat { font: 500 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .7rem 0 .4rem; }
.menu__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem; }
.menu__item { display: flex; justify-content: space-between; gap: .5rem; align-items: center; min-height: 44px; padding: .45rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-size: .82rem; }
.menu__item:hover { border-color: var(--moss); }
.menu__item b { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- reports ---- */
.hbars { list-style: none; margin: 0; padding: .9rem 1rem; display: grid; gap: .7rem; }
.hbar { display: grid; grid-template-columns: 6.5rem 1fr; grid-template-rows: auto auto; gap: .2rem .7rem; align-items: center; }
.hbar__k { font-size: .82rem; grid-row: span 2; }
.hbar__track { height: 14px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.hbar__fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--moss); }
.hbar__fill--ota { background: #b5ae9f; }
.hbar__v { font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar__v small { font-weight: 400; color: var(--muted); margin-left: .4rem; }
.split3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.split3 div { display: grid; gap: .1rem; padding: .8rem 1rem; border-right: 1px solid var(--line); }
.split3 div:last-child { border-right: 0; }
.split3 span { font-size: .72rem; }
.split3 b { font: 400 1.15rem/1.2 var(--display); font-variant-numeric: tabular-nums; }

/* ========================================================== tablet ==== */
@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .board { grid-auto-columns: 46%; }
  .folio__h { grid-template-columns: 1fr auto; align-items: start; }
  .tables { grid-template-columns: repeat(4, 1fr); }
}

/* ========================================================= desktop ==== */
@media (min-width: 1080px) {
  body { font-size: 14px; }
  .shell { display: grid; grid-template-columns: 232px 1fr; }
  .side { height: 100svh; display: flex; flex-direction: column; }
  .side__brand { display: grid; gap: .35rem; padding: 1.4rem 1.25rem 1rem; }
  .side__nav { flex-direction: column; overflow: visible; padding: .5rem .75rem; }
  .side__nav button { justify-content: space-between; border-radius: 10px; min-height: 40px; }
  .side__foot { margin-top: auto; display: grid; gap: .5rem; padding: 1.25rem; font-size: .8rem; }
  .side__foot a, .side__foot button { color: #e9e6dd; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; opacity: .8; }
  .side__foot p { opacity: .45; font-size: .72rem; }
  .main { padding: 1.6rem 2rem 3rem; gap: 1.2rem; }
  .cols { grid-template-columns: 1fr 1fr; }
  .board { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; }
  .billing { grid-template-columns: 270px 1fr; align-items: start; }
  .folios ul { flex-direction: column; overflow: visible; max-height: 70svh; overflow-y: auto; }
  .folio-item { min-width: 0; width: 100%; }
  .resto { grid-template-columns: 1fr 1.2fr; align-items: start; }
  .tables { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1300px) { .tables { grid-template-columns: repeat(4, 1fr); } }

@media print {
  body * { visibility: hidden; }
  #invoice, #invoice * { visibility: visible; }
  #invoice { position: absolute; inset: 0; padding: 12mm; }
  .modal { background: none; }
}
