/* ============================================
   Foody Menu v2 — Impeccable Craft
   Mobile-first • Operate Mode • Rappi-inspired
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #ff441f;
  --primary-dark: #d63a18;
  --primary-light: #fff0ed;
  --primary-hover: #e63d1c;
  --secondary: #ff8c00;
  --accent: #7c3aed;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #0ea5e9;

  --bg: #f5f5f7;
  --bg-card: #ffffff;
  /* Compatibility aliases used by the admin modules. Keeping these mapped to
     the same solid surfaces prevents panels from becoming transparent. */
  --card-bg: var(--bg-card);
  --bg-secondary: var(--bg);
  --bg-dark: #1a1a2e;
  --bg-overlay: rgba(0,0,0,0.5);

  --text: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --muted: var(--text-muted);
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* --- Browser Surfaces --- */
::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Focus States --- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --- Base Typography --- */
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
html, body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; font-family: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font-family: inherit; font-size: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a, .chip, .product-select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* ============================================
   SHOP HEADER
   ============================================ */

.shop-header {
  background: var(--primary);
  color: var(--text-inverse);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  padding-top: env(safe-area-inset-top);
}

.shop-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.shop-topbar .brand {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-topbar .search-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

/* Search icon */
.shop-topbar .search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.8;
  pointer-events: none;
}

.shop-topbar .search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  transition: background var(--transition-fast);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.shop-topbar .search-wrap input::placeholder { color: rgba(255,255,255,0.7); }
.shop-topbar .search-wrap input:focus { background: rgba(255,255,255,0.35); outline: none; }
.shop-topbar .search-wrap input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.shop-topbar .search-wrap input::-webkit-search-decoration { -webkit-appearance: none; }

