/* TempleOS shared styles — staff portal, POS and public site. */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #2b2118;
  --muted: #6f6254;
  --line: #e7ded2;
  --accent: #8a1c1c;        /* kumkum maroon */
  --accent-ink: #ffffff;
  --accent-soft: #f7e7e3;
  --saffron: #e07b00;
  --ok: #1f7a3f;
  --warn: #9a6500;
  --danger: #b3261e;
  --radius: 8px;
  --focus: 0 0 0 3px rgba(224, 123, 0, .45);
  font-family: "Noto Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f; --surface: #221c16; --ink: #f1e9df; --muted: #b3a494; --line: #3a3027;
    --accent: #d0584d; --accent-soft: #3a211d; --saffron: #f0a340;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: var(--accent); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* layout */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--accent); color: var(--accent-ink); flex-wrap: wrap; }
.topbar a { color: var(--accent-ink); text-decoration: none; }
.topbar .brand { font-weight: 700; font-size: 1.1rem; margin-right: auto; }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar nav a { opacity: .9; padding: 4px 2px; }
.topbar nav a[aria-current="page"] { opacity: 1; border-bottom: 2px solid var(--saffron); }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 1.4rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 20px 0 10px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile { display: block; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); }
.tile strong { display: block; font-size: 1.05rem; margin-bottom: 4px; color: var(--accent); }
.stat { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* forms & buttons */
label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: .92rem; }
input, select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--saffron); box-shadow: var(--focus); outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn.secondary { background: var(--surface); color: var(--accent); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; background: var(--accent-soft); }
.messages .error { background: #fde8e6; color: var(--danger); }
.messages .success { background: #e5f4ea; color: var(--ok); }
.errorlist { color: var(--danger); margin: 4px 0; padding-left: 18px; font-size: .9rem; }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; background: var(--bg); }
tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: #e5f4ea; color: var(--ok); }
.pill.bad { background: #fde8e6; color: var(--danger); }

/* POS */
.pos { display: grid; grid-template-columns: 1fr 420px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; cursor: pointer; font: inherit; color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.items { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.item { min-height: 76px; padding: 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.item:hover { border-color: var(--accent); }
.item .price { display: block; color: var(--accent); font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.item .local { display: block; font-size: .85rem; color: var(--muted); }
.cart-line { border-bottom: 1px dashed var(--line); padding: 8px 0; }
.cart-line .head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.cart-line .extra { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.cart-line .extra input, .cart-line .extra select { padding: 6px; font-size: .9rem; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.total { display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: 700; margin: 12px 0; font-variant-numeric: tabular-nums; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.modes label { margin: 0; }
.modes input { position: absolute; opacity: 0; width: 1px; }
.modes span { display: block; text-align: center; padding: 10px 4px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-weight: 600; }
.modes input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.modes input:focus-visible + span { box-shadow: var(--focus); }

/* thermal receipt (80mm) */
.receipt { width: 76mm; margin: 0 auto; font-family: "Noto Sans", monospace; font-size: 12px; color: #000; background: #fff; padding: 4mm; }
.receipt h2 { text-align: center; margin: 0; font-size: 15px; }
.receipt .center { text-align: center; }
.receipt table { background: none; }
.receipt th, .receipt td { padding: 2px 0; border: 0; font-size: 12px; color: #000; background: none; }
.receipt hr { border: 0; border-top: 1px dashed #000; }
.no-print { margin: 16px auto; text-align: center; }
@media print {
  @page { margin: 0; }
  body { background: #fff; }
  .no-print, .topbar { display: none !important; }
  main { padding: 0; }
}

/* staff sign-in: photo beside the form; the photo drops out on phones */
.auth main { max-width: none; padding: 0; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: calc(100vh - 52px); }
.auth-photo { background: linear-gradient(180deg, rgba(40, 12, 8, .15), rgba(40, 12, 8, .75)), url("../img/site/hero-gopuram.9c6995be49a8.jpg") center / cover;
  display: flex; align-items: flex-end; padding: 32px; color: #fff; }
.auth-photo p { margin: 0; font-size: 1.4rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.auth-card { align-self: center; justify-self: center; width: min(380px, 100% - 32px); margin: 32px 16px; }
@media (max-width: 760px) { .auth-wrap { grid-template-columns: 1fr; } .auth-photo { min-height: 160px; } }

/* dashboard welcome band */
.dash-hero { margin: -20px -20px 20px; padding: 28px 20px; color: #fff;
  background: linear-gradient(90deg, rgba(60, 14, 10, .92) 0%, rgba(60, 14, 10, .55) 60%, rgba(60, 14, 10, .2)), url("../img/site/temple-lamps.820c156fa8de.jpg") center 40% / cover; }
.dash-hero h1 { margin: 0; }
.dash-hero p { margin: 4px 0 0; opacity: .9; }
