/* Pho N Rolls POS - brand orange #E17616 on black and white, from the logo. */

:root {
  --brand:        #E17616;
  --brand-dark:   #B85D0F;
  --brand-tint:   #FDF1E7;
  --brand-line:   #F3D2B4;
  --ink:          #16130F;
  --ink-2:        #4A423A;
  --ink-3:        #857A6E;
  --paper:        #FFFFFF;
  --paper-2:      #FAF7F4;
  --line:         #E6DFD8;
  --ok:           #1E7A5A;
  --ok-tint:      #E6F4EF;
  --warn:         #B7791F;
  --warn-tint:    #FDF6E3;
  --bad:          #C0392B;
  --bad-tint:     #FCEDEB;
  --radius:       12px;
  --radius-lg:    18px;
  --tap:          52px;
  --shadow:       0 1px 2px rgba(22,19,15,.06), 0 8px 24px rgba(22,19,15,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper-2);
  overscroll-behavior: none;
}

body.app {
  /* dvh, not vh: on a tablet vh hides the last row of buttons under the toolbar */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ------------------------------ top bar ------------------------------ */

.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--brand);
}
.topbar .logo {
  font-weight: 800; letter-spacing: .5px; font-size: 18px;
  display: flex; align-items: center; gap: 8px;
}
.topbar .logo b { color: var(--brand); }
.topbar .spacer { flex: 1 1 auto; }
.topbar .who { font-size: 14px; opacity: .85; }
.topbar a, .topbar button.linkish {
  color: #fff; text-decoration: none; font-size: 14px;
  padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.22);
  background: transparent; cursor: pointer;
}
.topbar a.on, .topbar a:active { background: var(--brand); border-color: var(--brand); }

/* ------------------------------ layout ------------------------------- */

.split {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  min-height: 0;              /* or a long order pushes the totals off-screen */
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .split .orderpane { order: 2; max-height: 45dvh; }
}

.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane > .scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }

.orderpane { background: var(--paper); border-right: 1px solid var(--line); }
.menupane  { background: var(--paper-2); }

/* ---------------------------- order header --------------------------- */