.shop-topbar .admin-link {
  color: rgba(255,255,255,0.85);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-topbar .admin-link:hover { background: rgba(255,255,255,0.15); color: #fff; }

.shop-intro {
  padding: 12px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.shop-intro h1 { font-size: 1.1rem; font-weight: 800; line-height: 1.2; margin-bottom: 2px; letter-spacing: -0.02em; }
.shop-intro .intro-copy { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0; }
.shop-intro .shop-logo { width: 40px; height: 40px; border-radius: var(--radius-md); object-fit: cover; margin-bottom: 6px; }

/* --- Order Mode Selector --- */
.order-mode { display: flex; gap: 6px; }
.order-mode button {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8rem;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.order-mode button:hover { background: rgba(255,255,255,0.2); }
.order-mode button.active { background: #fff; color: var(--primary); border-color: #fff; box-shadow: var(--shadow-md); }

/* --- Main Content --- */
.shop-shell { padding: 12px 16px 100px; max-width: 600px; margin: 0 auto; }
.shop-controls { position: sticky; top: 56px; z-index: 20; margin-inline: -2px; padding: 4px 2px 7px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); }
.search-empty { margin: 18px 0; padding: 26px 18px; }
.search-empty h2 { font-size: 1rem; }
.search-empty p { margin-bottom: 0; font-size: .78rem; }

/* --- Category Chips --- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chips::-webkit-scrollbar { height: 4px; }
.chips::-webkit-scrollbar-track { background: transparent; }
.chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 25%, transparent); }

/* --- Menu Sections --- */
.shop-section { margin-bottom: 24px; animation: fadeInUp 0.3s var(--ease-out) both; }
.shop-section:nth-child(2) { animation-delay: 0.05s; }
.shop-section:nth-child(3) { animation-delay: 0.1s; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.section-title h2 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.section-title p { font-size: 0.75rem; color: var(--text-muted); }

.shop-subsection { margin-bottom: 14px; }
.shop-subsection h3 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 4px; margin-bottom: 8px; }

/* --- Product Cards --- */
.shop-list { display: grid; gap: 8px; }

.shop-product {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base);
  border: 1px solid var(--border-light);
}
.shop-product:hover { box-shadow: var(--shadow-md); }

.product-select {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  text-align: left;
  color: var(--text);
}

.shop-photo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 700;
}
.shop-photo img { width: 100%; height: 100%; object-fit: cover; }

.shop-info { flex: 1; min-width: 0; }
.shop-info strong { display: block; font-size: 0.9rem; font-weight: 600; line-height: 1.2; margin-bottom: 1px; }
.shop-info small { display: -webkit-box; font-size: 0.75rem; color: var(--text-muted); line-height: 1.2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-info em { display: inline-block; font-size: 0.65rem; font-style: normal; color: var(--accent); background: #f3f0ff; padding: 1px 6px; border-radius: var(--radius-full); margin-top: 3px; font-weight: 600; }

.shop-price { font-size: 0.9rem; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* --- Cart Bar --- */
.cart-bar {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 0);
  left: 0;
  right: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
.cart-bar button {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
.cart-bar button:hover { background: var(--primary-hover); }

/* ============================================
   DRAWERS
   ============================================ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 300;
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.drawer-backdrop[hidden] { display: block; opacity: 0; pointer-events: none; }
.drawer-backdrop:not([hidden]) { opacity: 1; }

/* FIX: Use dvh for mobile browsers, fallback to vh */
.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: min(92dvh, calc(100vh - 20px));
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.drawer[aria-hidden="false"] { transform: translateY(0); }
.drawer, .drawer-head, .drawer-scroll, .drawer-foot, .modifier-group, .modifier-option, .cart-item, .step-nav, .step-section, .checkout-steps { touch-action: manipulation; }

/* Drag handle for mobile */
.drawer::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.drawer-head h2 { font-size: 1.1rem; font-weight: 700; flex: 1; }

.icon-button {
  width: 44px;
  height: 44px;
  border: none;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-button:hover { background: var(--border); color: var(--text); }
.icon-button svg { width: 20px; height: 20px; }

/* --- Drawer Product Content --- */
.drawer-product-image { width: 100%; height: 180px; object-fit: cover; background: var(--primary-light); }
.drawer-product-info { padding: 16px; }
.drawer-product-info h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.drawer-product-info .product-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.drawer-product-info .product-price { font-size: 1.3rem; font-weight: 800; color: var(--primary); }

/* --- Modifier Groups --- */
.modifier-group {
  margin: 10px 12px 0;
  padding: 0;
  overflow: hidden;
  overflow: clip;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-card) 96%, var(--bg));
  box-shadow: 0 2px 7px rgba(25, 30, 43, .035);
  transition: border-color 240ms ease, background-color 240ms ease, box-shadow 300ms cubic-bezier(.16,1,.3,1);
}
.modifier-group:last-child { margin-bottom: 12px; }
.modifier-group.is-expanded {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  background: var(--bg-card);
  box-shadow: 0 12px 28px rgba(25, 30, 43, .075);
}
.modifier-group.is-confirming { border-color: color-mix(in srgb, var(--success) 42%, var(--border)); background: color-mix(in srgb, var(--success) 3%, var(--bg-card)); }
.modifier-group.has-selection:not(.is-expanded) {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: color-mix(in srgb, var(--success) 3.5%, var(--bg-card));
}
.modifier-group-title { font-size: 0.9rem; font-weight: 700; margin: 0; }
.modifier-group-toggle { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 11px 12px 11px 14px; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.modifier-group-toggle:hover { background: color-mix(in srgb, var(--primary) 3.5%, transparent); }
.modifier-group-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
.modifier-group.is-static .modifier-group-toggle { cursor: default; }
.modifier-group.is-static .modifier-group-toggle:hover { background: transparent; }
.modifier-group-heading { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.modifier-group-toggle strong { overflow: hidden; font-size: .91rem; line-height: 1.25; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.modifier-group-range, .modifier-group-selection { overflow: hidden; font-size: 0.72rem; font-weight: 550; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; transition: color 180ms ease, opacity 180ms ease, transform 260ms cubic-bezier(.16,1,.3,1); }
.modifier-group-range { color: var(--text-muted); }
.modifier-group-selection { display: none; color: color-mix(in srgb, var(--success) 82%, var(--text)); }
.modifier-group.has-selection:not(.is-expanded) .modifier-group-range { display: none; }
.modifier-group.has-selection:not(.is-expanded) .modifier-group-selection { display: block; animation: modifierSummaryIn 260ms cubic-bezier(.16,1,.3,1) both; }
.modifier-group.hide-selection-summary .modifier-group-selection { display: none !important; }
.modifier-group.hide-selection-summary.has-selection:not(.is-expanded) .modifier-group-range { display: block; }
.modifier-group.is-complete .modifier-group-range { color: var(--success); }
.modifier-group-trailing { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.modifier-group-count { min-width: 34px; padding: 4px 7px; border-radius: 8px; background: var(--bg); color: var(--text-muted); font-size: .65rem; font-weight: 750; font-variant-numeric: tabular-nums; text-align: center; transition: background-color 200ms ease, color 200ms ease; }
.modifier-group.is-complete .modifier-group-count { background: color-mix(in srgb, var(--success) 11%, var(--bg-card)); color: var(--success); }
.modifier-group.hide-selection-counter .modifier-group-count { display: none; }
.modifier-group-chevron { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--bg); color: var(--text-secondary); transition: transform 340ms cubic-bezier(.16,1,.3,1), background-color 200ms ease, color 200ms ease; }
.modifier-group-chevron svg { width: 18px; height: 18px; }
.modifier-group-toggle[aria-expanded="true"] .modifier-group-chevron { transform: rotate(180deg); background: var(--primary-light); color: var(--primary); }
.modifier-group.is-static .modifier-group-chevron { display: none; }
.modifier-group-body { display: grid; grid-template-rows: 0fr; opacity: .35; visibility: hidden; transition: grid-template-rows 360ms cubic-bezier(.16,1,.3,1), opacity 180ms ease, visibility 0s linear 360ms; }
.modifier-group.is-expanded .modifier-group-body { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows 420ms cubic-bezier(.16,1,.3,1), opacity 220ms ease 55ms, visibility 0s; }
.modifier-group-body-inner { min-height: 0; overflow: hidden; }
.modifier-group-content { padding: 0 14px 10px; }
@keyframes modifierSummaryIn { from { opacity: 0; clip-path: inset(0 12% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }

.modifier-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 150ms ease;
}
.modifier-option:hover { background: color-mix(in srgb, var(--primary) 2.5%, transparent); }
.modifier-option:last-child { border-bottom: none; }
.modifier-option-info { flex: 1; }
.modifier-option-name { font-size: 0.85rem; font-weight: 500; }
.modifier-option-price { font-size: 0.75rem; color: var(--text-muted); }

.modifier-qty { display: flex; align-items: center; gap: 10px; }
.modifier-qty button {
  width: 30px;
  height: 30px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.modifier-qty button:hover { border-color: var(--primary); color: var(--primary); }
.modifier-qty button svg { width: 16px; height: 16px; }
.modifier-qty button.mod-disabled, .modifier-qty button:disabled {
  opacity: 0.3;
  pointer-events: none;
  border-color: var(--border);
  color: var(--text-muted);
}
.modifier-qty strong { font-size: 0.9rem; min-width: 18px; text-align: center; }
.modifier-group.max-reached .modifier-option { opacity: 0.72; pointer-events: auto; }
.modifier-group.max-reached .modifier-qty > [data-mod-qty="1"],
.modifier-qty > [data-mod-qty="1"].is-extra { border-color: color-mix(in srgb, var(--accent) 52%, var(--border)); background: color-mix(in srgb, var(--accent) 11%, var(--bg-card)); color: var(--accent); }
.modifier-group.max-reached .modifier-qty > [data-mod-qty="1"]:hover,
.modifier-qty > [data-mod-qty="1"].is-extra:hover { border-color: color-mix(in srgb, var(--accent) 70%, var(--border)); background: color-mix(in srgb, var(--accent) 18%, var(--bg-card)); color: var(--accent); }
.modifier-group-actions { display: flex; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--border-light); }
.modifier-group-done { min-width: 92px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font: inherit; font-size: .77rem; font-weight: 750; cursor: pointer; box-shadow: 0 4px 11px color-mix(in srgb, var(--primary) 22%, transparent); transition: background-color 150ms ease, transform 150ms ease, opacity 150ms ease; }
.modifier-group-done svg { width: 17px; height: 17px; }
.modifier-group-done:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
.modifier-group-done:active:not(:disabled) { transform: translateY(0) scale(.98); }
.modifier-group-done:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent); outline-offset: 2px; }
.modifier-group-done:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.modifier-group.is-confirming .modifier-group-done { background: var(--success); }

.related-products { margin-top: 15px; padding: 16px 14px 5px; border-top: 1px solid var(--border-light); }
.related-products-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.related-products-heading h3 { margin: 0; color: var(--text); font-size: .9rem; font-weight: 750; letter-spacing: -.012em; }
.related-products-heading > span { min-width: 25px; height: 25px; display: grid; place-items: center; padding-inline: 6px; border-radius: 8px; background: var(--bg-secondary); color: var(--text-secondary); font-size: .66rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.related-products-list { display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-inline: contain; }
.related-products-list::-webkit-scrollbar { display: none; }
.related-product-item { flex: 0 0 min(255px, 78vw); display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 64px; padding: 8px; border: 1px solid var(--border); border-radius: 13px; background: var(--bg-card); color: var(--text); text-align: left; scroll-snap-align: start; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 150ms cubic-bezier(.16,1,.3,1); }
.related-product-item:hover { border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); transform: translateY(-1px); }
.related-product-item:active { transform: scale(.985); }
.related-product-item:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent); outline-offset: 2px; }
.related-product-item.is-added { border-color: color-mix(in srgb, var(--success) 46%, var(--border)); background: color-mix(in srgb, var(--success) 6%, var(--bg-card)); cursor: default; opacity: 1; }
.related-product-image { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.related-product-image img { width: 100%; height: 100%; object-fit: cover; }
.related-product-image strong { font-size: .95rem; }
.related-product-info { min-width: 0; display: grid; gap: 3px; }
.related-product-info > strong { overflow: hidden; font-size: .78rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.related-product-info > small { color: var(--primary); font-size: .75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.related-product-action { min-width: 33px; display: grid; justify-items: center; gap: 2px; color: var(--primary); }
.related-product-action svg { width: 18px; height: 18px; }
.related-product-action em { font-size: .58rem; font-style: normal; font-weight: 750; }
.related-product-item.is-added .related-product-action { color: var(--success); }

@media (max-width: 640px) {
  .modifier-group { margin-inline: 10px; border-radius: 15px; }
  .modifier-group-toggle { min-height: 68px; padding: 12px 11px 12px 13px; }
  .modifier-option { min-height: 54px; padding-block: 11px; }
  .modifier-qty button { width: 34px; height: 34px; }
  .modifier-group-done { width: 100%; min-height: 42px; }
  .related-products { padding-inline: 10px; }
  .related-product-item { flex-basis: min(240px, 82vw); }
}

@media (prefers-reduced-motion: reduce) {
  .modifier-group, .modifier-group-body, .modifier-group-chevron, .modifier-group-range, .modifier-group-selection, .modifier-group-count, .modifier-group-done, .related-product-item { transition-duration: 1ms !important; transition-delay: 0ms !important; animation-duration: 1ms !important; }
}

/* --- Drawer Footer --- */
.drawer-foot {
  padding: 12px 16px;
  border-top: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  background: var(--bg-card);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
}

.quantity { display: flex; align-items: center; gap: 14px; }
.quantity button {
  width: 38px;
  height: 38px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.quantity button:hover { border-color: var(--primary); color: var(--primary); }
.quantity strong { font-size: 1.1rem; min-width: 24px; text-align: center; }

/* --- Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}
.button:hover { border-color: var(--primary); color: var(--primary); }
.button:active { transform: scale(0.98); }
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 25%, transparent); }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* ============================================
   CART DRAWER — STEP WIZARD
   ============================================ */

.cart-drawer { max-height: min(95dvh, calc(100vh - 20px)); }

/* Checkout step wizard styles inside cart drawer */
.cart-drawer .order-mode button {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg);
}
.cart-drawer .order-mode button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.cart-drawer .order-mode button:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}
.cart-drawer .order-mode button.active:hover {
  background: var(--primary-hover);
  color: #fff;
  border-color: var(--primary-hover);
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
}

.step-dot {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-dot-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.step-dot.active .step-dot-num { background: var(--primary); color: #fff; }
.step-dot.done .step-dot-num { background: var(--success); color: #fff; }

.step-dot-line {
  width: 32px;
  height: 2px;
  background: var(--border);
  transition: background var(--transition-fast);
}
.step-dot.done .step-dot-line { background: var(--success); }

.step-dot-label {
  font-size: 0;
  position: absolute;
  opacity: 0;
}

/* Cart items */
.cart-items { padding: 12px 16px; }

.cart-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.85rem; font-weight: 600; margin-bottom: 1px; }
.cart-item-mods { font-size: 0.7rem; color: var(--text-muted); }

.cart-item-qty { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cart-item-qty button {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.cart-item-qty button:hover { border-color: var(--primary); color: var(--primary); }
.cart-item-qty strong { font-size: 0.85rem; min-width: 16px; text-align: center; }

.cart-item-price { font-weight: 700; font-size: 0.85rem; white-space: nowrap; flex-shrink: 0; }

/* Checkout Steps */
.checkout-steps { padding: 0 16px 16px; }

.step-section { display: none; }
.step-section.active { display: block; animation: fadeInUp 0.2s var(--ease-out) both; }

.checkout-step-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-top: 8px;
}

.checkout-steps label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.checkout-steps input,
.checkout-steps textarea,
.checkout-steps select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: 3px;
  box-sizing: border-box;
}
.checkout-steps input:focus,
.checkout-steps textarea:focus,
.checkout-steps select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
  background: var(--bg-card);
}

.checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 2px solid var(--border-light);
  margin-top: 8px;
}
.checkout-summary span { font-size: 0.9rem; color: var(--text-secondary); }
.checkout-summary strong { font-size: 1.2rem; font-weight: 800; color: var(--primary); }

.delivery-summary { font-size: 0.8rem; color: var(--text-secondary); padding: 8px 0; border-top: 1px solid var(--border-light); }
.delivery-summary div { display: flex; justify-content: space-between; padding: 2px 0; }
.delivery-summary[hidden] { display: none !important; }
.platform-fee-summary { padding: 7px 0 5px; color: var(--text); }
.platform-fee-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }

.step-nav {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  flex-shrink: 0;
}
.step-nav .button { flex: 1; padding: 14px; font-weight: 700; }
.step-nav .step-back { background: var(--bg); border-color: var(--border); }
.step-nav .step-next { background: var(--primary); color: #fff; border-color: var(--primary); }

.payment-note { text-align: center; font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; }
.payment-instructions { margin: 2px 0 11px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--primary) 5%, var(--bg-card)); }
.payment-instructions[hidden], .checkout-steps .payment-proof-field[hidden] { display: none !important; }
.payment-instructions strong { display: block; margin-bottom: 4px; font-size: .75rem; color: var(--primary); }
.payment-instructions p { font-size: .76rem; line-height: 1.48; color: var(--text-secondary); white-space: pre-line; }
.payment-copy-value { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:2px 0 11px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--bg); color:var(--text); text-align:left; cursor:pointer; transition:border-color 180ms cubic-bezier(.23,1,.32,1),background 180ms cubic-bezier(.23,1,.32,1),transform 180ms cubic-bezier(.23,1,.32,1); }
.payment-copy-value[hidden] { display:none!important; }
.payment-copy-value:hover { border-color:var(--primary); background:var(--primary-light); }
.payment-copy-value:active { transform:scale(.995); }
.payment-copy-value:focus-visible { outline:3px solid color-mix(in srgb,var(--primary) 22%,transparent); outline-offset:2px; }
.payment-copy-value span:first-child { min-width:0; }
.payment-copy-value small { display:block; margin-bottom:2px; color:var(--text-muted); font-size:.64rem; font-weight:650; }
.payment-copy-value strong { display:block; overflow:hidden; color:var(--text); font-size:.8rem; font-variant-numeric:tabular-nums; text-overflow:ellipsis; white-space:nowrap; }
.payment-copy-value span:last-child { flex:0 0 auto; color:var(--primary); font-size:.7rem; font-weight:800; }
.payment-limit-help { display: block; margin-top: 5px; color: var(--text-muted); font-size: .7rem; font-weight: 600; line-height: 1.4; }
.payment-limit-help[hidden] { display: none !important; }
.checkout-steps .payment-proof-field { padding: 11px 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--bg); }
.payment-proof-field > span { color: var(--text-muted); font-weight: 500; }
.checkout-steps .payment-proof-field input { padding: 8px; border-width: 1px; background: var(--bg-card); }
.payment-proof-field small { display: block; margin-top: 5px; color: var(--text-muted); font-size: .68rem; font-weight: 500; line-height: 1.4; }
.payment-proof-field small a { color: var(--primary); }

.order-result { padding: 24px 16px; text-align: center; }
.order-result h2 { font-size: 1.3rem; margin-bottom: 8px; color: var(--success); }
.order-receipt { margin: 14px 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); text-align: left; }
.order-receipt-items { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.order-receipt-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: .8rem; }
.order-receipt-item > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.order-receipt-item strong { line-height: 1.35; }
.order-receipt-item small { color: var(--text-muted); font-size: .7rem; line-height: 1.35; }
.order-receipt-item > span { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-receipt-totals { display: grid; gap: 4px; padding: 10px 0; }
.order-receipt-totals > div, .order-receipt-payment { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-secondary); font-size: .74rem; }
.order-receipt-totals strong, .order-receipt-payment strong { color: var(--text); font-variant-numeric: tabular-nums; }
.order-receipt-totals .is-total { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--text); font-size: .9rem; font-weight: 750; }
.order-receipt-payment { padding-top: 8px; border-top: 1px solid var(--border); }
.order-receipt-payment + .order-receipt-payment { margin-top: 7px; }
.order-receipt-proof { margin-top: 8px; padding: 6px 8px; border-radius: 7px; background: color-mix(in srgb, var(--success) 9%, var(--bg-card)); color: var(--success); font-size: .7rem; font-weight: 700; text-align: center; }
.epayco-result-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 12%, var(--bg-card)); color: var(--primary); font-size: 1.15rem; font-weight: 800; }
.order-result .epayco-result-title.is-error { color: var(--danger); }
.epayco-order-code { margin: 7px 0; color: var(--text); font-size: .95rem; font-weight: 750; }
.epayco-result-copy { max-width: 320px; margin: 8px auto 14px; color: var(--text-secondary); font-size: .82rem; line-height: 1.5; }
.epayco-retry { width: 100%; margin-top: 2px; }
.epayco-safe-note { margin-top: 11px; color: var(--text-muted); font-size: .7rem; line-height: 1.45; }
.epayco-payment-status { display: inline-flex; align-items: center; gap: 6px; margin: 5px auto 2px; padding: 6px 9px; border-radius: 8px; font-size: .72rem; font-weight: 750; }
.epayco-payment-status.is-pending { border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; }
.epayco-payment-status span { font-size: .55rem; }
.epayco-status-link { display: inline-flex; margin-top: 9px; color: var(--primary); font-size: .74rem; font-weight: 700; text-decoration: none; }
.epayco-status-link:hover { text-decoration: underline; }
input[data-money-input] { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.settings-module-tabs { display:flex; align-items:center; gap:4px; width:max-content; max-width:100%; margin:0 0 18px; padding:4px; overflow-x:auto; border:1px solid var(--border); border-radius:11px; background:var(--bg); }
.settings-module-tabs a { padding:8px 12px; border-radius:8px; color:var(--text-secondary); font-size:.76rem; font-weight:700; text-decoration:none; white-space:nowrap; transition:background .18s,color .18s; }
.settings-module-tabs a:hover { color:var(--text); background:var(--bg-card); }
.settings-module-tabs a.is-active { color:var(--primary); background:var(--bg-card); box-shadow:var(--shadow-xs); }

/* Delivery Fields */
.delivery-fields { display: none; margin-bottom: 10px; }
.delivery-fields.visible { display: block; }

/* Notice */
.notice { background: var(--bg-card); border-radius: var(--radius-lg); padding: 32px 20px; text-align: center; box-shadow: var(--shadow-sm); }
.notice h2 { font-size: 1.1rem; margin-bottom: 6px; }
.notice p { color: var(--text-secondary); margin-bottom: 14px; }

/* ============================================
   ADMIN
   ============================================ */

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 232px;
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s ease, transform 0.3s ease;
}

