/* Cashier app — built for a POS screen: dense, fast, readable */
body { background: var(--fog); }
.small { font-size: 13px; }
.form-error { color: var(--red); font-weight: 500; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #2E3366 0%, #1C1F3B 55%, #12142A 100%); }
.login-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.login .login-card { position: relative; z-index: 1; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); border-color: transparent; }
.login-card { width: 100%; max-width: 380px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px; }
.login-card img { border-radius: 14px; margin-bottom: 14px; }
.login-card h1 { font-size: 26px; margin-bottom: 20px; }
.login-alt { margin: 16px 0 6px; font-size: 14px; color: var(--ink-2); }

/* Top bar */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; padding: 0 16px; height: 60px;
  background: var(--ink); color: #fff;
}
.bar-biz { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.bar-biz img { height: 34px; width: 34px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.bar-biz strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.bar-biz select { min-height: 36px; width: auto; max-width: 220px; background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.bar-biz select option { color: var(--ink); }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a {
  position: relative; border: 0; background: none; color: #C9CCE4; font: 600 14.5px var(--font);
  padding: 0 14px; height: 60px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center;
}
.tabs button:hover, .tabs a:hover { color: #fff; }
.tabs [aria-current="page"] { color: #fff; }
.tabs [aria-current="page"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--amber); }
.bar-end { display: flex; align-items: center; gap: 6px; }
.bar .btn-ghost { --fg: #fff; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); margin-inline-end: 4px; }
.live-dot[data-state="live"], .live-dot[data-state="ok"] { background: #3DD68C; box-shadow: 0 0 0 3px rgba(61,214,140,.25); }
.live-dot[data-state="offline"] { background: var(--red); animation: ring-pulse 1s infinite; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--amber); color: var(--ink); font-weight: 700; font-size: 14px; flex: none; }

/* Dropdown menus */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow); padding: 6px; display: grid;
}
.menu-pop p { margin: 6px 10px 8px; font-size: 13px; word-break: break-all; }
.menu-pop button { text-align: start; border: 0; background: none; font: 500 14.5px var(--font); color: var(--ink); padding: 10px 12px; border-radius: var(--r-s); cursor: pointer; }
.menu-pop button:hover { background: var(--fog); }
.menu-pop button.danger { color: var(--red); }

.banner { margin: 0; padding: 10px 16px; font-weight: 500; text-align: center; }
.banner-red { background: var(--red); color: #fff; }
.banner-amber { background: var(--amber-soft); color: #6B4500; border-radius: var(--r-m); text-align: start; }
.page .banner { margin-bottom: 16px; }

/* ---------- Orders ---------- */
.view-orders > * { min-width: 0; }
.view-orders { flex: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; padding: 16px; align-items: start; }
.entry { position: sticky; top: 76px; display: grid; gap: 12px; }
#entryForm { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; }
.entry-label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.entry-display {
  display: flex; align-items: center; gap: 2px; padding: 0 14px; border: 2px solid var(--line); border-radius: var(--r-m);
  background: var(--fog);
}
.entry-display:focus-within { border-color: var(--ink); background: var(--paper); }
.entry-display span { font: 600 26px "Bricolage Grotesque", var(--font); color: var(--ink-3); }
.entry-display input {
  border: 0; background: transparent; box-shadow: none !important; min-height: 64px; padding: 0; min-width: 0; width: 100%;
  font: 800 40px/1 "Bricolage Grotesque", var(--font); letter-spacing: .02em;
}
.entry-display input::placeholder { font: 500 18px var(--font); letter-spacing: 0; color: var(--ink-3); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; direction: ltr; }
.pad button {
  height: 54px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--paper);
  font: 600 22px "Bricolage Grotesque", var(--font); color: var(--ink); cursor: pointer;
}
.pad button:hover { background: var(--fog); }
.pad button:active { background: var(--line); }
.pad button[data-k] { color: var(--ink-2); font-size: 18px; background: var(--fog); }
.entry-check { font-size: 14px; margin: 4px 0 14px; }

.tablet-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); }
.ts-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; }
.ts-dot.is-on { background: var(--amber); animation: ring-pulse 1.2s infinite; }
.tablet-state .btn { margin-inline-start: auto; }

.closed-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 14px; font-size: 14px; }
.closed-box summary { cursor: pointer; font-weight: 600; }
.closed-box ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.closed-box li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--fog); }
.closed-box li b { min-width: 44px; font-size: 17px; }
.closed-box li .btn { margin-inline-start: auto; }

.board { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 0; }
.col-head { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 4px 4px 10px; }
.count { min-width: 28px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 15px; display: inline-grid; place-items: center; }
.col-ready .count { background: var(--green); }
.list { display: grid; gap: 10px; }
.empty { color: var(--ink-3); padding: 24px 16px; text-align: center; border: 2px dashed var(--line); border-radius: var(--r-l); font-size: 14.5px; margin: 0; }