.orderhead {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.orderhead .title { font-size: 20px; font-weight: 800; }
.orderhead .sub { font-size: 13px; color: var(--ink-3); }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--brand-tint);
  color: var(--brand-dark); border: 1px solid var(--brand-line);
}
.pill.ok   { background: var(--ok-tint);   color: var(--ok);   border-color: #BFE3D6; }
.pill.warn { background: var(--warn-tint); color: var(--warn); border-color: #F0DFB0; }
.pill.bad  { background: var(--bad-tint);  color: var(--bad);  border-color: #F3C9C4; }

/* ----------------------------- order lines --------------------------- */

.lines { padding: 6px 0; }
.line {
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start;
  cursor: pointer;
}
.line:active { background: var(--brand-tint); }
.line.sent  { background: #fff; }
.line.unsent { background: #FFFDF8; }
.line.unsent .qty { background: var(--brand); color: #fff; }
.line.void { opacity: .5; }
.line.void .nm { text-decoration: line-through; }
.line.sel { box-shadow: inset 4px 0 0 var(--brand); background: var(--brand-tint); }
.line .qty {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 800; background: var(--paper-2); border: 1px solid var(--line);
}
.line .nm { font-weight: 650; line-height: 1.3; }
.line .price { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.line .mods { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.line .mods span { display: block; }
.line .note {
  margin-top: 5px; font-size: 13px; font-weight: 700; color: #7A3D00;
  background: #FFF3E2; border: 1px solid var(--brand-line);
  padding: 4px 8px; border-radius: 7px; display: inline-block;
}
.line .flags { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }

.empty { padding: 42px 20px; text-align: center; color: var(--ink-3); }

/* ------------------------------ totals ------------------------------- */

.totals { flex: 0 0 auto; border-top: 2px solid var(--ink); background: var(--paper); padding: 10px 14px 6px; }
.totals .row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; color: var(--ink-2); }
.totals .row.big { font-size: 24px; font-weight: 800; color: var(--ink); padding: 6px 0; }
.totals .row .v { font-variant-numeric: tabular-nums; }

.actions { flex: 0 0 auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; gap: 8px; grid-template-columns: 1fr 1fr; background: var(--paper); }
.actions .wide { grid-column: 1 / -1; }

/* ------------------------------ buttons ------------------------------ */

.btn {
  min-height: var(--tap); padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink);
  font-size: 16px; font-weight: 700; font-family: var(--font);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .04s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.dark    { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ok      { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger  { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost   { background: transparent; }
.btn.sm      { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.btn.xl      { min-height: 64px; font-size: 19px; }

/* --------------------------- menu / catalogue ------------------------ */

.cats {
  flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px;
  overflow-x: auto; background: var(--paper); border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; min-height: 44px; padding: 10px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); font-weight: 700;
  font-size: 15px; cursor: pointer; white-space: nowrap; font-family: var(--font);
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center;
}
a.cat:visited { color: var(--ink); }
a.cat.on, a.cat.on:visited { color: #fff; }
.cat.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.searchbar { flex: 0 0 auto; padding: 8px 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.searchbar input {
  width: 100%; min-height: 46px; padding: 10px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius); font-family: var(--font);
  background: var(--paper-2);
}
.searchbar input:focus { outline: none; border-color: var(--brand); background: #fff; }

.grid {
  display: grid; gap: 10px; padding: 12px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.tile {
  min-height: 92px; padding: 12px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--paper); cursor: pointer; font-family: var(--font);
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow);
}
.tile:active { border-color: var(--brand); background: var(--brand-tint); }
.tile .no { font-size: 11px; font-weight: 800; color: var(--brand); letter-spacing: .4px; }
.tile .nm { font-size: 15px; font-weight: 700; line-height: 1.25; flex: 1 1 auto; }
.tile .pr { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .veg { font-size: 11px; color: var(--ok); font-weight: 700; }
.grouphead { grid-column: 1 / -1; font-size: 13px; font-weight: 800; color: var(--ink-3);
             text-transform: uppercase; letter-spacing: .6px; padding: 10px 2px 0; }

/* ------------------------------- sheet ------------------------------- */

.sheet-back {
  position: fixed; inset: 0; background: rgba(22,19,15,.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
.sheet {
  background: var(--paper); width: min(620px, 100%);
  max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.25);
}
@media (min-width: 700px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: var(--radius-lg); max-height: 88dvh; }
}
.sheet header {
  flex: 0 0 auto; padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px;
}
.sheet header h2 { margin: 0; font-size: 19px; line-height: 1.25; }
.sheet header .pr { margin-left: auto; font-weight: 800; font-size: 19px; white-space: nowrap; }
.sheet .body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 4px 16px 12px; }
.sheet footer {
  flex: 0 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: grid; gap: 10px;
  grid-template-columns: auto 1fr; align-items: center;
}

.grp { margin: 14px 0 6px; }
.grp h3 {
  margin: 0 0 8px; font-size: 14px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--ink-3);
}
.grp h3 em { font-style: normal; color: var(--brand); font-weight: 700; text-transform: none; letter-spacing: 0; }
.opt {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px;
  margin-bottom: 7px; background: var(--paper);
}
.opt.on { border-color: var(--brand); background: var(--brand-tint); }
.opt .nm { font-weight: 650; font-size: 15px; }
.opt .dl { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt .dl.plus { color: var(--brand-dark); font-weight: 700; }

.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 42px; height: 42px; border-radius: 9px; border: 1.5px solid var(--line);
  background: var(--paper); font-size: 22px; font-weight: 700; line-height: 1;
  cursor: pointer; color: var(--ink); font-family: var(--font);
}
.stepper button:active { background: var(--brand); color: #fff; border-color: var(--brand); }
.stepper button:disabled { opacity: .3; }
.stepper .n {
  min-width: 34px; text-align: center; font-weight: 800; font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.stepper .n.zero { color: var(--ink-3); font-weight: 500; }

.pickone { display: grid; gap: 7px; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
.pickone .opt { grid-template-columns: 1fr auto; }
.opt.toggle { cursor: pointer; }
.opt.toggle .nm::before {
  content: ''; display: inline-block; width: 17px; height: 17px; margin-right: 9px;
  border: 2px solid var(--line); border-radius: 5px; vertical-align: -3px;
}
.opt.toggle.on .nm::before {
  background: var(--brand); border-color: var(--brand);
  box-shadow: inset 0 0 0 3px #fff;
}

.notebox { margin-top: 16px; }
.notebox label { display: block; font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.notebox textarea {
  width: 100%; min-height: 72px; padding: 10px 12px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--font);
  resize: vertical; background: var(--paper-2);
}
.notebox textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--paper); font-size: 13px; font-weight: 650; cursor: pointer;
  font-family: var(--font);
}
.chip:active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ----------------------------- floor plan ---------------------------- */

.floor { position: relative; flex: 1 1 auto; min-height: 0; margin: 12px; }
.floorarea {
  position: relative; width: 100%; height: 100%;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 100%,
    var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.tbl {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 96px; min-height: 84px; padding: 8px;
  border-radius: 12px; border: 2.5px solid var(--line); background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; font-family: var(--font); box-shadow: var(--shadow); gap: 2px;
}
.tbl.round { border-radius: 50%; }
.tbl.long  { min-width: 140px; }
.tbl .n  { font-size: 22px; font-weight: 800; }
.tbl .s  { font-size: 11px; color: var(--ink-3); }
.tbl .t  { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl.free     { border-color: var(--line); }
.tbl.seated   { border-color: var(--warn); background: var(--warn-tint); }
.tbl.ordering { border-color: var(--brand); background: var(--brand-tint); }
.tbl.away     { border-color: var(--ok); background: var(--ok-tint); }
.tbl.drag { opacity: .7; z-index: 5; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 0 14px 10px; font-size: 13px; color: var(--ink-2); }
.legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; margin-right: 5px; border: 2px solid; vertical-align: -2px; }

/* ------------------------------ misc UI ------------------------------ */

.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
              display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 650; box-shadow: var(--shadow); max-width: 90vw;
}
.toast.bad  { background: var(--bad); }
.toast.ok   { background: var(--ok); }
.toast.warn { background: var(--warn); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 17px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

input[type=text], input[type=number], input[type=password], select, textarea {
  font-family: var(--font); font-size: 16px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 9px; background: var(--paper);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
label.fld { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 650; }
label.fld input, label.fld select, label.fld textarea { display: block; width: 100%; margin-top: 5px; font-weight: 400; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 18px; }
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
pre.paper {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.45;
  white-space: pre-wrap; overflow-x: auto;
}

/* ------------------------------ sign in ------------------------------ */

.signin { min-height: 100dvh; display: grid; place-items: center; padding: 20px;
          background: var(--ink); }
.signin .box { background: var(--paper); border-radius: var(--radius-lg); padding: 28px;
               width: min(380px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.signin h1 { margin: 0 0 4px; font-size: 26px; text-align: center; }
.signin h1 b { color: var(--brand); }
.signin .tag { text-align: center; color: var(--ink-3); font-size: 13px; margin-bottom: 20px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.pinpad button { min-height: 60px; font-size: 22px; font-weight: 700; border-radius: 12px;
                 border: 1.5px solid var(--line); background: var(--paper-2); cursor: pointer;
                 font-family: var(--font); }
.pinpad button:active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pindots { display: flex; gap: 12px; justify-content: center; margin: 16px 0 4px; }
.pindots i { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line); }
.pindots i.on { background: var(--brand); border-color: var(--brand); }

/* Bigger touch targets on a tablet, where there is no cursor to aim with. */
@media (pointer: coarse) {
  :root { --tap: 58px; }
  .btn { font-size: 17px; }
  .tile { min-height: 104px; }
  .line { padding: 13px 14px; }
  .stepper button { width: 48px; height: 48px; }
}

@media print { .noprint { display: none !important; } }