.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.admin-sidebar .brand { font-size: 1.25rem; font-weight: 800; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.sidebar-collapse-btn { background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.5); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.sidebar-collapse-btn svg { width: 16px; height: 16px; transition: transform 0.25s; }
.admin-sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.admin-sidebar p.sidebar-subtitle { font-size: 0.68rem; color: rgba(255,255,255,0.35); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-sep { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 3px 0; }

.admin-sidebar .button {
  background: rgba(255,255,255,0.06);
  color: var(--text-inverse);
  border-color: transparent;
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 9px 12px;
  font-size: 0.86rem;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.admin-sidebar .button:hover { background: var(--primary); color: #fff; }
.admin-sidebar .button.active { background: var(--primary); color: #fff; }
.admin-sidebar .button svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-bottom { margin-top: auto; }

/* Collapsed sidebar */
.admin-sidebar.collapsed { width: 64px; padding: 16px 10px; }
.admin-sidebar.collapsed .brand,
.admin-sidebar.collapsed .sidebar-subtitle,
.admin-sidebar.collapsed .btn-label { display: none; }
.admin-sidebar.collapsed .button { justify-content: center; padding: 10px; gap: 0; }
.admin-sidebar.collapsed .button svg { margin-right: 0; }
.admin-sidebar.collapsed .sidebar-top { flex-direction: column; align-items: center; }
.admin-sidebar.collapsed .brand { font-size: 1rem; }
.admin-sidebar.collapsed .sidebar-collapse-btn { width: 32px; height: 32px; }
.admin-sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.admin-sidebar.collapsed hr.sidebar-sep { margin: 4px 0; }

.admin-main { flex: 1; width: calc(100% - 232px); margin-left: 232px; padding: 24px 28px; max-width: none; transition: margin-left 0.25s ease, width 0.25s ease; }
.admin-main.single { margin-left: 232px; display: flex; align-items: center; justify-content: center; max-width: 560px; }
.admin-sidebar.collapsed ~ .admin-main { width: calc(100% - 64px); margin-left: 64px; }

/* Admin Mobile Topbar */
.admin-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-dark);
  color: #fff;
  padding: 10px 16px;
  align-items: center;
  gap: 12px;
}

.admin-topbar .hamburger {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.admin-topbar .hamburger svg { width: 20px; height: 20px; }
.admin-topbar .brand-mobile { font-size: 1rem; font-weight: 700; color: var(--primary); flex: 1; }
.admin-topbar .admin-link-mobile {
  color: rgba(255,255,255,0.7);
  font-size: 0.7rem;
  padding: 5px 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.025em; font-weight: 750; text-wrap: balance; }
.stats { display: flex; gap: 16px; }
.stats span { font-size: 0.8rem; color: var(--text-secondary); }
.stats strong { color: var(--text); font-weight: 700; }

.admin-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.admin-card h2 { font-size: 1.08rem; font-weight: 700; margin-bottom: 14px; }

/* Forms */
.product-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-form label { display: flex; flex-direction: column; gap: 3px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.product-form input, .product-form textarea, .product-form select {
  padding: 9px 11px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}
.product-form input:focus, .product-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); background: var(--bg-card); }
.product-form .wide { grid-column: 1 / -1; }

.switches { display: flex; flex-wrap: wrap; gap: 14px; }
.switches label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 500; cursor: pointer; }
.switches input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

.form-actions { display: flex; gap: 8px; margin-top: 6px; }

/* Table */
.table-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.table-tools input { padding: 9px 12px; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: 0.8rem; max-width: 220px; }
.table-tools input:focus { outline: none; border-color: var(--primary); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.admin-table th { text-align: left; padding: 8px 10px; background: var(--bg); font-weight: 600; color: var(--text-secondary); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.admin-table td strong { font-weight: 600; }
.admin-table td small { display: block; color: var(--text-muted); font-size: 0.7rem; }

.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions a { font-size: 0.75rem; font-weight: 600; color: var(--primary); }
.row-actions button { font-size: 0.7rem; color: var(--danger); background: none; border: none; font-weight: 600; }

/* Status Badges */
.status { display: inline-block; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; }
.status.on { background: #dcfce7; color: var(--success); }
.status.off { background: #fee2e2; color: var(--danger); }
.status.pending { background: #fef3c7; color: #92400e; }
.status.preparing { background: #dbeafe; color: #1d4ed8; }
.status.ready { background: #dcfce7; color: var(--success); }
.status.completed { background: #f3f4f6; color: #6b7280; }
.status.cancelled { background: #fee2e2; color: var(--danger); }

/* Alerts */
.alert { padding: 10px 14px; border-radius: var(--radius-md); margin-bottom: 14px; font-size: 0.85rem; font-weight: 500; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.warning { background: #fef3c7; color: #92400e; }
.alert.info { background: #e0f2fe; color: #075985; }

/* Order Cards */
.orders-list { display: grid; gap: 12px; }
.order-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); border-left: 4px solid var(--primary); }
.order-card:hover { box-shadow: var(--shadow-md); }
.order-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.order-card header strong { font-size: 0.95rem; }
.order-card ul { list-style: none; margin: 8px 0; }
.order-card li { padding: 3px 0; font-size: 0.85rem; }
.order-card li small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.order-card .order-notes { font-size: 0.8rem; color: var(--text-secondary); background: var(--bg); padding: 6px 10px; border-radius: var(--radius-sm); margin: 6px 0; }
.order-card footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border-light); }
.order-card footer span { font-size: 0.75rem; color: var(--text-muted); }
.order-card footer strong { font-size: 1rem; font-weight: 700; color: var(--primary); }

/* Kitchen Display System */
.kds-header { background: var(--bg-dark); color: #fff; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.kds-header h1 { font-size: 1.1rem; font-weight: 700; }
.kds-stats { display: flex; gap: 12px; }
.kds-stat { font-size: 0.8rem; background: rgba(255,255,255,0.1); padding: 5px 12px; border-radius: var(--radius-full); }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 20px; }
.kds-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-md); border-top: 4px solid var(--border); transition: transform var(--transition-base); }
.kds-card:hover { transform: translateY(-2px); }
.kds-card.pending { border-top-color: var(--warning); }
.kds-card.preparing { border-top-color: var(--info); }
.kds-card.ready { border-top-color: var(--success); }
.kds-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.kds-order-code { font-size: 1rem; font-weight: 800; }
.kds-timer { font-size: 0.75rem; color: var(--text-muted); background: var(--bg); padding: 2px 8px; border-radius: var(--radius-full); }
.kds-customer { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 10px; }
.kds-items { list-style: none; margin-bottom: 10px; }
.kds-items li { padding: 3px 0; font-size: 0.85rem; }
.item-qty { font-weight: 700; color: var(--primary); }
.item-mods { display: block; font-size: 0.7rem; color: var(--text-muted); padding-left: 24px; }
.kds-notes { font-size: 0.8rem; color: var(--text-secondary); background: #fef3c7; padding: 6px 10px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.kds-actions { display: flex; gap: 6px; }
.kds-btn { padding: 8px 14px; border: none; border-radius: var(--radius-md); font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.kds-btn:hover { transform: translateY(-1px); }
.kds-btn.accept { background: var(--info); color: #fff; }
.kds-btn.ready { background: var(--success); color: #fff; }
.kds-btn.complete { background: var(--accent); color: #fff; }
.kds-btn.cancel { background: var(--bg); color: var(--danger); border: 1px solid var(--border); }

/* Stock Badges */
.stock-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; }
.stock-badge.ok { background: #dcfce7; color: #166534; }
.stock-badge.low { background: #fef3c7; color: #92400e; }
.stock-badge.out { background: #fee2e2; color: #991b1b; }
.stock-bar { display: flex; align-items: center; gap: 6px; }

/* Query Box */
.query-box { margin-top: 14px; }
.query-box summary { font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }
.query-box pre { background: var(--bg); padding: 14px; border-radius: var(--radius-md); font-size: 0.75rem; overflow-x: auto; margin-top: 6px; line-height: 1.5; }

/* ============================================
   STATS & RECIPE MODULES
   ============================================ */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }

.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card.sales::before { background: var(--primary); }
.stat-card.costs::before { background: var(--secondary); }
.stat-card.profit::before { background: var(--success); }
.stat-card.orders::before { background: var(--accent); }
.stat-card.stock::before { background: var(--info); }
.stat-card.waste::before { background: var(--danger); }
.stat-card .stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-card .stat-change { font-size: 0.75rem; margin-top: 3px; }
.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }

/* Time Window Tabs */
.window-tabs { display: flex; gap: 3px; background: var(--bg); padding: 3px; border-radius: var(--radius-md); margin-bottom: 16px; }
.window-tab { flex: 1; padding: 8px; border: none; background: transparent; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.8rem; color: var(--text-secondary); text-align: center; text-decoration: none; transition: background var(--transition-fast), color var(--transition-fast); }
.window-tab:hover { color: var(--text); }
.window-tab.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-xs); }

/* Recipe Module */
.recipe-card { background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); margin-bottom: 10px; }
.recipe-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; transition: background var(--transition-fast); }
.recipe-header:hover { background: var(--bg); }
.recipe-header h3 { font-size: 0.9rem; font-weight: 600; }
.recipe-header .recipe-cost { font-size: 0.8rem; color: var(--primary); font-weight: 700; }
.recipe-body { padding: 0 16px 14px; display: none; }
.recipe-body.open { display: block; }

.ingredient-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.ingredient-row:last-child { border-bottom: none; }
.ingredient-name { flex: 1; font-size: 0.8rem; font-weight: 500; }
.ingredient-qty { font-size: 0.75rem; color: var(--text-secondary); min-width: 70px; text-align: right; }
.ingredient-cost { font-size: 0.75rem; font-weight: 600; color: var(--primary); min-width: 60px; text-align: right; }

/* Waste Summary */
.waste-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.waste-item { background: var(--bg); border-radius: var(--radius-md); padding: 14px; text-align: center; }
.waste-item .waste-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 3px; }
.waste-item .waste-value { font-size: 1.2rem; font-weight: 700; }
.waste-item.merma .waste-value { color: var(--warning); }
.waste-item.desperdicio .waste-value { color: var(--danger); }

/* ============================================
   ADMIN STANDARDIZED STYLES
   ============================================ */

/* Standard form inputs across all admin pages */
.admin-input, .admin-main input[type="text"], .admin-main input[type="email"], .admin-main input[type="tel"], .admin-main input[type="number"], .admin-main input[type="url"], .admin-main input[type="password"], .admin-main input[type="date"], .admin-main input[type="datetime-local"], .admin-main textarea, .admin-main select {
  padding: 9px 12px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.87rem !important;
  background: var(--bg) !important;
  line-height: 1.4 !important;
  min-height: 40px !important;
  transition: border-color var(--transition-fast) !important;
}
.admin-main input:focus, .admin-main textarea:focus, .admin-main select:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 10%, transparent) !important;
  background: #fff !important;
}
.admin-main label {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  margin-bottom: 2px !important;
}

/* Standard buttons */
.admin-main button, .admin-main .btn {
  min-height: 40px !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: none !important;
  transition: all var(--transition-fast) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  touch-action: manipulation !important;
}
.admin-main button:active, .admin-main .btn:active { transform: scale(0.97) !important; }

/* Standard stat cards */
.admin-main .stats-grid, .admin-main .stat-card {
  font-size: 0.87rem !important;
}
.admin-main .stat-value {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
}
.admin-main .stat-label {
  font-size: 0.74rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}

/* Standard table */
.admin-main table {
  font-size: 0.86rem !important;
}
.admin-main th {
  font-size: 0.75rem !important;
  padding: 10px 12px !important;
}
.admin-main td {
  padding: 11px 12px !important;
  vertical-align: middle !important;
}

/* Shared admin scale and density: slightly larger content, better use of wide
   screens, and one consistent rhythm across cards, lists and custom modules. */
.admin-main .alert { font-size: 0.9rem; padding: 12px 16px; }
.admin-main .table-tools { margin-bottom: 12px; }
.admin-main .status,
.admin-main .stock-badge { font-size: 0.75rem; padding: 3px 9px; }
.admin-main .dash-card,
.admin-main .stat-box,
.admin-main .edit-panel,
.admin-main .mod-panel { background: var(--bg-card); }
.admin-main .mini-order,
.admin-main .ingredient-row { min-height: 44px; }
.admin-main .row-actions { gap: 8px; }
.admin-main .row-actions a,
.admin-main .row-actions button { font-size: 0.8rem !important; }

/* Normalize the compact, page-specific modules to the same readable scale. */
.admin-main .dash-card h3,
.admin-main .cust-name,
.admin-main .ing-nm,
.admin-main .group-card-title,
.admin-main .product-card-body strong { font-size: 0.9rem !important; }
.admin-main .dash-card .big { font-size: 1.75rem !important; line-height: 1.15; }
.admin-main .dash-card .sub,
.admin-main .quick-link,
.admin-main .mini-order .name,
.admin-main .pay-method,
.admin-main .group-card-meta,
.admin-main .option-pill,
.admin-main .product-chip { font-size: 0.86rem !important; }
.admin-main .cust-phone,
.admin-main .cust-stats,
.admin-main .detail-grid,
.admin-main .ing-sub,
.admin-main .inv-cats a,
.admin-main .pan-tab,
.admin-main .pan-row,
.admin-main .pf label,
.admin-main .product-card-body .cat { font-size: 0.78rem !important; }
.admin-main .stat-box .val { font-size: 1.45rem !important; font-variant-numeric: tabular-nums; }
.admin-main .stat-box .lbl,
.admin-main .cust-group,
.admin-main .ing-pill,
.admin-main .product-card-badges span { font-size: 0.7rem !important; }
.admin-main .cust-avatar { width: 40px; height: 40px; font-size: 0.88rem; }
.admin-main .cust-card,
.admin-main .ing-item,
.admin-main .group-card { padding: 13px 14px; }
.admin-main .product-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.admin-main .product-card-body { padding: 14px; }
.admin-main .product-card-footer { padding: 0 14px 14px; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .admin-topbar { display: flex; }
  .sidebar-collapse-btn { display: none !important; }
  .admin-sidebar { transform: translateX(-100%); z-index: 60; width: 260px; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar.collapsed { width: 260px; padding: 16px 12px; }
  .admin-sidebar.collapsed .brand,
  .admin-sidebar.collapsed .sidebar-subtitle,
  .admin-sidebar.collapsed .btn-label { display: block; }
  .admin-sidebar.collapsed .button { justify-content: flex-start; padding: 8px 10px; gap: 8px; }
  .admin-main { width: 100%; margin-left: 0; padding: 16px; }
  .admin-main.single { margin-left: 0; }
  .admin-layout { flex-direction: column; }
  .product-form { grid-template-columns: 1fr; }
  .kds-grid { grid-template-columns: 1fr; padding: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .waste-summary { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .shop-topbar { gap: 6px; padding-inline: 10px; }
  .shop-topbar .brand { max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
  .shop-topbar .search-wrap input { height: 38px; font-size: .8rem; }
  .shop-topbar .admin-link { padding-inline: 5px; font-size: .64rem; }
  .shop-controls { top: 53px; }
  .shop-intro h1 { font-size: 1rem; }
  .shop-photo { width: 56px; height: 56px; }
  .stats-grid { grid-template-columns: 1fr; }
  .step-indicator { padding: 8px 16px; }
}

/* Desktop */
@media (min-width: 1025px) {
  .shop-shell { max-width: 640px; }
  .admin-topbar { display: none !important; }
  .admin-sidebar { width: 232px; transform: none !important; }
  .admin-sidebar.collapsed { width: 64px; }
  .admin-main { width: calc(100% - 232px); margin-left: 232px; padding: 24px 28px; }
  .admin-sidebar.collapsed ~ .admin-main { width: calc(100% - 64px); margin-left: 64px; }
  .admin-main.single { margin-left: 232px; }
}

/* --- Apple / iOS Fixes --- */
@supports (-webkit-touch-callout: none) {
  body { -webkit-text-size-adjust: 100%; }
  .drawer { -webkit-overflow-scrolling: touch; }
  .drawer-scroll { -webkit-overflow-scrolling: touch; }
  .shop-shell { -webkit-overflow-scrolling: touch; }
  .cart-bar { padding-bottom: env(safe-area-inset-bottom); }
  .drawer-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .icon-button { min-width: 44px; min-height: 44px; }
  .icon-button svg { width: 22px; height: 22px; }
}

/* Prevent body scroll when drawer is open */
body.drawer-open { overflow: hidden; position: fixed; width: 100%; }

/* Admin sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 55;
}
.sidebar-overlay.active { display: block; }

/* Hide banner scrollbar */
.banners-scroll::-webkit-scrollbar { display: none; }
.banners-scroll { scrollbar-width: none; }

/* ============================================
   ADMIN SYSTEM — 2026 CONSOLIDATED UI
   ============================================ */
.admin-layout { background: #f3f5f8; }
.admin-sidebar {
  width: 252px;
  padding: 14px 14px 16px;
  gap: 0;
  background:
    radial-gradient(circle at 30% 0%, rgba(255,255,255,.07), transparent 32%),
    #171827;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 14px 0 34px rgba(20, 22, 40, .08);
}
.sidebar-brand-area { position: relative; display: flex; justify-content: center; flex: 0 0 auto; padding: 0 0 12px; }
.brand-lockup {
  width: 166px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 10px;
  color: #fff;
  text-align: center;
  border-radius: 20px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}
.brand-lockup:hover { color: #fff; background: rgba(255,255,255,.075); transform: translateY(-1px); }
.brand-logo { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 18px; background: #fff; box-shadow: 0 12px 28px rgba(4,6,18,.24); overflow: hidden; flex-shrink: 0; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.brand-monogram { color: var(--primary); font-size: 2rem; font-weight: 800; letter-spacing: -.06em; }
.brand-title { max-width: 146px; font-size: 1.02rem; line-height: 1.05; font-weight: 750; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-lockup small { color: rgba(255,255,255,.5); font-size: .62rem; line-height: 1; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-collapse-btn { position: absolute; top: 4px; right: -5px; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; backdrop-filter: blur(8px); }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; padding: 2px 0 10px; }
.sidebar-section-label { padding: 12px 11px 4px; color: rgba(255,255,255,.35); font-size: .63rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.admin-sidebar .button { min-height: 42px; padding: 9px 11px; gap: 10px; border-radius: 10px; background: transparent; color: rgba(255,255,255,.72); font-size: .85rem; font-weight: 560; justify-content: flex-start; text-align: left; }
.admin-sidebar .btn-label { flex: 1; min-width: 0; text-align: left; }
.admin-sidebar .button:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(2px); }
.admin-sidebar .button.active { color: #fff; background: var(--primary); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 28%, transparent); }
.admin-sidebar .button.active::after { content: ''; width: 4px; height: 18px; border-radius: 4px; background: #fff; margin-left: auto; opacity: .78; }
.admin-sidebar .button svg { width: 19px; height: 19px; }
.sidebar-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer .store-link { margin-bottom: 8px; }
.sidebar-account { display: grid; grid-template-columns: 36px minmax(0,1fr) 28px; align-items: center; gap: 9px; min-height: 52px; padding: 7px; border-radius: 12px; background: rgba(255,255,255,.05); }
.sidebar-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--primary) 22%, #fff); color: #fff; font-size: .7rem; font-weight: 800; }
.sidebar-account-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-account-copy strong { color: #fff; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account-copy small { color: rgba(255,255,255,.43); font-size: .64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { width: 28px; height: 28px; display: grid; place-items: center; color: rgba(255,255,255,.5); border-radius: 8px; font-size: .9rem; transform: rotate(45deg); }
.sidebar-logout:hover { color: #fff; background: rgba(255,255,255,.1); }

.admin-main { width: calc(100% - 252px); margin-left: 252px; padding: 30px clamp(22px, 3vw, 46px) 50px; background: radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 30%), #f3f5f8; }
.admin-header { min-height: 64px; margin-bottom: 22px; }
.admin-header h1 { font-size: clamp(1.65rem, 2vw, 2rem); letter-spacing: -.04em; font-weight: 780; }
.admin-page-heading p, .admin-header > div > p { max-width: 62ch; margin-top: 4px; color: var(--text-secondary); font-size: .9rem; }
.page-eyebrow { display: block; margin-bottom: 5px; color: var(--primary); font-size: .67rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.admin-card { padding: 22px 24px 25px; border: 1px solid #e6e9ef; border-radius: 16px; box-shadow: 0 1px 2px rgba(28,31,48,.04), 0 10px 32px rgba(28,31,48,.035); }
.admin-card h2 { font-size: 1.12rem; letter-spacing: -.018em; }
.admin-main table { font-variant-numeric: tabular-nums; }
.admin-main th { background: #f7f8fa !important; color: #6c7384 !important; }
.admin-main tbody tr { transition: background-color .16s ease; }
.admin-main tbody tr:hover { background: #fafbfc; }
.admin-main .button, .admin-main button { border-radius: 10px !important; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 2px; }
.section-heading p { color: var(--text-secondary); font-size: .82rem; }
.text-link { color: var(--primary); font-size: .8rem; font-weight: 700; }
.danger-outline { color: var(--danger) !important; border-color: color-mix(in srgb, var(--danger) 28%, transparent) !important; background: transparent !important; }

/* Authentication */
.auth-body { min-height: 100dvh; background: #f0f2f6; }
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, .82fr) minmax(460px, 1.18fr); }
.auth-identity { min-height: 100%; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 50px; color: #fff; background: radial-gradient(circle at 15% 8%, color-mix(in srgb, var(--primary) 38%, transparent), transparent 35%), #171827; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: #fff; font-size: 1.15rem; font-weight: 750; }
.auth-brand:hover { color: #fff; }
.auth-brand img, .auth-brand-mark { width: 48px; height: 48px; border-radius: 13px; background: #fff; object-fit: contain; padding: 3px; }
.auth-brand-mark { display: grid; place-items: center; color: var(--primary); font-size: 1.25rem; }
.auth-identity h1 { max-width: 500px; margin: 12px 0 16px; font-size: clamp(2.3rem, 5vw, 4.6rem); line-height: .98; letter-spacing: -.065em; text-wrap: balance; }
.auth-identity p { max-width: 48ch; color: rgba(255,255,255,.64); font-size: 1rem; line-height: 1.7; }
.auth-kicker { color: var(--primary); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-store-link { color: rgba(255,255,255,.62); font-size: .82rem; font-weight: 650; }
.auth-store-link:hover { color: #fff; }
.auth-panel { display: grid; place-items: center; padding: clamp(24px, 5vw, 70px); }
.auth-card { width: min(100%, 460px); padding: clamp(26px, 4vw, 42px); background: #fff; border: 1px solid #e5e8ee; border-radius: 22px; box-shadow: 0 28px 70px rgba(29,31,48,.09); }
.auth-card h1, .auth-card h2 { margin: 7px 0 6px; font-size: 1.8rem; line-height: 1.15; letter-spacing: -.04em; }
.auth-card > p { color: var(--text-secondary); font-size: .88rem; }
.auth-form { display: grid; gap: 15px; margin-top: 24px; }
.auth-form label, .stack-form label, .role-fields label { display: grid; gap: 6px; color: #4e5565; font-size: .76rem; font-weight: 700; }
.auth-form input, .stack-form input, .stack-form select, .role-fields input { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #dce0e8; border-radius: 10px; background: #f9fafb; color: var(--text); }
.auth-form input:focus, .stack-form input:focus, .stack-form select:focus, .role-fields input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.auth-submit { width: 100%; min-height: 48px; margin-top: 4px; }
.auth-security { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-light); text-align: center; font-size: .7rem !important; }
.auth-actions { display: flex; gap: 8px; margin-top: 22px; }
.kds-nav-link { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; color: rgba(255,255,255,.78); font-size: .74rem; font-weight: 700; }
.kds-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Team and role administration */
.access-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.access-summary > div { display: flex; align-items: baseline; justify-content: space-between; min-height: 78px; padding: 17px 20px; background: #fff; border: 1px solid #e6e9ef; border-radius: 14px; }
.access-summary span { color: var(--text-secondary); font-size: .76rem; font-weight: 700; }
.access-summary strong { font-size: 1.65rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.access-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.access-editor-inline { position: relative; margin-bottom: 14px; border-left: 4px solid var(--primary); box-shadow: 0 14px 36px rgba(28,31,48,.07); }
.access-editor-inline[hidden] { display: none !important; }
.access-user-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.access-user-form label small { color: var(--text-muted); font-size: .67rem; font-weight: 500; }
.access-user-form .form-actions { grid-column: 1 / -1; margin-top: 4px; }
.access-user-list { display: grid; gap: 8px; }
.access-user { display: grid; grid-template-columns: 42px minmax(150px, 1fr) auto minmax(120px, auto) auto; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: #f8f9fb; border: 1px solid transparent; }
.access-user:hover { background: #fff; border-color: #e4e7ed; }
.access-user.is-inactive { opacity: .56; }
.access-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, #fff); font-size: .75rem; font-weight: 800; }
.access-user-main { min-width: 0; display: flex; flex-direction: column; }
.access-user-main strong { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.access-user-main span, .access-last { color: var(--text-secondary); font-size: .7rem; white-space: nowrap; }
.role-chip, .system-label { padding: 4px 8px; border-radius: 7px; background: #eceff4; color: #50586a; font-size: .66rem; font-weight: 750; }
.system-label { background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); }
.stack-form { display: grid; gap: 13px; margin-top: 18px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.role-card { min-height: 180px; display: flex; flex-direction: column; padding: 16px; border: 1px solid #e7eaf0; border-radius: 13px; background: #fafbfc; }
.role-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.role-card-top > div { display: flex; flex-direction: column; }
.role-card-top strong { font-size: .9rem; }
.role-card-top span:not(.system-label), .role-card > p { color: var(--text-secondary); font-size: .7rem; }
.role-card > p { margin: 10px 0; line-height: 1.5; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.permission-tags span { padding: 3px 6px; border-radius: 5px; background: #eef1f5; color: #5b6373; font-size: .61rem; }
.permission-tags em { color: var(--text-muted); font-size: .68rem; font-style: normal; }
.role-card .text-link { margin-top: auto; }
.role-fields { display: grid; grid-template-columns: .55fr 1fr; gap: 12px; margin-bottom: 18px; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin-bottom: 18px; }
.permission-option { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px !important; min-height: 58px; padding: 10px 12px; border: 1px solid #e4e7ed; border-radius: 11px; background: #fafbfc; cursor: pointer; }
.permission-option:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 36%, #e4e7ed); background: color-mix(in srgb, var(--primary) 5%, #fff); }
.permission-option input { width: 17px !important; height: 17px !important; accent-color: var(--primary); }
.permission-option span { display: flex; flex-direction: column; }
.permission-option strong { color: var(--text); font-size: .76rem; }
.permission-option small { color: var(--text-muted); font-size: .64rem; }
.form-note { color: var(--text-secondary); font-size: .78rem; }
.upload-help, .upload-size-error { display: block; margin-top: 5px; font-size: .69rem !important; line-height: 1.45; font-weight: 500 !important; }
.upload-help { color: var(--text-muted); }
.upload-help a { font-weight: 750; }
.upload-size-error { padding: 8px 10px; border-radius: 8px; color: #991b1b; background: #fee2e2; }
.upload-size-error a { color: #991b1b; font-weight: 800; text-decoration: underline; }
.role-editor[hidden] { display: none !important; }
.user-access-detail { margin-bottom: 14px; border-left: 4px solid var(--primary); }
.user-access-head { display: grid; grid-template-columns: 54px minmax(180px,1fr) auto auto; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--border-light); }
.user-access-head h2 { margin: 0 0 2px; }
.user-access-head p { color: var(--text-secondary); font-size: .76rem; }
.access-avatar-large { width: 54px; height: 54px; font-size: .9rem; }
.effective-permissions { padding-top: 17px; }
.effective-permissions > strong { display: block; margin-bottom: 10px; font-size: .8rem; }
.permission-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 8px; }
.permission-detail-grid > div { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 9px 11px; border-radius: 10px; background: #f7f9fb; }
.permission-detail-grid > div > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); font-size: .72rem; font-weight: 800; }
.permission-detail-grid p { display: flex; flex-direction: column; line-height: 1.25; }
.permission-detail-grid strong { font-size: .74rem; }
.permission-detail-grid small { color: var(--text-muted); font-size: .63rem; }
.empty-permissions { grid-column: 1/-1; padding: 12px; border-radius: 9px; background: #f7f8fa; color: var(--text-secondary); font-size: .76rem; }

@media (min-width: 1025px) {
  .admin-sidebar { width: 252px; }
  .admin-main { width: calc(100% - 252px); margin-left: 252px; }
  .admin-sidebar.collapsed { width: 72px; padding-inline: 9px; }
  .admin-sidebar.collapsed ~ .admin-main { width: calc(100% - 72px); margin-left: 72px; }
  .admin-sidebar.collapsed .sidebar-brand-area { padding-bottom: 12px; }
  .admin-sidebar.collapsed .brand-lockup { width: 48px; height: 54px; padding: 5px; background: transparent; border-color: transparent; }
  .admin-sidebar.collapsed .brand-logo { width: 42px; height: 42px; border-radius: 11px; }
  .admin-sidebar.collapsed .brand-title,
  .admin-sidebar.collapsed .brand-lockup small,
  .admin-sidebar.collapsed .sidebar-section-label,
  .admin-sidebar.collapsed .sidebar-account-copy,
  .admin-sidebar.collapsed .sidebar-logout { display: none; }
  .admin-sidebar.collapsed .sidebar-collapse-btn { top: 55px; right: 9px; }
  .admin-sidebar.collapsed .button { justify-content: center; padding: 9px; }
  .admin-sidebar.collapsed .button.active::after { display: none; }
  .admin-sidebar.collapsed .sidebar-account { display: flex; justify-content: center; padding: 6px; }
}

@media (max-width: 1100px) {
  .access-layout { grid-template-columns: 1fr; }
  .access-editor { position: static; }
  .access-user { grid-template-columns: 42px minmax(150px, 1fr) auto; }
  .access-last { display: none; }
  .access-user .row-actions { grid-column: 2 / -1; }
}

@media (max-width: 1024px) {
  .admin-sidebar, .admin-sidebar.collapsed { width: min(286px, 86vw); padding: 14px; }
  .admin-main, .admin-sidebar.collapsed ~ .admin-main { width: 100%; margin-left: 0; }
  .sidebar-brand-area { padding-top: 5px; }
  .admin-sidebar.collapsed .brand-lockup { display: flex; }
  .admin-sidebar.collapsed .sidebar-section-label { display: block; }
  .admin-sidebar.collapsed .sidebar-account-copy, .admin-sidebar.collapsed .sidebar-logout { display: flex; }
  .admin-topbar { min-height: 60px; padding: 9px 14px; box-shadow: 0 8px 24px rgba(20,22,40,.12); }
  .admin-topbar .brand-mobile { display: flex; align-items: center; gap: 8px; color: #fff; }
  .admin-topbar .brand-mobile img { width: 34px; height: 34px; padding: 2px; border-radius: 9px; background: #fff; object-fit: contain; }
  .admin-main { padding: 22px 18px 40px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-identity { min-height: auto; padding: 28px; gap: 28px; }
  .auth-identity h1 { font-size: 2.5rem; }
  .auth-store-link { display: none; }
}

@media (max-width: 640px) {
  .admin-main { padding: 18px 12px 34px; }
  .admin-card { padding: 18px 16px 21px; border-radius: 14px; }
  .auth-panel { padding: 16px; }
  .auth-card { padding: 24px 20px; border-radius: 17px; }
  .auth-identity { padding: 24px 20px; }
  .auth-identity h1 { font-size: 2rem; }
  .access-summary { grid-template-columns: 1fr; }
  .access-summary > div { min-height: 62px; }
  .access-user { grid-template-columns: 42px minmax(0, 1fr); }
  .access-user .role-chip { justify-self: start; grid-column: 2; }
  .access-user .row-actions { grid-column: 1 / -1; }
  .user-access-head { grid-template-columns: 54px minmax(0,1fr); }
  .user-access-head > .role-chip { grid-column: 2; justify-self: start; }
  .user-access-head > .row-actions { grid-column: 1/-1; }
  .access-user-form { grid-template-columns: 1fr; }
  .access-user-form .form-actions { grid-column: 1; flex-direction: column; }
  .access-user-form .form-actions .button { width: 100%; }
  .role-fields { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; }
}

/* Team access: deterministic tabs, visible users and editable permissions */
.access-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: -2px 0 16px;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #e3e7ed;
  border-radius: 13px;
  background: #eef1f5;
}
.access-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 9px;
  color: #626a7a;
  font-size: .8rem;
  font-weight: 750;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.access-tabs a:hover { color: var(--text); background: rgba(255,255,255,.62); }
.access-tabs a.is-active { color: var(--text); background: #fff; box-shadow: 0 1px 3px rgba(28,31,48,.1); }
.access-tabs strong {
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 7px;
  background: #e9edf2;
  color: #596172;
  font-size: .68rem;
}
.access-tabs a.is-active strong { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, #fff); }
.access-form-panel { margin-bottom: 16px; border-left: 4px solid var(--primary); box-shadow: 0 14px 38px rgba(28,31,48,.075); }
.team-users-panel { overflow: hidden; }
.team-user-list { display: grid; gap: 10px; }
.team-user-row {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(240px, 1fr) auto;
  grid-template-areas: "identity meta actions" "permissions permissions permissions";
  align-items: center;
  gap: 14px 18px;
  padding: 16px;
  border: 1px solid #e4e8ee;
  border-radius: 14px;
  background: #fafbfc;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.team-user-row:hover { border-color: #d7dce5; background: #fff; box-shadow: 0 8px 24px rgba(28,31,48,.045); }
.team-user-row.is-inactive { background: #f5f6f8; }
.team-user-row.is-inactive .team-user-identity, .team-user-row.is-inactive .team-user-permissions { opacity: .62; }
.team-user-identity { grid-area: identity; min-width: 0; display: flex; align-items: center; gap: 12px; }
.team-user-identity > div:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.team-user-identity strong { overflow: hidden; color: var(--text); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.team-user-identity span { overflow: hidden; color: var(--text-secondary); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.team-user-meta { grid-area: meta; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.team-user-meta > span:last-child { width: 100%; color: var(--text-muted); font-size: .69rem; }
.access-state { padding: 4px 8px; border-radius: 7px; color: #7b5260; background: #f4e8ec; font-size: .66rem; font-weight: 750; }
.access-state.is-active { color: #277158; background: #e4f4ed; }
.team-user-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.team-user-actions form { margin: 0; }
.team-user-permissions { grid-area: permissions; padding-top: 13px; border-top: 1px solid #e7eaf0; }
.permission-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.permission-preview-head strong { color: #545c6c; font-size: .72rem; }
.permission-preview-head a { color: var(--primary); font-size: .69rem; font-weight: 750; text-decoration: none; }
.permission-preview-head a:hover { text-decoration: underline; }
.team-user-permissions .permission-tags, .role-card .permission-tags { margin-bottom: 0; }
.team-user-permissions .permission-tags span, .role-card .permission-tags span { padding: 5px 8px; border-radius: 7px; background: #edf1f5; color: #535c6d; font-size: .66rem; font-weight: 650; }
.role-editor-panel .permission-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.permission-option { min-height: 64px; }
.permission-option.is-protected { border-style: dashed; }
.permission-option.is-protected input { opacity: .78; }
.access-protection-note { margin: -3px 0 17px; padding: 10px 12px; border: 1px solid #dce7f6; border-radius: 10px; color: #405b7c; background: #f1f6fc; line-height: 1.45; }
.access-roles .role-card { min-height: 205px; }
.access-roles .role-card > .button { align-self: flex-start; margin-top: auto; }
.access-audit-panel { overflow: hidden; }
.audit-filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin: 2px 0 18px; padding: 12px; border: 1px solid #e4e8ee; border-radius: 12px; background: #fafbfc; }
.audit-filter-bar label { min-width: 190px; display: grid; gap: 5px; color: var(--text-secondary); font-size: .7rem; font-weight: 750; }
.audit-filter-bar select { min-height: 40px; padding: 8px 34px 8px 10px; border: 1px solid #dfe4eb; border-radius: 9px; background: #fff; color: var(--text); font: inherit; font-size: .76rem; }
.audit-filter-bar .button { min-height: 40px; }
.audit-list { display: grid; border: 1px solid #e4e8ee; border-radius: 13px; overflow: hidden; }
.audit-row { display: grid; grid-template-columns: minmax(210px,.85fr) minmax(260px,1.35fr) minmax(130px,.55fr) minmax(150px,.65fr); align-items: center; gap: 16px; min-height: 72px; padding: 11px 14px; border-bottom: 1px solid #e8ebf0; background: #fff; }
.audit-row:last-child { border-bottom: 0; }
.audit-row:hover { background: #fafbfc; }
.audit-user { min-width: 0; display: flex; align-items: center; gap: 10px; }
.audit-user .access-avatar { width: 36px; height: 36px; flex: 0 0 36px; font-size: .72rem; }
.audit-user > span:last-child, .audit-movement { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.audit-user strong, .audit-movement strong { overflow: hidden; color: var(--text); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.audit-user small, .audit-movement small { overflow: hidden; color: var(--text-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.audit-module { justify-self: start; padding: 5px 8px; border-radius: 7px; background: #edf1f5; color: #535c6d; font-size: .66rem; font-weight: 700; }
.audit-row time { color: var(--text-muted); font-size: .69rem; font-variant-numeric: tabular-nums; text-align: right; }

@media (max-width: 980px) {
  .team-user-row {
    grid-template-columns: minmax(210px, 1fr) auto;
    grid-template-areas: "identity actions" "meta meta" "permissions permissions";
  }
  .audit-row { grid-template-columns: minmax(200px,.8fr) minmax(240px,1.2fr) minmax(130px,.55fr); }
  .audit-row time { grid-column: 2 / -1; text-align: left; }
}

@media (max-width: 640px) {
  .access-tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .access-tabs::-webkit-scrollbar { display: none; }
  .access-tabs a { flex: 0 0 auto; min-width: max-content; padding-inline: 11px; }
  .team-user-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "identity" "meta" "permissions" "actions";
    padding: 14px;
  }
  .team-user-actions { justify-content: flex-start; flex-wrap: wrap; }
  .team-user-actions .button { min-height: 40px; }
  .permission-preview-head { align-items: flex-start; }
  .role-editor-panel .permission-grid { grid-template-columns: 1fr; }
  .audit-filter-bar { align-items: stretch; }
  .audit-filter-bar label, .audit-filter-bar .button { width: 100%; min-width: 0; }
  .audit-row { grid-template-columns: 1fr; gap: 8px; padding: 13px; }
  .audit-row time { grid-column: auto; text-align: left; }
}

/* Inline recipe editing */
.recipe-inline-table td { vertical-align: middle; }
.recipe-inline-table td > small { display: block; margin-top: 3px; color: var(--text-muted); font-size: .64rem; }
.recipe-row-editing { background: color-mix(in srgb, var(--primary) 4%, #fff); }
.recipe-row-editing td { padding-top: 6px !important; padding-bottom: 6px !important; }
.recipe-cell-control {
  width: 100%;
  min-width: 82px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #d8dde5;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
.recipe-cell-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.recipe-inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.recipe-save-check, .recipe-cancel-edit {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 850;
  text-decoration: none;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}
.recipe-save-check { border: 1px solid #b9ddcf; background: #eaf7f1; color: #19704f; cursor: pointer; }
.recipe-save-check:hover { border-color: #8bc9b2; background: #dcf2e9; transform: translateY(-1px); }
.recipe-cancel-edit { border: 1px solid #dfe3e9; background: #fff; color: #687181; }
.recipe-cancel-edit:hover { background: #f2f4f7; transform: translateY(-1px); }
.recipe-row-saved { animation: recipeSavedFlash 1.8s ease both; }
.recipe-saved-badge, .recipe-cost-saved { display: inline-flex !important; align-items: center; width: fit-content; margin: 0 0 0 7px !important; padding: 3px 6px; border-radius: 6px; background: #e8f6ef; color: #247356 !important; font-size: .62rem !important; font-weight: 800; }
.recipe-cost-updated { border-color: #b9ddcf !important; }
.recipe-cost-saved { position: relative; z-index: 1; margin: 5px 0 0 !important; }
.recipe-inline-save-status { color: #247356; font-size: .62rem; font-weight: 750; }
.recipe-save-check.is-saved { border-color: #78bfa4; background: #d8f0e6; }
.compact-recipe-form { grid-template-columns: minmax(180px,1.7fr) minmax(95px,.65fr) minmax(130px,.8fr) minmax(95px,.6fr) auto; align-items: end; gap: 9px; }
.compact-recipe-form .form-actions { grid-column: auto; margin: 0; }
.compact-recipe-form .form-actions .button { min-height: 42px; white-space: nowrap; }
.table-tools-note { margin-top: 2px; color: var(--text-muted); font-size: .69rem; }
.costs-quick-table .button.small { min-height: 29px; padding: 4px 8px; border-radius: 7px; font-size: .68rem; line-height: 1; white-space: nowrap; }
@keyframes recipeSavedFlash {
  0% { background: #dff4e9; }
  100% { background: transparent; }
}

@media (max-width: 760px) {
  .recipe-inline-table { min-width: 760px; }
  .ingredient-inline-table { min-width: 680px; }
  .compact-recipe-form { grid-template-columns: 1fr 1fr; }
  .compact-recipe-form .form-actions { grid-column: 1 / -1; }
}

/* Kitchen display — readable at counter and wall-screen distance */
body.kds-page {
  min-height: 100dvh;
  margin: 0;
  color: #20252d;
  background: #eef0f2;
  font-family: 'DM Sans', sans-serif;
}
.kds-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.kds-icon { width: 1em; height: 1em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kds-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 2.4vw, 34px);
  color: #fff;
  background: #20242b;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 30px rgba(28,32,39,.16);
}
.kds-brand-block, .kds-header-right, .kds-brand, .kds-stats, .kds-header-nav { display: flex; align-items: center; }
.kds-brand-block { gap: 20px; min-width: 0; }
.kds-brand { gap: 9px; padding-right: 20px; border-right: 1px solid rgba(255,255,255,.14); color: #fff; font-size: .9rem; font-weight: 800; text-decoration: none; }
.kds-brand:hover { color: #fff; }
.kds-brand img, .kds-brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #fff; object-fit: contain; padding: 2px; }
.kds-brand-mark { display: grid; place-items: center; color: var(--primary); font-size: 1rem; }
.kds-brand-block h1 { margin: 0; font-size: 1.18rem; line-height: 1.15; letter-spacing: -.025em; }
.kds-brand-block p { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: rgba(255,255,255,.54); font-size: .67rem; font-weight: 600; }
.kds-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #71c7a5; box-shadow: 0 0 0 4px rgba(113,199,165,.12); }
.kds-header-right { justify-content: flex-end; gap: 14px; }
.kds-stats { gap: 6px; }
.kds-stat {
  min-height: 43px;
  display: grid;
  grid-template-columns: 18px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.055);
}
.kds-stat .kds-icon { grid-row: 1 / 3; font-size: .92rem; color: rgba(255,255,255,.62); }
.kds-stat strong { font-size: .88rem; line-height: 1; font-variant-numeric: tabular-nums; }
.kds-stat small { color: rgba(255,255,255,.48); font-size: .56rem; line-height: 1; }
.kds-stat.is-pending strong { color: #f6c568; }
.kds-stat.is-preparing strong { color: #83baf2; }
.kds-stat.is-ready strong { color: #78d4ad; }
.kds-header-nav { gap: 6px; }
.kds-header .kds-nav-link { gap: 6px; min-height: 39px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: rgba(255,255,255,.72); font-size: .69rem; font-weight: 700; text-decoration: none; transition: color .18s ease, background-color .18s ease, transform .18s ease; }
.kds-header .kds-nav-link:hover { color: #fff; background: rgba(255,255,255,.09); transform: translateY(-1px); }
.kds-main { width: min(100%, 1760px); margin: 0 auto; padding: clamp(16px, 2vw, 30px); }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; gap: clamp(13px, 1.3vw, 20px); padding: 0; }
.kds-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dde1e6;
  border-top: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(38,44,54,.07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kds-card::before { content: ''; display: block; width: 100%; height: 5px; background: #d7a947; }
.kds-card.accepted::before { background: #8894a5; }
.kds-card.preparing::before { background: #4e83bc; }
.kds-card.ready::before { background: #4a9b79; }
.kds-card:hover { transform: translateY(-2px); border-color: #cfd5dc; box-shadow: 0 16px 38px rgba(38,44,54,.11); }
.kds-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 14px 15px 10px; }
.kds-card-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.kds-card-identity > div { min-width: 0; display: flex; flex-direction: column; }
.kds-state-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #96701e; background: #fbf1da; font-size: 1.05rem; }
.kds-card.accepted .kds-state-icon { color: #596677; background: #edf0f4; }
.kds-card.preparing .kds-state-icon { color: #346b9f; background: #e5f0fa; }
.kds-card.ready .kds-state-icon { color: #27785a; background: #e2f3eb; }
.kds-card-eyebrow { color: #8a6930; font-size: .59rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.kds-card.accepted .kds-card-eyebrow { color: #697486; }
.kds-card.preparing .kds-card-eyebrow { color: #3974aa; }
.kds-card.ready .kds-card-eyebrow { color: #317c60; }
.kds-order-code { overflow: hidden; color: #252a32; font-size: 1.02rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kds-timer { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 8px; color: #687181; background: #f1f3f5; font-size: .66rem; white-space: nowrap; }
.kds-timer strong { color: #3f4652; font-size: .8rem; font-variant-numeric: tabular-nums; }
.kds-timer.is-late { color: #9b3c42; background: #fae8e9; }
.kds-timer.is-late strong { color: #8f3037; }
.kds-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 15px 11px; }
.kds-type-badge, .kds-payment-badge { min-height: 29px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; color: #596273; background: #f1f3f6; font-size: .66rem; font-weight: 750; }
.kds-payment-badge { margin-left: auto; }
.kds-payment-badge small { padding-left: 5px; border-left: 1px solid currentColor; opacity: .62; font-size: .57rem; }
.kds-payment-badge.paid { color: #257052; background: #e5f4ed; }
.kds-payment-badge.pending { color: #976c21; background: #fbf0d8; }
.kds-payment-badge.cancelled, .kds-payment-badge.failed { color: #9a3c43; background: #fae8e9; }
.kds-customer, .kds-delivery-detail, .kds-scheduled { display: flex; align-items: flex-start; gap: 7px; margin: 0 15px; color: #5e6775; font-size: .76rem; line-height: 1.4; }
.kds-customer { padding: 10px 0; border-top: 1px solid #edf0f3; }
.kds-customer strong { color: #303640; font-size: .8rem; }
.kds-customer .kds-icon, .kds-delivery-detail .kds-icon, .kds-scheduled .kds-icon { margin-top: 2px; color: #858e9c; font-size: .86rem; }
.kds-delivery-detail, .kds-scheduled { padding: 0 0 8px; }
.kds-items { display: grid; gap: 9px; margin: 0; padding: 2px 15px 14px; list-style: none; }
.kds-item { padding: 11px; border: 1px solid #e4e7eb; border-radius: 11px; background: #fafbfc; }
.kds-item-heading { display: grid; grid-template-columns: auto 28px minmax(0,1fr); align-items: center; gap: 7px; }
.kds-item-heading .item-qty { min-width: 29px; color: var(--primary); font-size: 1.02rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.kds-item-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #646e7c; background: #eceff3; font-size: .92rem; }
.kds-item-heading strong { color: #222832; font-size: .94rem; line-height: 1.25; text-wrap: pretty; }
.item-mods { margin: 8px 0 0 65px; color: #5e6877; font-size: .72rem; line-height: 1.45; }
.item-mods > span { display: block; margin-bottom: 2px; color: #8a6470; font-size: .55rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.kds-recipe-block { margin: 10px 0 0 36px; padding: 9px 10px 8px; border-left: 3px solid color-mix(in srgb, var(--primary) 48%, #d9dde3); border-radius: 0 9px 9px 0; background: color-mix(in srgb, var(--primary) 3%, #f2f4f6); }
.kds-recipe-title { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: #5a6371; font-size: .66rem; font-weight: 800; }
.kds-recipe-title .kds-icon { color: var(--primary); font-size: .86rem; }
.kds-recipe-title small { min-width: 20px; height: 20px; display: grid; place-items: center; margin-left: auto; border-radius: 6px; color: #66707e; background: #fff; font-size: .58rem; font-variant-numeric: tabular-nums; }
.kds-ingredients { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.kds-ingredients li { display: grid; grid-template-columns: 19px minmax(0,1fr) auto; align-items: center; gap: 6px 7px; min-height: 27px; padding: 3px 0; }
.kds-ingredient-check { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #d8dee5; border-radius: 6px; color: #4f9277; background: #fff; font-size: .68rem; }
.kds-ingredient-name { color: #323944; font-size: .79rem; font-weight: 650; }
.kds-ingredients li > strong { color: #29313c; font-size: .78rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kds-ingredients li > small { grid-column: 2 / 4; margin-top: -4px; color: #7b8491; font-size: .64rem; line-height: 1.35; }
.kds-item-note { display: flex; align-items: flex-start; gap: 6px; margin: 9px 0 0 36px; padding: 7px 8px; border-radius: 8px; color: #795f29; background: #fbf1db; font-size: .69rem; line-height: 1.4; }
.kds-item-note .kds-icon { margin-top: 1px; }
.kds-notes { display: flex; align-items: flex-start; gap: 8px; margin: 0 15px 14px; padding: 10px 11px; border: 1px solid #eadcb9; border-radius: 10px; color: #765e2d; background: #fcf4df; }
.kds-notes > .kds-icon { margin-top: 2px; font-size: .9rem; }
.kds-notes > div { display: flex; flex-direction: column; gap: 2px; }
.kds-notes strong { font-size: .66rem; }
.kds-notes span { font-size: .74rem; line-height: 1.4; }
.kds-actions { display: flex; align-items: stretch; gap: 7px; margin-top: auto; padding: 12px 15px 15px; border-top: 1px solid #eceff2; background: #fff; }
.kds-actions form { display: flex; margin: 0; }
.kds-primary-action { flex: 1; }
.kds-cancel-action { flex: 0 0 auto; }
.kds-btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 0; border-radius: 9px; font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; transition: transform .16s ease, filter .16s ease, box-shadow .16s ease; }
.kds-btn:hover { transform: translateY(-1px); filter: brightness(.98); }
.kds-btn:active { transform: translateY(1px) scale(.99); }
.kds-btn:focus-visible, .kds-fullscreen:focus-visible, .kds-header a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 42%, #fff); outline-offset: 2px; }
.kds-primary-action .kds-btn { width: 100%; color: #fff; }
.kds-primary-action .kds-btn .kds-icon:last-child { margin-left: auto; }
.kds-btn.accept { background: #426f9e; box-shadow: 0 6px 16px rgba(66,111,158,.17); }
.kds-btn.ready { background: #3f8a6d; box-shadow: 0 6px 16px rgba(63,138,109,.17); }
.kds-btn.complete { background: #2e765a; box-shadow: 0 6px 16px rgba(46,118,90,.17); }
.kds-btn.cancel { width: 42px; padding: 0; border: 1px solid #e1d9db; color: #a14850; background: #fff; }
.kds-btn.cancel:hover { background: #fbecee; }
.kds-payment-lock { flex: 1; min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid #efdcae; border-radius: 9px; color: #8a641e; background: #fff8e8; }
.kds-payment-lock > .kds-icon { flex: 0 0 auto; font-size: 1rem; }
.kds-payment-lock span { display: grid; gap: 1px; line-height: 1.2; }
.kds-payment-lock strong { font-size: .7rem; }
.kds-payment-lock small { color: #9a793d; font-size: .59rem; font-weight: 600; }
.kds-action-error { margin: 0 15px 10px; padding: 8px 10px; border: 1px solid #efc4c8; border-radius: 8px; color: #993d45; background: #fff0f1; font-size: .68rem; font-weight: 700; }
.kds-btn[disabled] { cursor: wait; opacity: .58; transform: none; }
.kds-error { max-width: 760px; display: flex; align-items: flex-start; gap: 12px; margin: 0 auto 20px; padding: 16px; border: 1px solid #eccbd0; border-radius: 13px; color: #963a43; background: #fff0f1; }
.kds-error > .kds-icon { margin-top: 3px; font-size: 1.2rem; }
.kds-error div { display: grid; gap: 4px; }
.kds-error p { color: #7d4e54; font-size: .75rem; }
.kds-error button { width: fit-content; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 7px 10px; border: 1px solid #dfb5ba; border-radius: 8px; color: #8e3942; background: #fff; font-weight: 750; cursor: pointer; }
.kds-empty { grid-column: 1 / -1; min-height: 48vh; display: grid; place-items: center; align-content: center; padding: 40px; color: #7b8491; text-align: center; }
.kds-empty > span { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 14px; border: 1px solid #dce1e6; border-radius: 18px; color: #758090; background: #fff; font-size: 1.8rem; box-shadow: 0 12px 28px rgba(39,45,55,.06); }
.kds-empty h2 { margin: 0 0 5px; color: #363d48; font-size: 1.25rem; letter-spacing: -.025em; }
.kds-empty p { font-size: .8rem; }
.kds-fullscreen { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 40; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; color: #fff; background: #252a32; box-shadow: 0 12px 30px rgba(30,35,43,.24); cursor: pointer; transition: transform .18s ease, background-color .18s ease; }
.kds-fullscreen:hover { transform: translateY(-2px); background: var(--primary); }
.kds-fullscreen .kds-icon { grid-area: 1 / 1; font-size: 1.15rem; }
.kds-shrink-icon { display: none; }
.is-fullscreen .kds-expand-icon { display: none; }
.is-fullscreen .kds-shrink-icon { display: block; }

@media (max-width: 1180px) {
  .kds-header { align-items: flex-start; }
  .kds-header-right { align-items: flex-end; flex-direction: column-reverse; }
  .kds-stats { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 820px) {
  .kds-header { position: static; flex-direction: column; gap: 12px; }
  .kds-header-right { width: 100%; align-items: stretch; flex-direction: column-reverse; }
  .kds-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
  .kds-header-nav { position: absolute; top: 15px; right: 15px; }
  .kds-header .kds-nav-link span { display: none; }
  .kds-header .kds-nav-link { width: 36px; justify-content: center; padding: 0; }
  .kds-brand-block { padding-right: 86px; }
}
@media (max-width: 560px) {
  .kds-header { padding: 12px 14px; }
  .kds-brand { padding-right: 12px; }
  .kds-brand > span:last-child { display: none; }
  .kds-brand-block { gap: 12px; }
  .kds-brand-block h1 { font-size: 1rem; }
  .kds-stat { min-height: 39px; padding: 5px 7px; column-gap: 5px; }
  .kds-stat .kds-icon { display: none; }
  .kds-stat { grid-template-columns: auto; }
  .kds-main { padding: 12px; }
  .kds-grid { grid-template-columns: 1fr; }
  .kds-payment-badge { margin-left: 0; }
  .kds-recipe-block { margin-left: 0; }
  .item-mods, .kds-item-note { margin-left: 36px; }
  .kds-fullscreen { width: 44px; height: 44px; right: 13px; bottom: 13px; }
}
