/* One stylesheet for every page. Colours are set once here as variables. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #6b7076;
  --border: #e2ded6;
  --accent: #a52218;      /* the red of the Steff's Creation logo */
  --gold: #e9c98f;        /* the cream-gold of the logo */
  --brand-dark: #7d1810;
  --ok: #1d7a46;
  --warn: #9a6400;
  --danger: #b42318;
  --ok-bg: #e3f4ea;
  --warn-bg: #fff3d6;
  --danger-bg: #fde7e5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a; --surface: #222326; --text: #ececec; --muted: #9a9ea4; --border: #34363a;
    --accent: #e8735f; --brand-dark: #4a0f0a; --ok: #5ccf8b; --warn: #f0b84a; --danger: #ff7a6e;
    --ok-bg: #173523; --warn-bg: #3a2e12; --danger-bg: #3d1a17;
  }
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
main.wide { max-width: 1400px; }
h1 { margin: 8px 0 12px; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
a { color: var(--accent); }

nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
nav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
nav a.active { background: var(--accent); color: #fff; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.sticky { position: sticky; top: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } .sticky { position: static; } }
.row { display: flex; gap: 8px; align-items: end; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }

label { display: block; margin: 8px 0; font-size: .9rem; color: var(--muted); }
label.inline { display: flex; gap: 8px; align-items: center; color: var(--text); }
input, select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; flex: none; }
.small-input { display: inline-block; width: 90px; margin: 0; }

button { font: inherit; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.big { width: 100%; padding: 12px; font-size: 1.05rem; margin-top: 8px; }
button.plain { background: transparent; color: var(--text); border-color: var(--border); }
button.ok { background: var(--ok); border-color: var(--ok); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--bg); }
.badge.ok, .badge.s-ready { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .badge.s-awaiting_payment { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.s-preparing { background: var(--warn-bg); color: var(--warn); }

/* Home page */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hub a { display: block; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.hub a:hover { border-color: var(--accent); }
.hub b { display: block; font-size: 1.15rem; color: var(--accent); }
.hub span { color: var(--muted); font-size: .9rem; }

/* Menu picker */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.menu-item { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.menu-item-body { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px; flex: 1; }
.dish-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); }
.dish-photo.placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 700; color: var(--border); }
.menu-grid:has(.with-photo) { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.photo-box { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.photo-box img, .photo-box .dish-photo { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; }
.menu-item.soldout { opacity: .55; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 36px; height: 36px; padding: 0; font-size: 1.2rem; }
.qty span { min-width: 1.2em; text-align: center; font-weight: 600; }

.lines { list-style: none; padding: 0; margin: 0; }
.lines li, .total { display: flex; justify-content: space-between; padding: 4px 0; }
.total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
table.list th, table.list td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
table.list tbody tr[data-id] { cursor: pointer; }
table.list tr.selected { background: var(--warn-bg); }
table.list tr.low td:first-child { box-shadow: inset 4px 0 var(--warn); }
@media (max-width: 700px) { table.list { display: block; overflow-x: auto; } }

.recipe-row { display: grid; grid-template-columns: 1fr 90px 40px; gap: 6px; margin-bottom: 6px; }
.recipe-row input, .recipe-row select { margin: 0; }
.recipe-row button { padding: 0; }

/* Payment panel */
.tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--text); border-color: var(--border); }
.tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
img.qr { display: block; margin: 10px auto; width: 240px; height: 240px; background: #fff; padding: 8px; border-radius: 8px; }

/* Order progress for online customers */
.progress { list-style: none; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.progress li { flex: 1; min-width: 90px; text-align: center; padding: 8px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.progress li.done { background: var(--ok-bg); color: var(--ok); font-weight: 600; }

/* Kitchen board */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 800px) { .board { grid-template-columns: 1fr; } }
.board section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-height: 200px; }
.ticket { border: 1px solid var(--border); border-left: 6px solid var(--accent); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: var(--bg); }
.ticket.online { border-left-color: #2f6fb5; }
.ticket header { display: flex; justify-content: space-between; gap: 8px; }
.ticket ul { margin: 8px 0; padding-left: 18px; font-size: 1.05rem; }
.ticket .note { margin: 6px 0; padding: 6px 8px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; }
.ticket footer { display: flex; gap: 6px; }

.flash { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 8px; color: #fff; background: #1d7a46; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.flash.danger { background: #b42318; }

/* ---- Version 2: logins, finance, costing ---- */
nav .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); padding: 2px 10px 2px 0; }
nav .brand img { width: 32px; height: 32px; border-radius: 6px; }
nav .who { margin-left: auto; padding: 6px 0; color: var(--muted); font-size: .9rem; }
nav .who a { padding: 0 0 0 8px; color: var(--accent); }
.takings { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 12px 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.4rem; font-weight: 700; margin-top: 2px; }
.stat .value.pos { color: var(--ok); }
.stat .value.neg { color: var(--danger); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td.num, table.list th.num { text-align: right; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; align-items: end; }
.grid-form button { margin: 8px 0; }
.page-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.page-tabs button { background: transparent; color: var(--text); border: none; border-bottom: 3px solid transparent; border-radius: 0; }
.page-tabs button.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.range { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; margin-bottom: 16px; }
.range label { margin: 0; }
.range input { width: 160px; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.table-card h2 { display: flex; justify-content: space-between; align-items: center; }
.table-card.has-ready { border: 2px solid var(--ok); }
.order-block { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.markup-good { color: var(--ok); font-weight: 600; }
.markup-low { color: var(--danger); font-weight: 600; }
.login-page main { max-width: 420px; padding-top: 10vh; }
.hint { font-size: .85rem; color: var(--muted); }
tr.clickable { cursor: pointer; }
tr.detail td { background: var(--bg); }

/* ---- Version 4: logo, brand header, poster slideshow ---- */
.brand-header { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--accent); color: var(--gold);
  border-bottom: 3px solid var(--gold); }
@media (prefers-color-scheme: dark) { .brand-header { background: var(--brand-dark); } }
.brand-mark { width: 72px; height: 72px; border-radius: 10px; flex: none; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1; }
.brand-tagline { font-size: .95rem; color: #fff; opacity: .92; }
.brand-phone { font-size: .9rem; color: #fff; opacity: .92; }
.brand-phone a { color: var(--gold); font-weight: 600; }
@media (max-width: 500px) { .brand-mark { width: 56px; height: 56px; } .brand-name { font-size: 1.3rem; } }

.slider { position: relative; overflow: hidden; border-radius: 12px; margin: 4px 0 16px; background: #1a0d0a; }
.slides { display: flex; transition: transform .5s ease; }
@media (prefers-reduced-motion: reduce) { .slides { transition: none; } }
.slide { position: relative; flex: 0 0 100%; height: clamp(320px, 62vh, 600px); overflow: hidden; display: block; }
.slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(24px) brightness(.5); transform: scale(1.2); }
.slide-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.slide-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; border-radius: 50%;
  font-size: 1.8rem; line-height: 1; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.4); color: #fff; }
.slide-arrow.prev { left: 10px; }
.slide-arrow.next { right: 10px; }
.slide-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.slide-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.45); border: none; }
.slide-dots button.active { background: var(--gold); }

.login-logo { display: block; width: 100%; max-width: 280px; margin: 0 auto 8px; border-radius: 10px; }
.login-page h1 { text-align: center; }
.login-page h1 + p { text-align: center; }

.poster-row { display: flex; gap: 14px; align-items: flex-start; }
.poster-thumb { width: 110px; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.poster-fields { flex: 1; }
.poster-preview { display: block; max-width: 100%; max-height: 260px; margin: 8px auto; border-radius: 8px; }

/* ---- Version 5: pickup / delivery, activity log ---- */
.badge.delivery { background: #e6eefb; color: #1f4f99; }
@media (prefers-color-scheme: dark) { .badge.delivery { background: #1c2b45; color: #8db4f0; } }
fieldset.choice { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
fieldset.choice legend { font-size: .9rem; color: var(--muted); padding: 0 4px; }
fieldset.choice label.inline { margin: 6px 0; }
textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; resize: vertical; }
[hidden] { display: none !important; }
.delivery-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.delivery-card { margin: 0; }
.delivery-card .address { font-size: 1.1rem; font-weight: 600; margin: 8px 0 4px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.collect { padding: 8px 10px; border-radius: 6px; background: var(--ok-bg); color: var(--ok); }
.collect.due { background: var(--warn-bg); color: var(--warn); }
a.button { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.badge.s-out_for_delivery { background: #e6eefb; color: #1f4f99; }
