:root {
  color-scheme: dark;
  --bg: #050403;
  --panel: rgba(17, 14, 10, .88);
  --panel-2: rgba(28, 22, 13, .94);
  --text: #fff6df;
  --muted: #c9b57a;
  --gold: #d9a83a;
  --gold-2: #f3d891;
  --danger: #6e1717;
  --ok: #25d366;
  --line: rgba(230, 190, 91, .24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 105%, rgba(217, 168, 58, .22), transparent 22rem),
    linear-gradient(180deg, #15100a, #050403 48%);
  color: var(--text);
}
button, input, select { font: inherit; }
button { touch-action: manipulation; }
.app { min-height: 100svh; max-width: 720px; margin: 0 auto; padding: 12px; }
.view { display: grid; gap: 14px; }
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 14px;
}
.login-view { align-content: start; }
.brand-lockup { min-height: 24svh; display: grid; align-content: end; gap: 8px; }
.brand-lockup span { color: var(--gold-2); font-size: clamp(3.7rem, 18vw, 5rem); font-weight: 900; line-height: .8; }
h1, h2, h3, p { margin: 0; }
h1 { max-width: 11ch; color: var(--gold-2); font-size: clamp(2rem, 10vw, 2.35rem); line-height: .92; }
h2 { font-size: 1.25rem; }
h3 { color: var(--gold-2); }
.brand-lockup p, .hint, .msg { color: rgba(255,246,223,.7); line-height: 1.35; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .85rem; font-weight: 800; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(230,190,91,.25);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 0 12px;
}
.primary, .secondary, .ghost {
  min-height: 50px;
  border-radius: 8px;
  border: 0;
  font-weight: 900;
  cursor: pointer;
}
.primary { background: linear-gradient(180deg, #ffe7a3, #d9a83a); color: #1b1204; }
.primary:disabled { opacity: .45; }
.secondary { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line); }
.ghost { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid rgba(255,255,255,.1); padding: 0 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: linear-gradient(180deg, var(--bg), rgba(5,4,3,.86)); }
.topbar small { color: var(--muted); text-transform: uppercase; font-weight: 900; font-size: .7rem; letter-spacing: .12em; }
.event-list { display: grid; gap: 10px; margin-top: 12px; }
.event-list button { min-height: 58px; text-align: left; padding: 12px; }
.catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 190px; }
.product {
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 7px;
  text-align: left;
  position: relative;
}
.product img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: radial-gradient(circle, rgba(243,216,145,.12), #0c0a07 72%);
  padding: 6px;
}
.product .photo-fallback { display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; border-radius: 6px; background: radial-gradient(circle, rgba(243,216,145,.18), rgba(255,255,255,.04)); color: var(--gold-2); font-size: 2rem; }
.product strong { font-size: 1rem; line-height: 1.1; }
.product b { color: var(--gold-2); }
.badge { position: absolute; top: 8px; right: 8px; min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: var(--gold-2); color: #1b1204; font-weight: 900; }
.cart-toggle { position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 10; display: flex; justify-content: space-between; align-items: center; max-width: 692px; margin: 0 auto; min-height: 58px; border: 0; border-radius: 8px; background: var(--ok); color: #03140a; padding: 0 18px; font-weight: 900; box-shadow: 0 16px 42px rgba(37,211,102,.25); }
.cart-toggle span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.28); }
.cart { position: fixed; left: 12px; right: 12px; bottom: 82px; z-index: 9; max-width: 696px; margin: 0 auto; display: none; max-height: min(62svh, 520px); overflow: auto; background: #080604; border-color: rgba(230,190,91,.34); box-shadow: 0 22px 80px rgba(0,0,0,.68); }
.cart.open { display: block; }
.cart-head, .cart-item, .total-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-item { padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.cart-item > span:first-child { min-width: 0; }
.qty-controls { display: inline-flex; gap: 7px; align-items: center; }
.qty-controls button { width: 44px; height: 44px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: var(--text); font-weight: 900; }
.total-row { padding: 12px 0; color: var(--gold-2); font-size: 1.25rem; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 12px; background: rgba(0,0,0,.78); }
.modal[hidden] { display: none; }
.modal-card { width: min(100%, 520px); max-height: calc(100svh - 24px); overflow: auto; display: grid; gap: 10px; padding: 14px; border-radius: 8px; border: 1px solid var(--line); background: #0c0906; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.modal-card > strong { color: var(--gold-2); font-size: clamp(2.4rem, 13vw, 3.2rem); line-height: .9; }
.modal-card .primary, .modal-card .secondary { line-height: 1.12; padding: 10px 12px; }
.warning { padding: 10px; border-radius: 8px; background: #3b0f0f; border: 1px solid rgba(255,179,167,.32); color: #ffd6ce; font-size: .86rem; line-height: 1.25; font-weight: 900; text-align: center; }
time { display: block; color: var(--gold-2); font-size: clamp(2rem, 11vw, 2.4rem); font-weight: 900; text-align: center; }
.offline { position: sticky; top: 0; z-index: 100; padding: 8px 12px; background: #601414; color: #ffe1dc; font-size: .78rem; font-weight: 900; text-align: center; }
.offline strong { margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.18); }
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 60;
  max-width: 696px;
  margin: 0 auto;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  background: #12351f;
  color: #dfffe9;
  border: 1px solid rgba(37, 211, 102, .45);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  font-weight: 900;
  text-align: center;
}
.toast.warning { background: #3e2d10; color: #ffe9b8; border-color: rgba(243,216,145,.42); }
.install { color: rgba(255,246,223,.75); border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgba(255,255,255,.05); font-size: .9rem; line-height: 1.25; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; position: sticky; top: 66px; z-index: 4; background: rgba(5,4,3,.9); padding: 8px 0; }
.tabs button { min-height: 48px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.04); color: var(--text); font-weight: 800; }
.tabs button.active { background: var(--gold); color: #1b1204; }
.admin-grid { display: grid; gap: 12px; }
.row { display: grid; gap: 8px; }
.table-card { display: grid; gap: 8px; }
.table-row { display: grid; gap: 4px; padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; background: rgba(255,255,255,.035); }
.table-row b, .table-row span { overflow-wrap: anywhere; }
.admin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.danger {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255, 179, 167, .34);
  background: rgba(110, 23, 23, .82);
  color: #ffe1dc;
  font-weight: 900;
}
.status-pill {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.product-row { grid-template-columns: 64px 1fr; align-items: center; }
.product-row .danger { grid-column: 1 / -1; }
.product-row div { min-width: 0; }
.product-row b, .product-row span { display: block; line-height: 1.22; }
.product-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: contain;
  padding: 3px;
  border: 1px solid var(--line);
  background: #0c0a07;
}
.product-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--gold-2);
  font-weight: 900;
}
.metric { display: grid; gap: 4px; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.metric strong { color: var(--gold-2); font-size: 1.5rem; }
@media (min-width: 640px) {
  .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { grid-template-columns: repeat(4, 1fr); }
  .product-row { grid-template-columns: 64px 1fr auto; }
  .product-row .danger { grid-column: auto; }
}
