/* GOTHA reservations – look and feel.
   Layout idea: dark bar on top, the floor plan takes the room, a working panel on the right.
   One light theme on purpose: the floor plan drawing is light grey. */
:root {
  color-scheme: light;
  --ink: #1d2422;        /* text, top bar */
  --paper: #f3f4f1;      /* page */
  --card: #ffffff;
  --line: #d9dcd6;
  --muted: #5f6964;
  --brass: #9a742c;      /* accent: brand, primary buttons */
  --brass-ink: #ffffff;
  /* status colours (meaning, not decoration) */
  --free: #2e7d5b; --booked: #c27a00; --due: #7a4fa3; --confirmed: #2f6fb5; --seated: #b3372f; --closed: #7b827e;
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --display: "Marcellus", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 var(--font); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 20px; } h2 { font-size: 15px; margin-bottom: 10px; } h3 { font-size: 14px; margin: 14px 0 6px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.n { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.demo { margin: 0; padding: 6px 16px; background: #efe6d2; font-size: 13px; }

/* buttons and inputs: big enough for fingers */
.btn { font: 600 14px var(--font); min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn.danger { color: var(--seated); }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; font-size: 18px; }
.btn.on { border-color: var(--brass); color: var(--brass); }
input, select, textarea { font: 15px var(--font); min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%; }
input[type=checkbox] { min-height: 0; width: 20px; height: 20px; vertical-align: -4px; }
input.short { width: 110px; }
textarea { width: 100%; font-size: 14px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

/* top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 8px 16px; background: var(--ink); color: #fff; }
.brand { font: 24px var(--display); letter-spacing: .18em; color: #e3c98f; }
.brand.big { font-size: 44px; color: var(--brass); }
.top nav, .datebar, .quick, .who, .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tab { font: 600 14px var(--font); min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #c9cfcb; cursor: pointer; }
.tab.on { background: #fff; color: var(--ink); }
.who { margin-left: auto; font-size: 13px; }
.top .btn:not(.primary) { background: transparent; color: #fff; border-color: #56605b; }
.top .btn.on { color: #e3c98f; border-color: #e3c98f; }
.top input { min-height: 40px; }

/* views */
.view { padding: 14px 16px 30px; }
.view-plan { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .view-plan { grid-template-columns: 1fr; } }
.planwrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
#plan { display: block; height: auto; margin: 0 auto; overflow: hidden; touch-action: manipulation; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 6px 2px; font-size: 13px; }
.key i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; border: 2px solid; }
.side { display: grid; gap: 12px; }
.hint { margin: 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.bar h1 { margin-right: auto; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--muted); font-size: 13px; }
.tile b { display: block; font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12px; color: var(--muted); }
.stats b { display: block; font-size: 22px; color: var(--ink); }

/* tables on the plan: colour + fill strength say the status */
.atom { cursor: pointer; }
.atom rect, .atom ellipse { stroke-width: 2.5; fill-opacity: .14; stroke: var(--c); fill: var(--c); }
.atom text { font: 700 11.5px var(--font); text-anchor: middle; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.atom.tiny text { font-size: 9.5px; }
.atom.sel rect, .atom.sel ellipse { stroke: var(--ink); stroke-width: 4; }
.st-free { --c: var(--free); } .st-booked { --c: var(--booked); } .st-due { --c: var(--due); }
.st-confirmed { --c: var(--confirmed); } .st-seated { --c: var(--seated); }
.st-finished, .st-cancelled, .st-no_show { --c: var(--closed); }
.atom.st-booked rect, .atom.st-booked ellipse, .atom.st-due rect, .atom.st-due ellipse,
.atom.st-confirmed rect, .atom.st-confirmed ellipse { fill-opacity: .5; }
.atom.st-seated rect, .atom.st-seated ellipse { fill-opacity: .8; }
.key i { border-color: var(--c); background: color-mix(in srgb, var(--c) 45%, transparent); }
.key.st-free i { background: color-mix(in srgb, var(--c) 14%, transparent); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap;
  color: var(--c); border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }
.badge.vip { --c: var(--brass); }

/* side panel rows */
.unit { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.unit:first-of-type { border-top: 0; }
.unit.busy { opacity: .6; }
.resrow { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 8px 4px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; }
.resrow:hover { background: var(--paper); }
.resrow .t { font-weight: 700; font-variant-numeric: tabular-nums; }

/* data tables */
.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th.n { text-align: right; }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tbody tr[data-act] { cursor: pointer; }
.grid tbody tr[data-act]:hover { background: var(--paper); }
.mini { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.mini td { padding: 6px 2px; border-bottom: 1px solid var(--line); }
.mini tr.off { opacity: .5; }

/* dialogs */
.overlay { position: fixed; inset: 0; background: rgba(20, 26, 24, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; z-index: 10; }
.dialog { background: var(--card); border-radius: 12px; padding: 20px; width: min(640px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dialog h2 { font-size: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.field { display: grid; gap: 4px; margin-bottom: 6px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input:not([type=checkbox]), .field select { width: 100%; }
.stepper { display: flex; gap: 6px; } .stepper input { width: 80px; text-align: center; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 6px 0 12px; }
legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.sub { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.chip { font: 14px var(--font); min-height: 36px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
button.chip:hover { border-color: var(--brass); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; cursor: default; }
.chip.on button { border: 0; background: none; color: #fff; font-size: 18px; cursor: pointer; padding: 0 2px; }
.chips.big .chip { min-height: 44px; }
.warn, .note { padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.warn { background: #fbe9e7; color: #8c2620; } .note { background: #f1ecde; }
.foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.foot .btn:last-child { margin-left: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 12px 0; }
.facts dt { color: var(--muted); font-size: 13px; } .facts dd { margin: 0; }
.log { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; display: grid; gap: 5px; }
summary { cursor: pointer; font-size: 13px; color: var(--muted); }

/* login */
.login { max-width: 460px; margin: 8vh auto; padding: 0 16px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.userlist { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pinrow { display: flex; gap: 8px; align-items: center; } .pinrow input { width: 130px; text-align: center; letter-spacing: .3em; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  max-width: min(560px, 92vw); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.toast.show { opacity: 1; } .toast.bad { background: #8c2620; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
@media print { .top, .demo, .side, .bar input, .bar select, .bar .btn { display: none; } body { background: #fff; } }

/* guest name tags on the plan */
.tag { cursor: pointer; }
.tag rect { fill: #fff; stroke: var(--c); stroke-width: 2; }
.tag text { font: 700 13px var(--font); text-anchor: middle; fill: var(--ink); pointer-events: none; }
.tag.st-seated rect { fill: var(--c); } .tag.st-seated text { fill: #fff; }
.legend .names { margin-left: auto; }

/* receipt amount */
.bill > label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 14px; }
.bigmoney { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; }
.bigmoney input { font: 700 40px var(--font); width: 260px; min-height: 68px; text-align: right; border-width: 2px; border-color: var(--brass); font-variant-numeric: tabular-nums; }
.bigmoney span { font: 700 22px var(--font); color: var(--muted); }
.amount { font-size: 17px; }
.tile.gold { border-color: var(--brass); } .tile.gold b { color: var(--brass); }
.dialog .tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: 12px 0 4px; } .dialog .tile b { font-size: 18px; }
.mini tr.link { cursor: pointer; } .mini tr.link:hover { background: var(--paper); }

/* zooming the plan: the picture grows inside a box you can drag/scroll */
.planscroll { overflow: auto; max-height: calc(100vh - 215px); -webkit-overflow-scrolling: touch; }
.zoom { display: inline-flex; align-items: center; gap: 8px; } .zoom b { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.btn:disabled { opacity: .4; cursor: default; }
.legend .names { margin-left: 0; } .legend .zoom { margin-left: auto; }

.copyrow { display: flex; gap: 8px; } .copyrow input { flex: 1; min-width: 0; font-weight: 700; }
.card { min-width: 0; overflow-wrap: anywhere; }

/* clients */
.gno { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brass); white-space: nowrap; }
.badge.tag-business { --c: var(--confirmed); } .badge.tag-family { --c: var(--free); } .badge.tag-influencer { --c: var(--due); } .badge.tag-blocked { --c: var(--seated); }
.grid tr.blocked td { background: #fbe9e7; }
.bdays { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--brass); border-radius: 10px; }
.bdays b { margin-right: 6px; }
.visit { margin-bottom: 12px; } .visit .row { margin-bottom: 8px; }
.row.nowrap { flex-wrap: nowrap; } .row.nowrap > * { flex: 1; min-width: 0; }
.tagpick { margin: 4px 0 6px; } .tagpick .chip { cursor: pointer; } .tagpick .chip.locked { opacity: .55; cursor: not-allowed; }
.tagpick .chip:has(input:checked) { border-color: var(--ink); background: #fff; font-weight: 700; }
.likes { margin-top: 4px; padding: 4px 8px; border-left: 3px solid var(--booked); background: #fdf4e3; font-size: 13px; }
.bd { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--due); }
.log li.link { cursor: pointer; } .log li.link:hover { background: var(--paper); }
/* booking form: suggestions and the chosen client */
.regulars .chips { margin-bottom: 4px; } .regulars .sub { margin-top: 0; }
.sugg { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; margin-bottom: 10px; }
.sugg .sub { margin: 2px 0 4px; }
.suggrow { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 8px 6px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; min-height: 44px; }
.suggrow:first-of-type { border-top: 0; } .suggrow:hover { background: var(--paper); }
.gcard { border: 1.5px solid var(--brass); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 4px; background: #fffdf8; }
.gcard .gtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gcard .gtop .btn { width: 34px; padding: 0; font-size: 18px; }
.gcard.blocked { border-color: var(--seated); background: #fbe9e7; }
.gcard .warn { margin: 4px 0 0; }
/* QR card and scanner */
.qrcard { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px; border-radius: 14px; background: var(--ink); color: #fff; margin: 6px 0 10px; }
.qrcard img { background: #fff; border-radius: 8px; image-rendering: pixelated; flex: none; }
.qrcard .qrname { font-size: 22px; font-weight: 700; margin-top: 18px; } .qrcard .qrno { font-size: 26px; font-weight: 700; color: #e3c98f; }
.qrcard .muted { color: #c9cfcb; }
.scanbox { background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; display: grid; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; }
@media print {
  body.printcard #app, body.printcard .toast, body.printcard .dialog > :not(#qrcard) { display: none !important; }
  body.printcard .overlay { position: static; background: none; padding: 0; } body.printcard .dialog { box-shadow: none; padding: 0; }
  body.printcard .qrcard { width: 85.6mm; height: 54mm; padding: 4mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printcard .qrcard img { width: 34mm; height: 34mm; } body.printcard .qrcard .brand { font-size: 16px; }
  body.printcard .qrcard .qrname { font-size: 12px; margin-top: 6px; } body.printcard .qrcard .qrno { font-size: 14px; } body.printcard .qrcard .muted { font-size: 7px; }
}
#gsearch { flex: 1 1 260px; min-width: 220px; }
/* roles and test copy */
.testlabel { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: #c62828; color: #fff; font: 700 13px/1.4 Manrope, sans-serif; letter-spacing: .08em; vertical-align: middle; }
.readonly .atom { cursor: default; }
.readonly .resrow { cursor: default; }
ul.roles { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.card.users { grid-column: span 2; } .card.users td { white-space: nowrap; } .card.users td .btn { margin-left: 4px; }
@media (max-width: 900px) { .card.users { grid-column: auto; } .card.users td { white-space: normal; } }