/* A ticket looks like a receipt stub: number on the left, perforation, details */
.ticket {
  position: relative; display: grid; grid-template-columns: 92px 1fr auto; grid-template-rows: auto auto;
  column-gap: 14px; row-gap: 10px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px 14px 12px 0;
}
[dir="rtl"] .ticket { padding: 12px 0 12px 14px; }
.ticket::before {
  content: ""; position: absolute; top: 10px; bottom: 10px; inset-inline-start: 92px;
  border-inline-start: 2px dashed var(--line);
}
.tk-num { grid-row: span 2; text-align: center; font-size: 38px; font-weight: 800; line-height: 1; padding: 0 6px; word-break: break-all; }
.tk-info { min-width: 0; padding-inline-start: 4px; }
.tk-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tk-meta { font-size: 13px; color: var(--ink-2); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.callout { color: var(--red); font-weight: 600; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--fog); color: var(--ink-2); }
.tk-time { font-size: 22px; font-weight: 600; color: var(--ink-2); text-align: end; align-self: start; }
.tk-time.t-amber { color: #B87400; }
.tk-time.t-red { color: var(--red); }
.tk-actions { grid-column: 2 / 4; display: flex; gap: 8px; align-items: center; padding-inline-start: 4px; }
.tk-actions .btn-brand { flex: 1; min-height: 46px; font-size: 16px; }
.tk-actions .btn-sm { min-height: 40px; }
.tk-actions .btn-go { flex: 1; }
.ticket-menu { margin-inline-start: auto; }
.ticket-menu .menu-pop { min-width: 210px; }
.ticket.no-scan { border-color: #F3B7B9; }
.ticket.is-ready { border-color: #A8E2C8; background: #F6FCF9; }
.ticket.is-ready .tk-num { color: #0C7A4E; }
.ticket.is-new { animation: tk-new 1.4s ease; }
/* late (past "Timer turns red after"): the whole card lights up red */
.ticket.is-late { background: #FDECEC; border: 2px solid var(--red); animation: tk-late 2s ease-in-out infinite; }
.ticket.is-late::before { border-color: #F3B7B9; }
.ticket.is-late .tk-num { color: #B4232A; }
.ticket.is-late .tk-time { font-weight: 800; }
@keyframes tk-late { 0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } 50% { box-shadow: 0 0 0 6px rgba(229,72,77,.22); } }
@media (prefers-reduced-motion: reduce) { .ticket.is-late { animation: none; } }
@keyframes tk-new { 0%, 40% { box-shadow: 0 0 0 4px var(--amber); } }

/* ---------- Generic pages ---------- */
.page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; margin: 0; }
.head-actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Reports */
.reports { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head strong { font-size: 17px; min-width: 150px; text-align: center; }
.cal-head .btn:last-child { margin-inline-start: auto; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { font-size: 12px; color: var(--ink-3); text-align: center; padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1.15; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; padding: 4px 6px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  background: color-mix(in srgb, var(--amber) calc(var(--heat) * 55%), var(--paper));
  font: inherit; color: var(--ink);
}
.cal-day:disabled { background: var(--fog); opacity: .5; cursor: default; }
.cal-day.is-today { border-color: var(--ink-2); }
.cal-day.is-sel { outline: 3px solid var(--ink); outline-offset: -1px; }
.cal-d { font-size: 12.5px; color: var(--ink-2); }
.cal-n { font-size: 18px; font-weight: 800; align-self: flex-end; }
.stat-col { display: grid; gap: 16px; align-content: start; }
.stat-block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; }
.stat-block h3 { font-size: 16px; margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 14px; margin: 0; }
.stats div { min-width: 0; }
.stats dt { font-size: 12.5px; color: var(--ink-2); }
.stats dd { margin: 0; font-size: 24px; font-weight: 800; }
.stats.compact dd { font-size: 20px; }
.hours { display: flex; align-items: flex-end; gap: 4px; height: 120px; direction: ltr; }
.hbar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; min-width: 0; }
.hbar i { display: block; width: 100%; background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; }
.hbar span { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.day-list h3 { font-size: 17px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-weight: 600; color: var(--ink-2); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--fog); white-space: nowrap; }
.tbl td.num b { font-size: 16px; }

/* Settings */
.settings .card, .team .card, .reviews-page .card { margin-bottom: 16px; }
.set-sec h2 { font-size: 19px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
.field .lbl { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field.narrow { max-width: 280px; }
.help { margin: 8px 0 16px; max-width: 70ch; }
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.link-item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.link-item h3 { font-size: 15px; margin: 0 0 2px; font-family: var(--font); font-weight: 600; }
.mini-qr { width: 96px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mini-qr svg { display: block; width: 100%; }
.tablet-ico { width: 96px; aspect-ratio: 4/3; border-radius: 10px; background: var(--ink); position: relative; }
.tablet-ico::after { content: ""; position: absolute; inset: 22% 30%; border-radius: 50%; border: 4px dotted var(--amber); }
.link-code { display: block; font-size: 12.5px; background: var(--fog); padding: 6px 8px; border-radius: 6px; margin: 6px 0 8px; word-break: break-all; direction: ltr; text-align: left; }
.color-row { display: flex; align-items: center; gap: 12px; }
.swatch-preview { width: 44px; height: 44px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.logo-row { display: flex; gap: 14px; align-items: center; }
.logo-prev { width: 64px; height: 64px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: #fff; flex: none; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-inputs { display: flex; gap: 10px; align-items: center; flex: 1; flex-wrap: wrap; }
.logo-inputs input { flex: 1; min-width: 200px; }
.plan-line { margin: 4px 0 0; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0 16px; background: linear-gradient(transparent, var(--fog) 30%); display: flex; justify-content: flex-end; }
.set-form .switch { margin-top: 4px; }

/* Team */
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--fog); }
.members li:last-child { border-bottom: 0; }
.members .avatar { width: 36px; height: 36px; }
.members select { width: auto; min-height: 36px; }
.add-staff h2 { font-size: 19px; }

/* Reviews */
.rev-top { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.rev-score { text-align: center; }
.rev-score .big { font-size: 64px; font-weight: 800; line-height: 1; }
.stars-line { color: var(--amber); letter-spacing: 2px; font-size: 18px; }
.rev-score .stats { margin-top: 14px; text-align: start; }
.dist-row { display: grid; grid-template-columns: 40px 1fr 40px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; direction: ltr; }
.dist-bar { height: 10px; background: var(--fog); border-radius: 99px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--amber); }
.rev-list { list-style: none; margin: 0; padding: 0; }
.rev-list li { padding: 12px 0; border-bottom: 1px solid var(--fog); }
.rev-list li:last-child { border-bottom: 0; }
.rev-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rev-list p { margin: 6px 0 0; }

/* Dialog */
.dlg { border: 0; border-radius: var(--r-l); padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); color: var(--ink); }
.dlg::backdrop { background: rgba(28,31,59,.45); }
.dlg h2 { font-size: 19px; font-family: var(--font); font-weight: 600; line-height: 1.35; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .view-orders { grid-template-columns: 270px minmax(0, 1fr); }
  .board { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .bar { height: auto; flex-wrap: wrap; padding: 8px 12px 0; gap: 8px; }
  .bar-biz { flex: 1; }
  .tabs { order: 3; flex-basis: 100%; }
  .tabs button, .tabs a { height: 44px; }
  .view-orders { grid-template-columns: 1fr; padding: 12px; }
  .entry { position: static; }
  .pad button { height: 48px; }
  .reports, .rev-top, .link-grid, .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .members li { grid-template-columns: 36px 1fr; }
  .members li > select, .members li > .chip, .members li > .row-actions { grid-column: 2; justify-self: start; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .ticket { grid-template-columns: 70px 1fr auto; }
  .ticket::before { inset-inline-start: 70px; }
  .tk-num { font-size: 30px; }
}
.grid-2 > *, .grid-4 > * { min-width: 0; }

/* ---------- loyalty tab ---------- */
.loy-page .card { margin-bottom: 16px; }
.loy-page h3 { margin-bottom: 6px; }
.loy-check { display: flex; gap: 10px; margin: 10px 0 6px; max-width: 460px; }
.loy-check input { flex: 1; font-size: 24px; letter-spacing: .12em; text-transform: uppercase; padding: 10px 14px; }
.ly-found { margin-top: 14px; padding: 16px; border: 2px solid var(--blue); border-radius: var(--r-l); max-width: 520px; background: var(--paper); }
.ly-found.is-redeemed:not(.is-done), .ly-found.is-cancelled { border-color: var(--red); }
.ly-found.is-done { border-color: var(--green); background: var(--green-soft); }
.ly-code { font-size: 30px; font-weight: 800; letter-spacing: .1em; margin-bottom: 8px; }
.ly-dl { display: grid; gap: 6px; margin: 0 0 12px; }
.ly-dl div { display: flex; gap: 10px; }
.ly-dl dt { min-width: 92px; color: var(--ink-2); font-size: 13.5px; }
.ly-dl dd { margin: 0; }
.ly-ok { color: var(--green); font-weight: 700; font-size: 18px; }
.ly-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.ly-tools { display: flex; gap: 8px; align-items: center; }
.ly-tools input { min-width: 200px; }
.ly-rewards { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ly-rewards li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); }
.ly-rewards li.is-off .ly-r-main { opacity: .5; }
.ly-r-main { flex: 1; min-width: 180px; }
.ly-r-main p { font-size: 13.5px; color: var(--ink-2); margin: 2px 0; }
.ly-cost { font-weight: 700; color: #6A2BE0; white-space: nowrap; }
.switch.small i { width: 38px; height: 22px; }
.switch.small i::after { width: 16px; height: 16px; }
.switch.small input:checked + i::after { inset-inline-start: 19px; }
.switch.small span { font-size: 13px; color: var(--ink-2); }
.btn.danger { color: var(--red); }
.ly-form { display: grid; grid-template-columns: 1fr 1fr 140px; gap: 10px; align-items: end; width: 100%; padding: 12px; border-radius: var(--r-m); background: var(--fog); margin-bottom: 8px; }
.ly-form .field { margin: 0; }
.ly-form-btns { grid-column: 1 / -1; display: flex; gap: 8px; }
@media (max-width: 700px) { .ly-form { grid-template-columns: 1fr; } .loy-check input { font-size: 20px; } }
.ly-r-main small { display: block; margin-top: 2px; }
