/* ==========================================================
   Mvelo's Fast Food
   Design direction: the shop's own menu board — black panels,
   gold rules, condensed lettering, prices in a column with
   dot leaders. Mobile-first: most customers are on a phone.
   ========================================================== */

:root {
  --gold:      #CD8C2E;
  --gold-hi:   #E2A955;
  --bronze:    #A96C15;
  --cream:     #F8EDD9;
  --black:     #0A0A0A;
  --coal:      #161616;

  --bg:        #F6F5F2;
  --card:      #FFFFFF;
  --line:      #E5E2DC;
  --text:      #1A1A1A;
  --muted:     #6E6A63;

  --ok:        #1A7F37;
  --warn:      #A35B00;
  --danger:    #B3261E;

  --r:         12px;
  --shadow:    0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);

  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--bronze); }
img { max-width: 100%; height: auto; }

h1, h2, h3 { font-family: var(--display); font-weight: 600;
              letter-spacing: .01em; line-height: 1.15; }

/* Keyboard focus must always be visible. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Buttons -------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 11px 18px; border: 0; border-radius: 9px;
  background: var(--gold); color: #fff; font: 600 15px/1 var(--body);
  cursor: pointer; text-decoration: none; text-align: center;
  min-height: 44px;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--bronze); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 13px; min-height: 36px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-dark { background: var(--black); }
.btn-dark:hover { background: #303030; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid #CFCBC3; }
.btn-ghost:hover { background: #F0EEEA; }

/* ==========================================================
   Customer site
   ========================================================== */

/* ---------- Header --------------------------------------- */
.site-head { background: var(--black); position: sticky; top: 0; z-index: 40; }
.site-head-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: relative;
}
.site-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--cream); min-width: 0;
}
.site-brand img { width: 40px; height: 40px; flex-shrink: 0; }
.site-brand b {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 17px; line-height: 1.1; letter-spacing: .02em;
  white-space: nowrap;
}
.site-brand span {
  display: block; color: var(--gold); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase;
}

.nav-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid #333; border-radius: 9px;
  background: transparent; cursor: pointer; padding: 0; flex-shrink: 0;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--cream);
  position: relative;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px;
  background: var(--cream); transition: transform .2s ease, top .2s ease;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { top: 0; transform: rotate(-45deg); }

.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  color: var(--cream); text-decoration: none; font-size: 14.5px;
  padding: 10px 13px; border-radius: 8px; white-space: nowrap;
}
.site-nav a:hover { background: rgba(255,255,255,.09); color: var(--gold); }
.site-nav a[aria-current="page"] { color: var(--gold); font-weight: 600; }

.cart-link { font-weight: 600; }
.cart-badge {
  display: inline-block; margin-left: 6px; min-width: 21px; padding: 1px 6px;
  border-radius: 999px; background: var(--gold); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center;
}

/* Mobile: nav collapses behind the button */
@media (max-width: 760px) {
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--coal); border-top: 2px solid var(--gold);
    padding: 6px; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 16px; border-radius: 8px; font-size: 16px; }
}
@media (min-width: 761px) {
  .nav-toggle { display: none; }
}

/* Very small phones: shrink the wordmark so it never crowds the button */
@media (max-width: 359px) {
  .site-brand img { width: 34px; height: 34px; }
  .site-brand b { font-size: 15px; }
  .site-brand span { font-size: 9.5px; letter-spacing: .1em; }
  .site-head-inner { padding: 8px 12px; }
}

/* ---------- Hero: the board ------------------------------ */
.board {
  background: var(--black);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(205,140,46,.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(205,140,46,.10), transparent 50%);
  color: var(--cream);
  border-radius: 0 0 18px 18px;
  padding: 22px 18px 26px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}
