:root {
  --red: #ff3b1f;
  --orange: #ff6a00;
  --yellow: #ffb400;
  --brown: #5a1e12;
  --black: #121212;
  --white: #ffffff;
  --cream: #fff8f3;
  --cream-2: #fff1e8;
  --line: #eadfd7;
  --muted: #736865;
  --soft: #f7f1ed;
  --danger: #b42318;
  --success: #16784f;
  --warning: #a65f00;
  --shadow: 0 22px 70px rgba(90, 30, 18, .13);
  --shadow-soft: 0 12px 32px rgba(90, 30, 18, .08);
  --gradient: linear-gradient(135deg, var(--red), var(--orange) 58%, var(--yellow));
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --max-mobile: 520px;
}

* { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--black);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 106, 0, .16), transparent 34%),
    linear-gradient(180deg, #fffaf7 0%, #fff 48%, #fff8f3 100%);
}
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select, textarea { color: var(--black); }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

.landing-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}
.landing-card {
  width: min(100%, 560px);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(26px, 6vw, 48px);
  text-align: center;
  box-shadow: var(--shadow);
}
.landing-logo { width: 180px; margin: 0 auto 20px; }
.landing-card h1 { margin: 0 0 10px; font-size: clamp(30px, 6vw, 48px); letter-spacing: -.05em; color: var(--brown); }
.landing-card p { margin: 0; color: var(--muted); line-height: 1.6; }

.shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}
.client-shell {
  max-width: 1180px;
  padding-bottom: 108px;
}
.client-header, .workspace-header {
  padding: clamp(18px, 4vw, 32px);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-lockup div { min-width: 0; }
.brand-name {
  display: block;
  font-weight: 900;
  letter-spacing: -.05em;
  font-size: 24px;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-lockup span {
  display: block;
  color: var(--brown);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-badge, .last-sync {
  background: var(--black);
  color: #fff;
  border-radius: 999px;
  padding: 11px 15px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(0,0,0,.14);
  white-space: nowrap;
}

.welcome-panel, .workspace-title {
  margin-top: 22px;
  border-radius: var(--radius-xl);
  padding: clamp(22px, 5vw, 38px);
  background: var(--black);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.welcome-panel::after, .workspace-title::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  top: -110px;
  right: -80px;
  background: radial-gradient(circle, rgba(255,180,0,.52), rgba(255,106,0,.12) 58%, transparent 70%);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.welcome-panel h1, .workspace-title h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 720px;
  font-size: clamp(30px, 7vw, 64px);
  line-height: .98;
  letter-spacing: -.07em;
}
.welcome-panel p:not(.eyebrow), .workspace-title p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 14px 0 0;
  color: rgba(255,255,255,.78);
  line-height: 1.6;
}
.workspace-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.dark-header { background: #0f0f0f; color: #fff; border-radius: 0 0 34px 34px; }
.dark-header .brand-lockup span { color: rgba(255,255,255,.72); }
.dark-header .workspace-title { background: #1b1512; border: 1px solid rgba(255,255,255,.08); }
.admin-header .workspace-title { background: var(--cream); color: var(--black); border: 1px solid var(--line); }
.admin-header .workspace-title h1 { color: var(--brown); }
.admin-header .workspace-title p:not(.eyebrow) { color: var(--muted); }
.admin-header .workspace-title::after { background: radial-gradient(circle, rgba(255,106,0,.22), transparent 66%); }
.cashier-header .workspace-title { background: #102f34; }
.cashier-header .eyebrow { color: #00a8b5; }

.notice-panel {
  margin: 0 clamp(16px, 4vw, 32px) 20px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: #fff3f0;
  border: 1px solid #ffd1c8;
  color: var(--danger);
}
.notice-panel h2 { margin: 0 0 8px; }
.notice-panel p { margin: 0; line-height: 1.5; }
.session-advice {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-weight: 850;
}
.session-advice.dark {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
}

.category-strip, .status-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px clamp(16px, 4vw, 32px) 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,250,247,.88);
  border-bottom: 1px solid rgba(234,223,215,.8);
  backdrop-filter: blur(16px);
}
.category-strip button, .status-strip button, .admin-nav button {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--brown);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(90,30,18,.04);
}
.category-strip button.active, .status-strip button.active, .admin-nav button.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.content-section, .access-card, .kpi-grid, .admin-layout, .orders-layout {
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
}
.content-section { padding-top: 8px; padding-bottom: 24px; }
.section-heading, .panel-heading, .drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-heading h2, .panel-heading h2, .drawer-header h2 {
  margin: 0;
  color: var(--brown);
  font-size: clamp(24px, 5vw, 36px);
  letter-spacing: -.05em;
}
.section-heading span, .panel-heading span {
  color: var(--muted);
  font-weight: 900;
  padding-top: 9px;
  white-space: nowrap;
}
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.product-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.product-card.unavailable { opacity: .72; filter: grayscale(.82); }
.product-card.unavailable .product-image img { filter: brightness(.78) grayscale(.95); }
.product-image {
  height: 118px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--cream);
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-details { min-width: 0; display: flex; flex-direction: column; }
.badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: #fff0e8;
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge.off { background: #f0f0f0; color: #5e5e5e; }
.badge.ready { background: #e9f8f1; color: var(--success); }
.badge.warning { background: #fff3da; color: var(--warning); }
.product-details h3 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -.03em;
}
.product-details p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
}
.product-actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { color: var(--brown); font-size: 18px; font-weight: 950; white-space: nowrap; }

.button, .add-button {
  border-radius: 15px;
  padding: 12px 15px;
  font-weight: 950;
  letter-spacing: -.01em;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.button:active, .add-button:active, .cart-button:active { transform: scale(.98); }
.button.primary, .add-button { background: var(--gradient); color: #fff; box-shadow: 0 12px 24px rgba(255,106,0,.18); }
.button.secondary { background: #fff; color: var(--brown); border: 1px solid var(--line); }
.button.light { background: #fff; color: var(--black); }
.button.danger { background: #fff2ee; color: var(--danger); border: 1px solid #ffd1c8; }
.button.success { background: #e9f8f1; color: var(--success); border: 1px solid #bde7d0; }
.button.full { width: 100%; }
.add-button { min-width: 92px; }

.cart-button {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 500px);
  z-index: 50;
  border-radius: 22px;
  padding: 16px 18px;
  background: var(--black);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  font-weight: 900;
}
.cart-button span { display: flex; align-items: center; gap: 8px; }
.cart-button span strong {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--gradient);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18,18,18,.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 70;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 106%);
  width: min(100%, 560px);
  max-height: min(86vh, 720px);
  overflow: auto;
  z-index: 80;
  border-radius: 32px 32px 0 0;
  padding: 12px clamp(18px, 4vw, 28px) max(22px, env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -30px 80px rgba(0,0,0,.28);
  transition: transform .24s ease;
}
.cart-drawer.open { transform: translate(-50%, 0); }
.drawer-handle { width: 54px; height: 5px; border-radius: 99px; background: #ded5cf; margin: 0 auto 16px; }
.cart-lines { display: grid; gap: 12px; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 18px;
  padding: 12px;
}
.cart-line strong { display: block; margin-bottom: 4px; }
.cart-line small { color: var(--muted); font-weight: 800; }
.quantity-control { display: flex; align-items: center; gap: 8px; }
.quantity-control button { width: 34px; height: 34px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-weight: 950; color: var(--brown); }
.drawer-total { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; font-size: 22px; color: var(--brown); font-weight: 950; }
.drawer-note { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 13px; }

.empty-state {
  border: 1px dashed var(--line);
  background: rgba(255,255,255,.75);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  width: min(calc(100% - 32px), 520px);
  border-radius: 18px;
  padding: 15px 16px;
  color: #fff;
  font-weight: 900;
  background: var(--success);
  opacity: 0;
  transition: .24s ease;
  z-index: 120;
  box-shadow: 0 20px 48px rgba(0,0,0,.22);
}
.toast.error { background: var(--danger); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.access-card { padding-top: 26px; }
.access-inner, .editor-card, .order-card, .admin-product-card, .table-card, .compact-row, .kpi-card {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.access-inner { max-width: 480px; margin: 0 auto; padding: 24px; }
.access-inner h2 { margin: 0 0 8px; color: var(--brown); font-size: 30px; letter-spacing: -.05em; }
.access-inner p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field span { font-size: 12px; font-weight: 950; color: var(--brown); text-transform: uppercase; letter-spacing: .08em; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: #fff;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255,106,0,.1); }

.kpi-grid { display: grid; gap: 14px; padding-top: 22px; }
.kpi-grid.three { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.four { grid-template-columns: repeat(4, 1fr); }
.kpi-grid.six { grid-template-columns: repeat(6, 1fr); }
.kpi-card { padding: 18px; }
.kpi-card strong { display: block; font-size: clamp(30px, 6vw, 48px); color: var(--orange); line-height: 1; letter-spacing: -.06em; }
.kpi-card span { display: block; margin-top: 8px; color: var(--muted); font-weight: 900; font-size: 13px; }

.status-strip { top: 0; margin-top: 18px; }
.orders-layout { display: grid; gap: 14px; padding-top: 18px; padding-bottom: 40px; }
.order-card { padding: 18px; }
.order-card.new { border-color: rgba(255,106,0,.38); box-shadow: 0 18px 44px rgba(255,106,0,.12); }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.order-head h3 { margin: 0; color: var(--brown); font-size: clamp(22px, 5vw, 34px); letter-spacing: -.05em; }
.order-meta { margin-top: 4px; color: var(--muted); font-weight: 850; }
.order-products { background: var(--cream); border-radius: 18px; padding: 16px; font-size: clamp(18px, 3vw, 28px); line-height: 1.45; font-weight: 900; color: var(--black); white-space: pre-line; }
.order-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-actions .button { padding: 11px 13px; }
.history-note { color: var(--muted); font-weight: 900; }

.admin-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; padding-top: 22px; padding-bottom: 50px; align-items: start; }
.admin-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.admin-nav button { width: 100%; border-radius: 16px; text-align: left; white-space: normal; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.compact-list, .admin-product-grid, .table-grid { display: grid; gap: 12px; }
.compact-row { padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.compact-row strong { color: var(--brown); }
.compact-row span { color: var(--muted); font-weight: 800; }
.admin-product-card { overflow: hidden; }
.admin-product-card-inner { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px; }
.admin-product-card img { width: 120px; height: 120px; object-fit: cover; border-radius: 18px; background: var(--cream); }
.admin-product-card h3 { margin: 0 0 6px; color: var(--black); letter-spacing: -.03em; }
.admin-product-card p { margin: 0 0 8px; color: var(--muted); line-height: 1.4; }
.admin-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.editor-card { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.table-card { padding: 16px; }
.table-card h3 { margin: 0 0 8px; color: var(--brown); font-size: 24px; }
.table-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }
.table-card code { display: block; overflow-wrap: anywhere; background: var(--cream); padding: 10px; border-radius: 12px; color: var(--brown); margin: 10px 0; }

.table-picker-card {
  margin: 18px clamp(18px, 4vw, 32px) 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow-soft);
}
.table-picker-card .field { margin-bottom: 8px; }
.table-picker-card p { margin: 0; color: var(--muted); font-weight: 800; line-height: 1.4; }
.table-session-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.session-form {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
}
.error-text { color: var(--danger) !important; }
.drawer-table-line {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--brown);
  font-weight: 900;
}
.site-footer {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 32px) 38px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  font-weight: 760;
}
.site-footer strong { color: var(--brown); }
.site-footer a { color: var(--orange); font-weight: 950; }
.site-footer details {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
}
.site-footer summary {
  cursor: pointer;
  color: var(--brown);
  font-weight: 950;
}
.site-footer p { margin: 10px 0 0; line-height: 1.5; }
.top-gap { margin-top: 24px; }
.admin-order-row {
  align-items: flex-start;
}
.admin-order-row small {
  display: block;
  margin-top: 8px;
  white-space: pre-line;
  color: var(--black);
  font-weight: 760;
}
.menu-group-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.menu-group-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}
.menu-group-card.disabled {
  opacity: .5;
  filter: grayscale(.7);
}
.menu-group-card h3, .editor-card h2 {
  margin: 0 0 14px;
  color: var(--brown);
  letter-spacing: -.03em;
}
.menu-group-line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.menu-group-line:last-child { border-bottom: 0; }
.menu-group-line img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}
.menu-group-line span { font-weight: 900; color: var(--black); }
.menu-group-line strong { color: var(--brown); white-space: nowrap; }
.menu-group-line.selectable {
  cursor: pointer;
  grid-template-columns: 48px 1fr auto;
}
.menu-group-line input {
  width: 22px;
  height: 22px;
  accent-color: var(--orange);
}
.payment-line { margin-top: 12px; }
.compact-editor { margin-bottom: 16px; }
.image-upload-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.image-upload-preview img {
  width: 110px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--cream);
}
.menu-assignment {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.menu-assignment legend {
  color: var(--brown);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 6px;
}
.menu-assignment label, .toggle-line {
  color: var(--brown);
  font-weight: 900;
}
.menu-assignment.disabled {
  opacity: .46;
  filter: grayscale(.75);
}
.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toggle-line input, .menu-assignment input { accent-color: var(--orange); }
.menu-hours-grid.disabled { opacity: .48; pointer-events: none; }

@media (min-width: 760px) {
  .client-shell { padding-bottom: 40px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { grid-template-columns: 150px 1fr; }
  .product-image { height: 150px; }
  .cart-button { width: min(360px, calc(100% - 36px)); left: auto; right: 28px; transform: none; }
  .cart-drawer { left: auto; right: 0; bottom: 0; top: 0; transform: translateX(105%); width: min(480px, 100%); max-height: 100vh; border-radius: 32px 0 0 32px; padding-top: 26px; }
  .cart-drawer.open { transform: translateX(0); }
  .orders-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1060px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-card { grid-template-columns: 1fr; }
  .product-image { height: 190px; }
  .orders-layout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .brand-logo { width: 54px; height: 54px; border-radius: 17px; }
  .brand-name { font-size: 21px; }
  .welcome-panel h1, .workspace-title h1 { font-size: 34px; }
  .workspace-title { display: block; }
  .last-sync { margin-top: 16px; display: inline-flex; }
  .kpi-grid.three, .kpi-grid.four, .kpi-grid.six { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { display: block; }
  .admin-nav { position: sticky; top: 0; z-index: 25; display: flex; overflow-x: auto; border-radius: 0; margin: 0 calc(clamp(16px, 4vw, 32px) * -1) 18px; padding: 10px clamp(16px, 4vw, 32px); border-left: 0; border-right: 0; }
  .admin-nav button { width: auto; flex: 0 0 auto; text-align: center; white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .product-card { grid-template-columns: 106px 1fr; }
  .product-image { height: 106px; }
  .product-details h3 { font-size: 17px; }
  .product-actions { align-items: flex-end; }
  .add-button { min-width: 86px; padding: 11px 12px; }
}

@media (max-width: 430px) {
  .topbar { gap: 10px; }
  .table-badge { padding: 10px 12px; font-size: 13px; }
  .product-card { grid-template-columns: 96px 1fr; gap: 12px; }
  .product-image { height: 96px; }
  .product-details p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .product-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .add-button { width: 100%; }
  .admin-product-card-inner { grid-template-columns: 96px 1fr; }
  .admin-product-card img { width: 96px; height: 96px; }
}

.topbar-actions, .heading-actions, .table-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.product-card { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.product-card:hover { transform: translateY(-2px); border-color: rgba(255,106,0,.38); box-shadow: 0 18px 46px rgba(90, 30, 18, .12); }
.product-card:focus-visible { outline: 4px solid rgba(255,106,0,.22); outline-offset: 2px; }
.product-card.unavailable { cursor: default; }
.product-card.unavailable .product-image img { filter: grayscale(1) brightness(.72); }
.product-card.unavailable .product-details { opacity: .72; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18,18,18,.54);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 90;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.product-modal {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 108%);
  width: min(100%, 620px);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 32px 32px 0 0;
  z-index: 100;
  box-shadow: 0 -28px 90px rgba(0,0,0,.34);
  transition: transform .24s ease;
}
.product-modal.open { transform: translate(-50%, 0); }
.product-modal > img {
  width: 100%;
  height: min(42vh, 360px);
  object-fit: cover;
  background: var(--cream);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 10px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--brown);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}
.modal-content { padding: 22px; }
.modal-content h2 { margin: 12px 0 10px; color: var(--brown); font-size: clamp(28px, 7vw, 46px); letter-spacing: -.06em; line-height: .98; }
.modal-content p { margin: 0; color: var(--muted); line-height: 1.55; font-weight: 650; }
.modal-meta { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.modal-meta span { color: var(--muted); font-weight: 850; }

.data-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-soft);
  overflow: auto;
}
.admin-product-table { min-width: 860px; }
.product-table-head, .product-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr .7fr 1fr 1.8fr;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.product-table-head {
  background: var(--cream);
  color: var(--brown);
  font-weight: 950;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.product-table-row:last-child { border-bottom: 0; }
.product-table-row > span { color: var(--muted); font-weight: 850; }
.product-table-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-table-name img { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; background: var(--cream); flex: 0 0 auto; }
.product-table-name strong { display: block; color: var(--black); }
.product-table-name small { display: block; color: var(--muted); font-weight: 850; margin-top: 2px; }
.order-summary-row { align-items: flex-start; }
.qr-line strong { display: block; color: var(--brown); margin-bottom: 6px; }
.money-kpi strong { font-size: clamp(24px, 4vw, 40px); }

@media (min-width: 760px) {
  .product-modal {
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -45%) scale(.96);
    border-radius: 32px;
    opacity: 0;
    pointer-events: none;
  }
  .product-modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
}

@media (max-width: 760px) {
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .dashboard-kpis { grid-template-columns: 1fr 1fr; }
  .admin-product-table { min-width: 720px; }
  .menu-group-grid, .settings-grid { grid-template-columns: 1fr; }
  .table-session-options, .session-form { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .topbar-actions .button { flex: 1; padding-left: 10px; padding-right: 10px; }
  .dashboard-kpis { grid-template-columns: 1fr; }
}
