/* =========================================================================
   Brewery Ghost Kitchen POS — shared styles
   Designed for cheap 11–12" Android tablets: big touch targets, high
   contrast, no tiny text. Mobile-first but scales up to tablet/desktop.
   ========================================================================= */

:root {
  --bg:        #0f141b;
  --surface:   #18212e;
  --surface-2: #222e3d;
  --line:      #2c3a4d;
  --text:      #eef2f6;
  --muted:     #93a3b5;
  /* --amber is the brand accent (now teal). Name kept to avoid churn. */
  --amber:     #22c5b8;
  --amber-dk:  #17a99d;
  --on-accent: #04231f;   /* dark text on the teal accent */
  --green:     #16a34a;
  --green-dk:  #15803d;
  --red:       #e0524e;
  --blue:      #4a90d9;
  --radius:    14px;
  --shadow:    0 6px 20px rgba(0,0,0,.4);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }

button, input, select { font-family: inherit; font-size: 1rem; }

/* ---- App shell -------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  box-shadow: var(--shadow);
}
.app-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.app-header .brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); }
.app-header .sub { color: var(--muted); font-size: .9rem; font-weight: 500; }

.container { max-width: 720px; margin: 0 auto; padding: 18px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 18px; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius);
  padding: 16px 22px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform .05s ease, filter .15s ease;
  min-height: 56px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--amber); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-green { background: var(--green); }
.btn-blue  { background: var(--blue); }
.btn-red   { background: var(--red); }
.btn-ghost { background: transparent; border: 2px solid var(--line); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 14px; font-size: .95rem; min-height: 44px; }

/* ---- Forms ------------------------------------------------------------ */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 600; }
.input, select.input {
  width: 100%;
  padding: 16px;
  font-size: 1.15rem;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}
.input:focus { outline: none; border-color: var(--amber); }

/* ---- Cards ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }

/* ---- Utility ---------------------------------------------------------- */
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.price { font-variant-numeric: tabular-nums; }
.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.pill-new { background: var(--amber); color: var(--on-accent); }
.pill-fulfilled { background: var(--green); color: #fff; }
.pill-cleared { background: var(--line); color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text); padding: 14px 22px;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); z-index: 100; max-width: 90vw;
}
.toast.err { border-color: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 1.2rem; }

/* =========================================================================
   Customer ordering
   ========================================================================= */
.menu-category { margin-top: 26px; }
.menu-category h2 {
  position: sticky; top: 64px; background: var(--bg);
  padding: 8px 0; border-bottom: 2px solid var(--amber); color: var(--amber);
}
.menu-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 16px; margin-top: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.menu-item .info { flex: 1; }
.menu-item .name { font-weight: 700; font-size: 1.1rem; }
.menu-item .desc { color: var(--muted); font-size: .95rem; margin-top: 2px; }
.menu-item .price { font-weight: 700; color: var(--amber); white-space: nowrap; }

.qty { display: flex; align-items: center; gap: 8px; }
.qty button {
  width: 46px; height: 46px; border-radius: 12px; border: none;
  background: var(--surface-2); color: var(--text); font-size: 1.5rem; font-weight: 700; cursor: pointer;
}
.qty button.add { background: var(--amber); color: var(--on-accent); }
.qty .count { min-width: 28px; text-align: center; font-weight: 700; font-size: 1.2rem; }

.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 2px solid var(--line);
  padding: 14px 18px; box-shadow: 0 -6px 20px rgba(0,0,0,.4);
}
.cart-bar .container { padding: 0; }

.cart-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .desc { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.4rem; font-weight: 800; margin-top: 14px; }

textarea.input { resize: vertical; min-height: 70px; font-size: 1.05rem; }

/* ---- Customizer modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-overlay .modal { width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; }
.option-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin-top: 8px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 1.1rem;
}
.option-row input[type="checkbox"] { width: 26px; height: 26px; accent-color: var(--amber); }

/* ---- Special requests callout on display cards ---- */
.note {
  margin: 8px 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(34,197,184,.14); border: 1px solid var(--amber);
  font-size: 1.05rem; line-height: 1.35;
}
.note b { color: var(--amber); }
.order-items .mods { display: block; color: var(--amber); font-size: .9rem; font-weight: 600; margin-top: 2px; }

/* Payment status banner on kitchen / pickup cards */
.pay-banner {
  margin: 10px 0; padding: 12px 14px; border-radius: 10px;
  text-align: center; font-weight: 900; letter-spacing: .02em; line-height: 1.25;
}
.pay-banner.unpaid {
  background: var(--red); color: #fff;
  font-size: 1.25rem; text-transform: uppercase;
  box-shadow: 0 0 0 2px rgba(217,83,79,.35);
}
.pay-banner.unpaid .amt { display: block; font-size: 1.6rem; margin-top: 2px; }
.pay-banner.paid {
  background: rgba(63,164,91,.18); color: var(--green);
  border: 1px solid var(--green); font-size: 1rem; text-transform: uppercase;
}

/* Cook time clock bar */
.clockbar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
}
.clockbar.clocked-in { background: rgba(63,164,91,.16); border-bottom-color: var(--green); }
#clockStatus.in { color: var(--green); font-weight: 700; }
#clockStatus.out { color: var(--muted); }

/* =========================================================================
   Kitchen / Pickup display grids
   ========================================================================= */
.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 8px solid var(--amber);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.order-card.fulfilled { border-left-color: var(--green); }
.order-card.stale { border-left-color: var(--red); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(217,83,79,.4), var(--shadow); } }

.order-card .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.order-card .table-no { font-size: 2rem; font-weight: 900; line-height: 1; }
.order-card .table-no small { font-size: .8rem; color: var(--muted); font-weight: 600; display: block; }
.order-card .timer { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.order-card .timer.warn { color: var(--amber); }
.order-card .timer.danger { color: var(--red); }

.order-items { list-style: none; margin: 0; padding: 0; flex: 1; }
.order-items li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
.order-items .q { font-weight: 800; color: var(--amber); margin-right: 8px; }
.order-card .order-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.25rem; padding: 12px 0; }
.order-card .btn { margin-top: 6px; }

/* =========================================================================
   Manager
   ========================================================================= */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 12px 18px; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--surface); color: var(--muted); font-weight: 700; cursor: pointer;
}
.tab.active { background: var(--amber); color: var(--on-accent); border-color: var(--amber); }

table.report { width: 100%; border-collapse: collapse; }
table.report th, table.report td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
table.report th { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
table.report td.num, table.report th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.report tr.grand td { font-size: 1.4rem; font-weight: 900; border-top: 2px solid var(--amber); color: var(--amber); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filter-bar .field { margin: 0; }

.login-wrap { max-width: 380px; margin: 12vh auto; }