.board h1 {
  font-size: clamp(25px, 6.6vw, 44px); margin: 0 0 8px;
  line-height: 1.08;
  text-transform: uppercase; letter-spacing: .02em; color: #fff;
}
.board h1 em { font-style: normal; color: var(--gold); }
.board p { margin: 0 auto; max-width: 46ch; color: #C9C4BA; font-size: 15px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 15px; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.status-pill.is-open  { color: #8FE0A6; }
.status-pill.is-open .dot  { background: #4CC46A; box-shadow: 0 0 0 3px rgba(76,196,106,.22); }
.status-pill.is-shut { color: #F0A9A2; }
.status-pill.is-shut .dot { background: #D2544A; }

.board-actions { display: flex; gap: 10px; justify-content: center;
                 flex-wrap: wrap; margin-top: 17px; }

/* ---------- Category chips ------------------------------- */
.cat-bar {
  position: sticky; top: 60px; z-index: 30;
  background: var(--bg); border-bottom: 1px solid var(--line);
  margin: 0 -16px 22px; padding: 10px 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar ul { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.cat-bar a {
  display: block; padding: 8px 15px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.cat-bar a:hover { border-color: var(--gold); color: var(--bronze); }

/* ---------- The menu board ------------------------------- */
.site-main { max-width: var(--wrap); margin: 0 auto; padding: 22px 16px 90px; }

.cat { margin-bottom: 34px; scroll-margin-top: 118px; }
.cat-head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 8px; margin-bottom: 4px;
  border-bottom: 2px solid var(--black);
}
.cat-head h2 {
  margin: 0; font-size: 22px; text-transform: uppercase;
  letter-spacing: .04em;
}
.cat-head .count { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

/* One row per item — scans far faster on a phone than cards. */
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.item-name {
  font-family: var(--display); font-weight: 500; font-size: 18px;
  letter-spacing: .01em; margin: 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.item-desc {
  grid-column: 1 / 2; margin: 2px 0 0;
  font-size: 13.5px; color: var(--muted); line-height: 1.45;
}
.item-right {
  grid-row: 1 / 3; grid-column: 2 / 3;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.item-price {
  font-family: var(--display); font-size: 19px; font-weight: 600;
  color: var(--black); white-space: nowrap;
}
.item.out { opacity: .55; }
.item.out .item-price { text-decoration: line-through; }
.leader { display: none; }

/* Dot leader — the menu-board signature. Desktop only, where there's room. */
@media (min-width: 700px) {
  .item { grid-template-columns: auto 1fr auto; }
  .item-name { grid-column: 1 / 2; }
  .item-desc { grid-column: 1 / 3; }
  .leader {
    display: block;
    grid-column: 2 / 3; grid-row: 1 / 2;
    align-self: end;                    /* sit on the name's baseline */
    border-bottom: 2px dotted #C8C3BA;
    transform: translateY(-4px); min-width: 30px;
  }
  .item-right { grid-column: 3 / 4; grid-row: 1 / 3; }
}

/* ---------- Sticky cart bar (mobile) --------------------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--black); color: var(--cream);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 2px solid var(--gold);
}
.cartbar .sum { font-size: 14px; }
.cartbar .sum b { font-family: var(--display); font-size: 18px; color: #fff; }

/* ---------- Cards / forms -------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 17px; margin: 0 0 14px; }

h1.page { font-size: 25px; margin: 4px 0 16px; }

.field { margin-bottom: 15px; }
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #CFCBC3;
  border-radius: 9px; font-size: 16px;   /* 16px stops iOS zooming on focus */
  font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(205,140,46,.18);
}
.radio { font-weight: 400; display: flex; align-items: center; gap: 9px;
         margin-bottom: 8px; padding: 9px 11px; border: 1px solid var(--line);
         border-radius: 9px; cursor: pointer; }
.radio:hover { border-color: var(--gold); }
.radio input { width: auto; }
small.err { color: var(--danger); display: block; margin-top: 4px; }

.checkout-grid { display: grid; gap: 16px; grid-template-columns: 1.25fr 1fr; }
@media (max-width: 820px) { .checkout-grid { grid-template-columns: 1fr; } }

/* ---------- Alerts / badges ------------------------------ */
.alert { padding: 12px 14px; border-radius: 9px; font-size: 14.5px;
         margin-bottom: 14px; }
.alert-success { background: #E6F4EA; color: #14682D; }
.alert-error   { background: #FCE8E6; color: #96201A; }
.alert-info    { background: #E6EFFA; color: #0B4C8C; }
.alert-warning { background: #FFF3E0; color: #8A4D00; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px;
         font-size: 12px; font-weight: 700; white-space: nowrap;
         letter-spacing: .01em; }
.badge-pending   { background: #FFF3E0; color: #8A4D00; }
.badge-preparing { background: #E6EFFA; color: #0B4C8C; }
.badge-ready     { background: #E6F4EA; color: #14682D; }
.badge-collected { background: #EDEBE7; color: #4F4B45; }
.badge-cancelled { background: #FCE8E6; color: #96201A; }
.badge-paid      { background: #E6F4EA; color: #14682D; }
.badge-unpaid    { background: #FFF3E0; color: #8A4D00; }
.badge-low       { background: #FFF3E0; color: #8A4D00; }
.badge-out       { background: #FCE8E6; color: #96201A; }

.muted { color: var(--muted); font-size: 13.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Confirmation / tracking ---------------------- */
.confirm { text-align: center; max-width: 540px; margin: 0 auto; }
.confirm-tick { width: 64px; height: 64px; margin: 2px auto 14px;
                border-radius: 50%; background: #E6F4EA; color: #14682D;
                font-size: 33px; line-height: 64px; }
.order-ref { background: #FBF6EC; border: 1px dashed var(--gold);
             border-radius: 11px; padding: 14px; margin: 18px 0; }
.order-ref strong { font-family: var(--display); font-size: 24px;
                    letter-spacing: .06em; }

.track-steps { list-style: none; padding: 0; margin: 18px 0 0; }
.track-steps li { display: flex; align-items: center; gap: 12px;
                  padding: 10px 0; color: var(--muted); }
.track-steps .dot { width: 15px; height: 15px; border-radius: 50%;
                    background: #DCD8D1; flex-shrink: 0; }
.track-steps li.done { color: var(--text); font-weight: 600; }
.track-steps li.done .dot { background: var(--gold);
                            box-shadow: 0 0 0 4px rgba(205,140,46,.18); }

/* ---------- Footer --------------------------------------- */
.site-foot { background: var(--black); color: #A9A49B; margin-top: 20px; }
.site-foot-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 30px 16px;
  display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr);
  font-size: 14.5px;
}
@media (max-width: 700px) { .site-foot-inner { grid-template-columns: 1fr; gap: 18px; } }
.site-foot strong { color: var(--cream); font-family: var(--display);
                    font-weight: 500; letter-spacing: .03em; }
.site-foot a { color: var(--gold); text-decoration: none; }
.site-foot-bar { border-top: 1px solid #242424; padding: 14px 16px;
                 text-align: center; font-size: 12px; color: #78736B; }

/* ==========================================================
   Admin: top bar + grouped sidebar
   ========================================================== */
body.admin { background: var(--bg); }

.adm-top {
  position: sticky; top: 0; z-index: 60;
  background: var(--black); color: var(--cream);
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; min-height: 56px;
}
.adm-brand { display: flex; align-items: center; gap: 9px;
             color: var(--cream); text-decoration: none; min-width: 0; }
.adm-brand img { width: 30px; height: 30px; flex-shrink: 0; }
.adm-brand span { font-family: var(--display); font-weight: 500; font-size: 16px;
                  letter-spacing: .03em; white-space: nowrap;
                  overflow: hidden; text-overflow: ellipsis; }
.adm-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px;
                 flex-shrink: 0; }
.adm-site, .adm-out {
  color: var(--cream); text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; border: 1px solid #3A3A3A;
  white-space: nowrap;
}
.adm-site:hover, .adm-out:hover { border-color: var(--gold); color: var(--gold); }
@media (max-width: 640px) { .adm-site { display: none; } }

.adm-burger {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  border: 1px solid #3A3A3A; border-radius: 9px;
  background: transparent; cursor: pointer; padding: 0;
}
.adm-burger span { display: block; width: 19px; height: 2px;
                   background: var(--cream); position: relative; }
.adm-burger span::before, .adm-burger span::after {
  content: ""; position: absolute; left: 0; width: 19px; height: 2px;
  background: var(--cream); transition: transform .2s ease, top .2s ease;
}
.adm-burger span::before { top: -6px; }
.adm-burger span::after  { top: 6px; }
.adm-burger[aria-expanded="true"] span { background: transparent; }
.adm-burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.adm-burger[aria-expanded="true"] span::after  { top: 0; transform: rotate(-45deg); }

.adm-shell { display: flex; align-items: flex-start; }

.adm-side {
  width: 236px; flex-shrink: 0; background: var(--coal);
  padding: 14px 10px 30px; align-self: stretch;
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto; scrollbar-width: thin;
}

.adm-who { display: flex; align-items: center; gap: 10px;
           padding: 8px 10px 14px; margin-bottom: 6px;
           border-bottom: 1px solid #262626; }
.adm-avatar { width: 36px; height: 36px; border-radius: 50%;
              background: var(--gold); color: #fff; flex-shrink: 0;
              display: flex; align-items: center; justify-content: center;
              font-family: var(--display); font-size: 17px; font-weight: 600; }
.adm-who-text { min-width: 0; line-height: 1.25; }
.adm-who-text strong { display: block; color: var(--cream); font-size: 14px;
                       overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-who-text span { color: var(--gold); font-size: 11.5px;
                     text-transform: uppercase; letter-spacing: .07em; }

.adm-group { margin-bottom: 14px; }
.adm-group-label {
  color: #7C766D; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .11em;
  padding: 6px 12px 5px;
}
.adm-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; margin-bottom: 1px;
  color: #C9C4BA; text-decoration: none; font-size: 14.5px;
  min-height: 42px;
}
.adm-link svg { flex-shrink: 0; opacity: .82; }
.adm-link span { flex: 1 1 auto; min-width: 0; overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }
.adm-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-link.is-active {
  background: rgba(205,140,46,.16); color: var(--gold); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}
.adm-link.is-active svg { opacity: 1; }
.adm-link-out { color: #A9A49B; }
.adm-link-out:hover { color: #F0A9A2; }

.adm-badge {
  font-style: normal; background: var(--gold); color: #fff;
  font-size: 11.5px; font-weight: 700; border-radius: 999px;
  min-width: 21px; padding: 1px 7px; text-align: center; flex-shrink: 0;
}

.adm-main { flex: 1 1 auto; min-width: 0; }
.adm-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.adm-backdrop.show { opacity: 1; pointer-events: auto; }

/* ---- Mobile: sidebar becomes a drawer ---- */
@media (max-width: 900px) {
  .adm-burger { display: flex; }
  .adm-side {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100%;
    width: 268px; max-width: 84vw; z-index: 65;
    padding-top: 16px;
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 6px 0 30px rgba(0,0,0,.35);
  }
  .adm-side.open { transform: translateX(0); }
}

.container { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }

.grid { display: grid; gap: 13px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 760px)  { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 460px)  { .grid-4 { grid-template-columns: 1fr; } }

.stat { background: var(--card); border: 1px solid var(--line);
        border-radius: var(--r); padding: 15px; box-shadow: var(--shadow); }
.stat .label { font-size: 11.5px; color: var(--muted);
               text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .value { font-family: var(--display); font-size: 27px; font-weight: 600;
               margin-top: 3px; }
.stat .value.gold { color: var(--bronze); }

table { width: 100%; border-collapse: collapse; }
.card > table { display: block; overflow-x: auto; white-space: nowrap; }
@media (min-width: 861px) { .card > table { display: table; white-space: normal; } }

th, td { padding: 11px 10px; text-align: left; font-size: 14px;
         border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
     color: var(--muted); font-weight: 700; }
tbody tr:hover { background: #FAF9F7; }
.table-empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.stock-form, .report-filter {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}
.stock-form .field, .report-filter .field { margin-bottom: 0; }

/* ---------- Login ---------------------------------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center;
              justify-content: center; padding: 20px; background: var(--black); }
.login-card { width: 100%; max-width: 390px; background: var(--card);
              border-radius: 15px; padding: 30px 26px;
              box-shadow: 0 12px 44px rgba(0,0,0,.45); }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo img { width: 92px; height: auto; }
.login-card h1 { font-size: 21px; margin: 0 0 4px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px;
                   margin: 0 0 20px; }

/* ---------- Print ---------------------------------------- */
@media print {
  .topbar, .nav, .site-head, .site-foot, .cartbar, .cat-bar,
  .btn, form, .nav-toggle { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  body { background: #fff; }
  .card > table { display: table; white-space: normal; }
}

/* ---------- Instant cart controls ------------------------ */
.is-hidden { display: none !important; }

.add-form { display: flex; justify-content: flex-end; }
.add-form.busy { opacity: .55; pointer-events: none; }

.stepper {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--gold); border-radius: 9px;
  background: #fff; overflow: hidden;
}
.stepper .step {
  width: 38px; height: 38px; border: 0; background: transparent;
  color: var(--bronze); font-size: 20px; line-height: 1; cursor: pointer;
  font-family: var(--body);
}
.stepper .step:hover { background: #FBF3E6; }
.stepper .qty {
  min-width: 26px; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 16px;
}

/* Toast — confirms an add without moving the page */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 14px);
  background: var(--black); color: var(--cream);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity .18s ease, transform .18s ease;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #7E1B15; }

/* ---------- Admin layout utilities (wrap on small screens) ---------- */
.row-split {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.row-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.row-form {
  display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.row-form .field { margin-bottom: 0; flex: 1 1 190px; }
.row-form .grow, .grow { flex: 1 1 200px; min-width: 0; }

/* Buttons inside wrapping rows must never be squashed. */
.row-actions .btn, .row-form .btn, .row-split .btn { flex: 0 0 auto; }
.row-actions form, .row-split form { display: inline-flex; }

@media (max-width: 560px) {
  /* Stack the admin action rows so nothing is cut off. */
  .row-form { flex-direction: column; align-items: stretch; }
  /* In a column, flex-basis is a HEIGHT - reset it or fields grow tall. */
  .row-form .field, .row-form .grow { flex: 0 0 auto; width: 100%; }
  .row-form .btn { width: 100%; }
  .row-split { align-items: flex-start; }
  .row-split h1, .row-split h2 { width: 100%; }
  .card { padding: 14px; }
  h1.page { font-size: 22px; }
  .container { padding: 16px 12px 60px; }
}

/* ==========================================================
   Counter sale (till)
   ========================================================== */
.pos-tools { position: sticky; top: 58px; z-index: 25;
             background: var(--bg); padding: 10px 0 8px; margin-bottom: 4px; }
.pos-tools input[type=search] {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid #CFCBC3; border-radius: 10px; background: #fff;
}
.pos-cats { display: flex; gap: 7px; overflow-x: auto; margin-top: 9px;
            padding-bottom: 2px; scrollbar-width: none; }
.pos-cats::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
        background: #fff; font: 600 13.5px var(--body); color: var(--text);
        white-space: nowrap; cursor: pointer; }
.chip.is-on { background: var(--black); color: var(--cream); border-color: var(--black); }

.pos-grid {
  display: grid; gap: 10px; padding-bottom: 96px;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
}
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow); overflow: hidden; display: flex;
  flex-direction: column; transition: border-color .12s ease;
}
.tile.has-qty { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(205,140,46,.18); }
.tile-hit {
  border: 0; background: transparent; text-align: left; cursor: pointer;
  padding: 12px 12px 8px; font-family: inherit; width: 100%;
  display: flex; flex-direction: column; gap: 3px; min-height: 84px;
}
.tile-hit:hover { background: #FBF7F0; }
.tile-name { font-family: var(--display); font-weight: 500; font-size: 15.5px;
             line-height: 1.2; }
.tile-price { font-family: var(--display); font-weight: 600; font-size: 17px;
              color: var(--bronze); }
.tile-stock { font-size: 11.5px; color: var(--muted); }

.tile-qty { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.tile-qty .step {
  flex: 0 0 42px; border: 0; background: #F7F5F1; cursor: pointer;
  font-size: 19px; color: var(--bronze); font-family: var(--body);
}
.tile-qty .step:hover { background: #F0EAE0; }
.tile-qty input {
  flex: 1 1 auto; width: 100%; min-width: 0; text-align: center; border: 0;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  font: 600 16px var(--display); padding: 9px 0; background: #fff;
  -moz-appearance: textfield;
}
.tile-qty input::-webkit-outer-spin-button,
.tile-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Till bar — always on screen */
.pos-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: var(--black); color: var(--cream);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  border-top: 2px solid var(--gold);
}
.pos-bar-sum { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.pos-bar-sum span { display: block; font-size: 12px; color: #A9A49B; }
.pos-bar-sum b { font-family: var(--display); font-size: 23px; color: #fff; }
.pos-bar .btn { min-width: 116px; }
.pos-bar .btn:disabled { opacity: .4; cursor: not-allowed; }
.pos-bar-clear {
  background: transparent; border: 1px solid #3a3a3a; color: #C9C4BA;
  border-radius: 8px; padding: 9px 12px; font: 600 13px var(--body);
  cursor: pointer;
}
.pos-bar-clear:hover { border-color: var(--gold); color: var(--gold); }

/* Payment panel: inline without JS, slide-up sheet with it */
.pos-pay-head { display: none; }
.js-on .pos-pay {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 88vh; overflow-y: auto; margin: 0;
  border-radius: 16px 16px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.34);
  transform: translateY(102%); transition: transform .22s ease;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.js-on .pos-pay.open { transform: translateY(0); }
.js-on .pos-pay-head { display: flex; align-items: center;
                       justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pos-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 59;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.pos-backdrop.show { opacity: 1; pointer-events: auto; }

.pos-lines { margin-bottom: 14px; }
.pos-lines table { width: 100%; }
.pos-lines td { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pos-lines .tot td { border: 0; padding-top: 10px;
                     font-family: var(--display); font-size: 19px; font-weight: 600; }

@media (min-width: 900px) {
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
  .js-on .pos-pay { max-width: 520px; left: auto; right: 20px;
                    border-radius: 16px; bottom: 84px;
                    transform: translateY(120%) ; }
  .js-on .pos-pay.open { transform: translateY(0); }
}

/* ---------- Always-visible log out --------------------------------- */
.head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* In the header bar: mobile only (desktop shows it in the nav). */
.head-logout {
  display: none;
  align-items: center; padding: 9px 13px; border-radius: 8px;
  border: 1px solid #3A3A3A; background: transparent;
  color: var(--cream); text-decoration: none;
  font-size: 13.5px; font-weight: 600; white-space: nowrap; min-height: 40px;
}
.head-logout:hover { border-color: var(--gold); color: var(--gold); }

@media (max-width: 760px) {
  .head-logout { display: inline-flex; }
  /* Hide the nav copy so it is not offered twice on the same screen. */
  .site-nav .nav-logout { display: none; }
}
@media (max-width: 400px) {
  /* Keep the wordmark from crowding the buttons on very small phones. */
  .site-brand b { font-size: 15px; }
  .site-brand span { font-size: 9.5px; }
  .head-logout { padding: 9px 10px; font-size: 13px; }
}

/* The wordmark must yield to the header buttons, not collide with them. */
.site-brand { min-width: 0; overflow: hidden; }
.site-brand > span { min-width: 0; overflow: hidden; }
.site-brand b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-brand span span,
.site-brand > span > span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 460px) {
  /* Two buttons in the bar leaves no room for the tagline. */
  .site-brand > span > span { display: none; }
  .site-brand b { font-size: 15.5px; }
  .site-brand img { width: 36px; height: 36px; }
}

/* ---------- Cart button in the header bar --------------------------- */
.head-cart {
  position: relative; display: inline-flex; align-items: center;
  justify-content: center; width: 44px; height: 44px; flex-shrink: 0;
  border: 1px solid #3A3A3A; border-radius: 9px;
  color: var(--cream); text-decoration: none;
}
.head-cart:hover { border-color: var(--gold); color: var(--gold); }

/* The badge sits on the corner of the bag. */
.head-cart .cart-badge {
  position: absolute; top: -7px; right: -7px; margin: 0;
  min-width: 21px; height: 21px; line-height: 21px; padding: 0 5px;
  border: 2px solid var(--black);
}
.cart-badge[hidden] { display: none; }

/* Desktop already lists Cart in the nav, so the bag is mobile only. */
@media (min-width: 761px) { .head-cart { display: none; } }

/* A brief pop so the change is noticed. */
@keyframes cartPop {
  0% { transform: scale(1); } 45% { transform: scale(1.32); } 100% { transform: scale(1); }
}
.cart-badge.pop { animation: cartPop .32s ease; }
@media (prefers-reduced-motion: reduce) { .cart-badge.pop { animation: none; } }

/* ---------- Supplier portal ---------------------------------------- */
.adm-supname { color: var(--gold); font-size: 13px; white-space: nowrap;
               overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.sup-nav { background: var(--coal); padding: 0 14px; display: flex; gap: 4px;
           overflow-x: auto; scrollbar-width: none; }
.sup-nav::-webkit-scrollbar { display: none; }
.sup-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--gold); text-decoration: none; padding: 13px 12px;
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid var(--gold);
}
.sup-nav .adm-badge { background: var(--gold); }

/* ---------- Payment options ---------------------------------------- */
.pay-option { align-items: flex-start; }
.pay-option strong { display: block; }
.pay-details {
  margin-top: 10px; padding: 14px 16px;
  background: #FBF6EC; border: 1px dashed var(--gold); border-radius: 10px;
}
.pay-details-body { font-size: 14.5px; line-height: 1.65; }
.pay-details-body br + br { line-height: 2.4; }

.switch { display: inline-flex; align-items: center; gap: 8px;
          font-size: 13.5px; font-weight: 600; margin: 0; cursor: pointer; }
.switch input { width: auto; }

/* ---------- Impersonation banner ----------------------------------- */
.imp-bar {
  position: sticky; top: 0; z-index: 45;
  background: #7E1B15; color: #FFE9E7;
  padding: 10px 16px; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.imp-bar strong { color: #fff; }
.imp-bar .btn { background: #fff; color: #7E1B15; flex-shrink: 0; }
.imp-bar .btn:hover { background: #FFE9E7; }
