:root {
  --orange: #ff4f00;
  --orange-dark: #d94100;
  --black: #111111;
  --panel: #1a1a1a;
  --panel-2: #242424;
  --line: #343434;
  --muted: #969696;
  --paper: #f5f3ef;
  --success: #38c976;
  --danger: #ff5e5e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: #0d0d0d; color: white; }
button, input { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; }
.topbar { height: 74px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(17,17,17,.96); position: sticky; top: 0; z-index: 5; }
.brand-lockup { display: flex; gap: 14px; align-items: center; }
.brand-lockup div { display: flex; flex-direction: column; align-items: center; }
.brand-lockup strong { font-size: 15px; letter-spacing: .12em; }
.brand-lockup span:last-child { color: var(--orange); font-size: 13px; font-weight: 800; letter-spacing: .26em; margin-top: 3px; padding-left: .26em; }
.brand-mark { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 26px; background: var(--orange); color: white; font-weight: 950; font-style: italic; font-size: 32px; letter-spacing: -.08em; transform: skew(-5deg); box-shadow: 0 18px 50px rgba(255,79,0,.23); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; box-shadow: none; }
.brand-logo-small { width: 44px; height: 44px; object-fit: cover; border-radius: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { padding: 9px 12px; border: 1px solid var(--line); border-radius: 99px; color: #ddd; font-size: 13px; }
.status-dot { width: 7px; height: 7px; display: inline-block; background: var(--success); border-radius: 50%; margin-right: 7px; }
.ghost-link, .ghost-button { color: #ccc; border: 0; background: transparent; text-decoration: none; padding: 9px 10px; cursor: pointer; font-size: 13px; }
.ghost-link:hover, .ghost-button:hover { color: white; }

.metrics-row { display: grid; grid-template-columns: repeat(3, minmax(150px, 210px)) 1fr; gap: 12px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.metrics-row article, .metrics-row .metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; color:white; text-decoration:none; }
.metrics-row article span, .metrics-row .metric-card span { color: var(--muted); font-size: 12px; }
.metrics-row article strong, .metrics-row .metric-card strong { font-size: 20px; }
.metrics-row .metric-card:hover { border-color:#666; background:var(--panel-2); }
.metrics-row .metric-alert strong { color: #ff9c73; }
.live-clock { justify-self: end; text-align: right; align-self: center; display: flex; flex-direction: column; }
.live-clock strong { font-size: 24px; }
.live-clock span { color: var(--muted); font-size: 12px; text-transform: capitalize; }

.terminal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; min-height: calc(100vh - 171px); }
.catalog-panel { padding: 28px; min-width: 0; }
.cart-panel { border-left: 1px solid var(--line); background: #141414; display: flex; flex-direction: column; min-height: 100%; }
.panel-heading, .cart-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
.panel-heading h1, .cart-heading h2 { margin: 2px 0 0; font-size: clamp(26px, 3vw, 40px); letter-spacing: -.04em; }
.cart-heading { padding: 26px 22px 18px; border-bottom: 1px solid var(--line); }
.cart-heading h2 { font-size: 28px; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 850; letter-spacing: .16em; }
.eyebrow.orange { color: var(--orange); }
.search-box { width: min(330px, 40vw); height: 46px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.search-box span { color: var(--muted); font-size: 24px; transform: rotate(-20deg); }
.search-box input { width: 100%; border: 0; background: transparent; color: white; outline: none; }

.category-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 22px 0 18px; scrollbar-width: none; }
.category-tab { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 9px 15px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.category-tab.active { background: var(--orange); border-color: var(--orange); font-weight: 750; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.product-card { position: relative; min-height: 145px; padding: 18px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #5a5a5a; background: var(--panel-2); }
.product-card:active { transform: scale(.98); }
.product-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.product-category { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 9px; font-weight: 800; }
.product-card > strong { margin-top: 10px; font-size: 17px; line-height: 1.15; }
.product-footer { margin-top: auto; display: flex; align-items: end; justify-content: space-between; }
.product-footer b { color: var(--accent); font-size: 20px; }
.product-footer small { color: var(--muted); }
.product-card.low-stock .product-footer small { color: #ff9c73; font-weight: 750; }
.product-card[hidden] { display: none; }
.empty-search { padding: 60px; text-align: center; color: var(--muted); }

.text-button { border: 0; color: var(--orange); background: transparent; cursor: pointer; }
.text-button:disabled { color: #555; cursor: default; }
.cart-lines { padding: 12px 18px; flex: 1; overflow: auto; }
.empty-cart { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-cart span { display: grid; place-items: center; width: 52px; height: 52px; border: 1px dashed #555; border-radius: 50%; font-size: 26px; }
.empty-cart strong { color: #ddd; margin-top: 14px; }
.empty-cart p { margin: 5px 0; font-size: 13px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.cart-line-name { font-weight: 700; }
.cart-line-price { font-weight: 800; }
.quantity-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.quantity-control button { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.cart-summary { border-top: 1px solid var(--line); padding: 18px 20px 22px; }
.cart-summary > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 9px; }
.cart-summary .total-line { color: white; align-items: baseline; padding-top: 8px; }
.total-line strong { font-size: 30px; letter-spacing: -.04em; }
.checkout-button, .primary-button { width: 100%; border: 0; border-radius: 13px; background: var(--orange); padding: 15px 18px; font-weight: 850; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.checkout-button:hover, .primary-button:hover { background: var(--orange-dark); }
.checkout-button:disabled { background: #333; color: #707070; cursor: default; }

.payment-dialog { border: 0; padding: 0; background: transparent; color: white; width: min(520px, calc(100vw - 30px)); }
.payment-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.dialog-card { position: relative; background: #191919; border: 1px solid #444; border-radius: 22px; padding: 28px; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.dialog-card h2 { margin: 4px 0 20px; font-size: 30px; }
.dialog-close { position: absolute; right: 18px; top: 16px; border: 0; background: transparent; font-size: 26px; color: #888; cursor: pointer; }
.payment-total { display: flex; justify-content: space-between; align-items: center; background: #101010; border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.payment-total span { color: var(--muted); }
.payment-total strong { font-size: 28px; }
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-button { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); padding: 17px; cursor: pointer; font-weight: 750; text-align: left; }
.payment-button:hover { border-color: var(--orange); background: #2c211c; }
.payment-button span { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 9px; background: #343434; border-radius: 9px; color: var(--orange); }
.dialog-note { color: var(--muted); font-size: 12px; margin: 15px 0 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; background: white; color: #111; border-radius: 13px; padding: 14px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.4); transform: translateY(120px); opacity: 0; transition: .25s ease; font-weight: 700; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #ffdddd; color: #8d1717; }

.login-page { background: radial-gradient(circle at 15% 15%, #392015 0, #111 35%, #090909 100%); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 80px; width: min(1050px, calc(100% - 40px)); margin: auto; }
.login-title { display:inline-flex; flex-direction:column; align-items:center; }
.login-brand h1 { font-size: clamp(48px, 8vw, 92px); letter-spacing: -.065em; margin: 26px 0 8px; }
.login-brand > p:last-child { color: #aaa; font-size: 18px; }
.login-brand .club-label { margin: 0; padding-left:.4em; color: var(--orange); font-size: 22px; font-weight: 850; letter-spacing: .4em; text-transform: uppercase; }
.login-logo { width: 180px; max-width: 55vw; aspect-ratio: 1.3; object-fit: cover; object-position: 50% 29%; border-radius: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.login-card { justify-self: end; width: min(420px, 100%); padding: 34px; border: 1px solid #393939; background: rgba(26,26,26,.94); border-radius: 24px; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.login-card h2 { margin: 5px 0 24px; font-size: 30px; }
.login-card label { display: block; color: #bbb; font-size: 12px; margin: 15px 0 7px; }
.login-card input { width: 100%; padding: 14px; color: white; background: #101010; border: 1px solid #444; border-radius: 11px; outline: none; }
.login-card input:focus { border-color: var(--orange); }
.primary-button.full { margin-top: 20px; justify-content: center; }
.form-error { color: #ff9c9c; background: #3a1717; padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.login-note { color: #777; font-size: 11px; margin: 18px 0 0; text-align: center; }

@media (max-width: 900px) {
  .terminal-grid { grid-template-columns: 1fr; }
  .cart-panel { border-left: 0; border-top: 1px solid var(--line); min-height: 520px; }
  .metrics-row { grid-template-columns: repeat(3, 1fr); }
  .live-clock { display: none; }
  .login-shell { grid-template-columns: 1fr; gap: 28px; padding: 50px 0; }
  .login-brand { text-align: center; }
  .login-brand .brand-mark { margin: auto; }
  .login-card { justify-self: center; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 14px; }
  .ghost-link, .user-chip { display: none; }
  .metrics-row { padding: 12px 14px; gap: 7px; }
  .metrics-row article, .metrics-row .metric-card { padding: 11px; flex-direction: column; align-items: flex-start; gap: 3px; }
  .metrics-row article strong, .metrics-row .metric-card strong { font-size: 16px; }
  .catalog-panel { padding: 20px 14px; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { min-height: 132px; padding: 15px; }
  .payment-grid { grid-template-columns: 1fr; }
}

