:root {
  --bg: #120f0a;
  --bg-soft: #1c160e;
  --panel: #fffaf0;
  --panel-2: #f5ecd9;
  --ink: #23190d;
  --muted: #75664f;
  --gold: #d8a331;
  --gold-dark: #936715;
  --green: #2f7d50;
  --red: #a3382d;
  --line: rgba(35, 25, 13, 0.14);
  --shadow: 0 28px 80px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at top left, #3a2a12, var(--bg) 45%, #070604); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.loading, .center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot-card, .panel, .auth-card, .hero-panel, .cart-panel { background: rgba(255, 250, 240, .96); border: 1px solid rgba(255, 255, 255, .35); border-radius: 28px; box-shadow: var(--shadow); }
.boot-card { width: min(440px, 100%); text-align: center; padding: 42px; }
.logo-mark { width: 52px; height: 52px; display: inline-grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #f8d77a, var(--gold)); color: #1b1308; font-weight: 900; letter-spacing: -.08em; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 12px 28px rgba(0,0,0,.2); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: 16px; padding: 14px clamp(14px, 3vw, 28px); background: rgba(18, 15, 10, .9); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.1); color: #fff8e8; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: max-content; }
.brand strong { display: block; line-height: 1; }
.brand small { display: block; color: rgba(255,248,232,.72); font-size: 12px; margin-top: 3px; }
.nav { display: flex; gap: 8px; align-items: center; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav-btn, .tab { border: 1px solid transparent; background: transparent; color: inherit; border-radius: 999px; padding: 10px 14px; white-space: nowrap; }
.nav-btn:hover, .nav-btn.active { background: rgba(216,163,49,.18); border-color: rgba(216,163,49,.38); }
.layout { max-width: 1220px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 28px) 80px; }
.account-strip { display: flex; justify-content: space-between; gap: 16px; align-items: center; background: rgba(255,250,240,.08); border: 1px solid rgba(255,255,255,.12); color: #fff7e5; border-radius: 24px; padding: 14px 18px; margin-bottom: 18px; }
.account-strip span { display: block; color: rgba(255,247,229,.72); font-size: 13px; }
.strip-actions, .button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-bg { min-height: 100vh; background: radial-gradient(circle at 10% 10%, #5d4218, transparent 34%), radial-gradient(circle at bottom right, #1f6041, transparent 30%), var(--bg); }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .75fr); gap: 28px; align-items: center; max-width: 1180px; margin: 0 auto; padding: clamp(18px, 5vw, 56px); }
.hero-panel, .auth-card, .panel { padding: clamp(20px, 4vw, 34px); }
.hero-panel { color: #fff8e8; background: linear-gradient(135deg, rgba(31,24,13,.85), rgba(31,70,46,.72)); border-color: rgba(255,255,255,.14); }
.hero-panel h1, .public-hero h1, .page-head h1 { font-size: clamp(38px, 7vw, 76px); line-height: .92; letter-spacing: -0.065em; margin: 12px 0; }
.page-head h1 { color: #fff8e8; font-size: clamp(32px, 5vw, 56px); }
.page-head p, .public-hero p, .hero-panel p { font-size: 18px; line-height: 1.55; max-width: 760px; color: rgba(255,248,232,.78); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #f5cc67; text-transform: uppercase; letter-spacing: .14em; font-weight: 900; font-size: 12px; }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: currentColor; box-shadow: 0 0 24px currentColor; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.feature { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); border-radius: 20px; padding: 16px; }
.feature h3 { margin: 0 0 6px; }
.feature p { font-size: 14px; margin: 0; }
.auth-card { background: #fffaf0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; background: #efe1c5; padding: 6px; border-radius: 999px; }
.tab { color: var(--ink); }
.tab.active { background: #fffaf0; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.stack { display: grid; gap: 14px; }
.hidden { display: none !important; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: #fffef8; color: var(--ink); border-radius: 16px; padding: 13px 14px; outline: none; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(216,163,49,.16); }
.btn { border: 1px solid rgba(35,25,13,.15); border-radius: 999px; padding: 12px 18px; background: #fff8e8; color: var(--ink); font-weight: 900; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #f6ce6a, var(--gold)); border-color: transparent; color: #191107; box-shadow: 0 10px 30px rgba(216,163,49,.28); }
.btn.ghost { background: rgba(255,255,255,.08); color: inherit; border-color: rgba(255,255,255,.18); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn.danger { color: #fff; background: var(--red); }
.btn.wide { width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 26px 0 18px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.two.uneven { grid-template-columns: .85fr 1.15fr; align-items: start; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.align-end { align-items: end; }
.metric-grid, .result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { background: linear-gradient(180deg, #fffaf0, #f4e5c5); border: 1px solid rgba(255,255,255,.7); border-radius: 24px; padding: 20px; box-shadow: 0 18px 48px rgba(0,0,0,.18); }
.metric span, .metric small { display: block; color: var(--muted); font-weight: 800; }
.metric strong { display: block; margin: 10px 0 6px; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.05em; }
.form-panel { max-width: 100%; }
.alert { border-radius: 18px; padding: 14px 16px; margin-top: 16px; background: #f4e5c5; border: 1px solid var(--line); }
.alert.good { background: #e5f5e8; color: #164327; border-color: rgba(47,125,80,.25); }
.alert.danger { background: #fde7e4; color: #751f16; border-color: rgba(163,56,45,.3); }
.empty { border: 1px dashed var(--line); border-radius: 18px; padding: 22px; text-align: center; color: var(--muted); background: rgba(255,255,255,.45); }
.product-list, .orders-list { display: grid; gap: 14px; }
.product-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.48); align-items: center; }
.product-row img, .market-card img { width: 100%; height: 96px; object-fit: cover; border-radius: 18px; background: #e9d4a5; }
.image-placeholder, .market-placeholder { display: grid; place-items: center; height: 96px; border-radius: 18px; background: linear-gradient(135deg, #f6ce6a, #2f7d50); color: #fff; font-weight: 900; }
.product-row h3, .product-row p { margin: 0 0 5px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: rgba(35,25,13,.09); color: var(--muted); font-size: 12px; font-weight: 900; }
.pill.good { background: rgba(47,125,80,.12); color: var(--green); }
.order-card { display: grid; gap: 14px; }
.order-head, .cart-total { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.order-head h2 { margin: 0; }
.order-head p { color: var(--muted); margin: 4px 0 0; }
.order-items { display: flex; gap: 8px; flex-wrap: wrap; }
.order-items span { background: #efe1c5; border-radius: 999px; padding: 8px 10px; font-weight: 800; font-size: 13px; }
.cost-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; }
.mini-btn { border: 0; background: #efe1c5; color: var(--ink); border-radius: 12px; min-width: 34px; height: 34px; font-weight: 900; }
.checks { display: flex; flex-wrap: wrap; gap: 12px; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; }
.check input { width: auto; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 12px; color: var(--muted); background: rgba(255,255,255,.4); }
.check-list li span:first-child { color: var(--gold-dark); font-weight: 900; }
.check-list li.done { color: var(--green); background: rgba(47,125,80,.08); }
.mini-order { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.mini-order:last-child { border-bottom: 0; }
.score { display: grid; place-items: center; width: 210px; height: 210px; margin: 0 auto 24px; border-radius: 50%; background: radial-gradient(circle at center, #fffaf0 48%, transparent 49%), conic-gradient(var(--gold), #2f7d50, #efe1c5); }
.score strong { font-size: 52px; letter-spacing: -.08em; }
.score span { color: var(--muted); font-weight: 900; }
.production-group { border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.public-bg { background: #fbf1dc; min-height: 100vh; }
.public-store { max-width: 1200px; margin: 0 auto; padding: clamp(16px, 4vw, 44px); }
.public-hero { background: radial-gradient(circle at top left, rgba(216,163,49,.35), transparent 28%), linear-gradient(135deg, #181107, #2a1f10); color: #fff8e8; border-radius: 34px; padding: clamp(28px, 6vw, 70px); box-shadow: var(--shadow); margin-bottom: 24px; }
.store-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.store-meta span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 9px 12px; }
.public-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.product-market { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.market-card { background: #fffaf0; border: 1px solid rgba(35,25,13,.12); border-radius: 24px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.1); }
.market-card img, .market-placeholder { height: 190px; border-radius: 0; }
.market-body { padding: 18px; }
.market-body h2 { margin: 10px 0 8px; }
.market-body p { color: var(--muted); line-height: 1.5; }
.market-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 18px; }
.market-footer strong { font-size: 24px; }
.cart-panel { position: sticky; top: 18px; padding: 22px; }
.cart-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 0; }
.cart-total { margin: 16px 0; padding-top: 16px; border-top: 2px solid var(--line); font-size: 20px; }
.label-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.food-label { background: #fff; border: 1.5px solid #111; color: #111; padding: 18px; min-height: 260px; break-inside: avoid; }
.food-label h2 { margin: 0 0 4px; font-size: 22px; text-transform: uppercase; letter-spacing: -.03em; }
.label-weight { font-weight: 900; border-bottom: 1px solid #111; padding-bottom: 8px; }
.small-text { font-size: 12px !important; line-height: 1.45; }
.muted { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(30px); opacity: 0; pointer-events: none; background: #181107; color: #fff8e8; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow); z-index: 50; transition: .2s ease; max-width: min(560px, calc(100vw - 32px)); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #7a2118; }
@media (max-width: 960px) {
  .auth-layout, .grid.two, .grid.two.uneven, .grid.three, .public-grid, .product-market { grid-template-columns: 1fr; }
  .metric-grid, .result-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-head, .account-strip { align-items: stretch; flex-direction: column; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; }
  .cart-panel { position: static; }
}
@media (max-width: 620px) {
  .metric-grid, .result-grid, .feature-grid, .label-sheet { grid-template-columns: 1fr; }
  .product-row { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
  .cost-row { grid-template-columns: 1fr; }
  .hero-panel h1, .public-hero h1, .page-head h1 { font-size: 40px; }
}
@media print {
  body { background: #fff; }
  .topbar, .account-strip, .no-print, .toast { display: none !important; }
  .layout, .public-store { padding: 0; max-width: none; }
  .label-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10mm; }
  .food-label { box-shadow: none; min-height: 74mm; page-break-inside: avoid; }
}
.three-tabs { grid-template-columns: repeat(3, 1fr); border-radius: 26px; }
.admin-list { display: grid; gap: 14px; margin-top: 14px; }
.admin-card { border: 1px solid var(--line); border-radius: 22px; padding: 16px; background: rgba(255,255,255,.55); }
.admin-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.admin-card-head span { color: var(--muted); font-size: 13px; font-weight: 800; }
.ai-result { min-height: 120px; white-space: pre-wrap; border: 1px solid var(--line); background: #181107; color: #fff8e8; border-radius: 18px; padding: 14px; overflow: auto; }
@media (max-width: 620px) { .three-tabs { grid-template-columns: 1fr; border-radius: 22px; } .admin-card-head { align-items: flex-start; flex-direction: column; } }
