:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-alt: #fbfaf7;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0b5d60;
  --accent-strong: #0f766e;
  --accent-soft: #d1f4ef;
  --danger: #b91c1c;
  --card: #ffffff;
  --border: #e2e8f0;
  --brand: var(--accent);
  --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 14px 30px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  background: radial-gradient(1200px 480px at 10% -20%, #e8f2ef 0%, transparent 60%),
    radial-gradient(900px 520px at 90% -10%, #f2ede2 0%, transparent 65%),
    var(--bg);
  color: var(--text);
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  letter-spacing: 0.2px;
}

h1 {
  font-size: 26px;
  margin: 0 0 4px;
}

h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.nav-toggle {
  display: none;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.main-nav a.is-active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-meta {
  margin-left: auto;
}

.content {
  padding: 24px;
  animation: content-fade 0.35s ease-out;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-shell .content {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
}

.app-shell-main {
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-shell-frames {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.app-shell-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.app-view[hidden] {
  display: none;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.insight-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.insight-panel h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.insight-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.insight-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.insight-item h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.insight-item p {
  margin: 0;
  font-size: 12px;
}

@keyframes content-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-form {
  display: block;
}

.mobile-order-wizard {
  display: none;
}

.order-lookup {
  display: grid;
  gap: 10px;
}

.order-builder {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
}

.order-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  align-self: start;
  grid-column: 1;
}

.order-menu {
  grid-column: 2;
}

.order-cart {
  grid-column: 3;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  display: grid;
  gap: 12px;
}

.order-cart .cart-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: grid;
  gap: 8px;
}

.order-cart .cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  flex-wrap: wrap;
}

.cart-item__meta {
  width: 100%;
  font-size: 12px;
  color: #64748b;
}

.cart-item__controls {
  width: 100%;
  display: flex;
  gap: 6px;
}

.cart-item__controls button {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.order-cart .cart-total {
  justify-content: space-between;
  font-weight: 700;
}

.qty-field {
  display: grid;
  gap: 6px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.qty-stepper input {
  width: 64px;
  text-align: center;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-weight: 700;
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

.table th,
.table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: #f8fafc;
  font-weight: 700;
}

.order-details label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.order-details {
  display: grid;
  gap: 14px;
}

.form-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.form-section__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 700;
}

.form-section__helper {
  font-size: 12px;
  color: var(--muted);
}

.order-menu {
  min-width: 0;
}

.menu-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.menu-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-toggle {
  font-size: 12px;
  font-weight: 600;
}

.menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-search input {
  min-width: 220px;
  font-size: 14px;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  position: sticky;
  top: 148px;
  z-index: 3;
  background: rgba(246, 245, 242, 0.88);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.category-pill {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.category-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.category-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #f7f7f7;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

.subnav__link {
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.8px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.subnav__link.is-active {
  background: var(--accent);
  color: #ffffff;
}

.menu-section {
  margin-bottom: 26px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.product-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: grid;
}

.product-media {
  height: 140px;
  background: linear-gradient(140deg, #f6f7f9 0%, #eef2f6 100%);
}

.product-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  padding: 12px;
  text-align: center;
}

.product-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.product-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.product-desc {
  margin: 0;
  font-size: 12px;
  color: #475569;
}

.price {
  font-weight: 700;
  color: var(--accent);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-actions {
  justify-content: space-between;
  align-items: flex-end;
}

.add-selection {
  align-self: end;
}

.quick-extras {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed var(--border);
}

.quick-extras__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.quick-extras__group {
  display: grid;
  gap: 6px;
}

.quick-extras__options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-extras__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.order-form.is-compact .product-media {
  height: 90px;
}

.order-form.is-compact .product-desc,
.order-form.is-compact .badges {
  display: none;
}

.order-form.is-compact .product-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.order-form.is-compact .product-body {
  gap: 8px;
}

.order-form.is-compact .qty-btn {
  width: 32px;
  height: 32px;
}

.order-form.is-compact .qty-stepper input {
  width: 56px;
}

.order-form.is-fast .menu-toolbar {
  position: sticky;
  top: 92px;
  z-index: 4;
}

.order-form.is-fast .form-section {
  padding: 10px;
}

.order-form.is-fast .order-details label {
  margin-bottom: 6px;
}

.order-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.order-cart .order-footer {
  justify-content: stretch;
}

.order-cart .order-footer button {
  width: 100%;
}

.mobile-step-actions {
  display: none;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-search input {
  width: min(360px, 100%);
}

.admin-section {
  margin-bottom: 24px;
}

.admin-section--orders {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-card);
}

.admin-tools {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.admin-tools__summary {
  list-style: none;
  margin: 0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.admin-tools__summary::-webkit-details-marker {
  display: none;
}

.admin-tools__summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
  flex: 0 0 auto;
}

.admin-tools[open] .admin-tools__summary {
  border-bottom-color: var(--border);
}

.admin-tools[open] .admin-tools__summary::after {
  content: "−";
}

.admin-tools__body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 14px;
}

.admin-tools .admin-section {
  margin-bottom: 0;
}

.admin-tools .admin-section + .admin-section {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

@media (max-width: 720px) {
  .admin-tools__summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-tools__summary::after {
    align-self: flex-end;
  }
}

.admin-actions .admin-card {
  border-left: 4px solid var(--brand);
}

.admin-card {
  display: grid;
  gap: 6px;
  text-decoration: none;
}

.admin-card__title {
  font-weight: 700;
}

.admin-card__desc {
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.product-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.product-form {
  margin-top: 12px;
}

.auth-shell {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.summary-grid {
  margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-bad {
  background: #fee2e2;
  color: #7f1d1d;
}

.status-warn {
  background: #ffedd5;
  color: #9a3412;
}

.status-info {
  background: #e0f2fe;
  color: #075985;
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row.wrap {
  flex-wrap: wrap;
}

.ingredients {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.ingredient-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.ingredient-name {
  font-weight: 600;
}

.ingredient-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

.ingredient-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
}

.stepper-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.ingredient-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
}

.product-card .card-actions label,
.product-card .product-actions label {
  display: grid;
  gap: 4px;
}

.product-card .customize {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.product-card[data-open="0"] .customize {
  display: none;
}

.toggle-customize {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.badge {
  display: inline-block;
  background: #e2e8f0;
  color: #0f172a;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

button,
.button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

button.danger,
.danger {
  background: var(--danger);
}

.link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.inline-form {
  margin-top: 8px;
}

.table-card {
  overflow-x: auto;
}

.alert {
  background: #fee2e2;
  color: #7f1d1d;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #fecaca;
}

.muted {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.chip {
  background: #e2e8f0;
  color: #0f172a;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.qr-block {
  display: grid;
  gap: 8px;
  align-items: start;
  margin: 10px 0;
}

.qr-block img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.ticket {
  max-width: 360px;
  margin: 0 auto 16px;
  padding: 16px;
  border: 1px dashed var(--border);
  background: #fff;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.2px;
}

.ticket__header,
.ticket__footer {
  text-align: center;
  font-size: 12px;
}

.ticket__header h1 {
  margin: 0 0 6px;
  font-size: 18px;
}

.ticket__section {
  margin: 12px 0;
  font-size: 13px;
}

.ticket__line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ticket__divider {
  border-top: 1px dashed #cbd5f5;
  margin: 8px 0;
}

.ticket__list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.ticket__list li {
  margin: 2px 0;
}

.ticket__sublist {
  list-style: none;
  margin: 2px 0 0 12px;
  padding: 0;
  font-size: 12px;
  color: #475569;
}

.ticket__qr {
  display: block;
  margin: 0 auto;
  width: 160px;
  height: 160px;
}

.theme-presets {
  background: #f8fafc;
  border: 1px dashed var(--border);
}

.theme-pill {
  background: #111827;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.theme-pill:nth-child(2) {
  background: #1f2937;
}

.theme-pill:nth-child(3) {
  background: #0f172a;
}

.color-grid .row {
  width: 100%;
}

.color-field input[type="color"] {
  width: 48px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.color-field input[type="text"] {
  flex: 1;
}

@media print {
  @page {
    size: 58mm auto;
    margin: 0;
  }

  body {
    background: #fff;
    margin: 0;
  }

  .site-header,
  nav,
  .row,
  .link,
  button {
    display: none !important;
  }

  .ticket {
    border: none;
    margin: 0;
    width: 58mm;
    max-width: 58mm;
    padding: 8px;
    font-size: 12px;
  }

  .ticket__header h1 {
    font-size: 16px;
  }

  .ticket__section {
    margin: 6px 0;
  }

  .ticket__qr {
    width: 120px;
    height: 120px;
  }

  .ticket img,
  .qr-box img {
    filter: grayscale(100%);
  }
}

select,
input,
textarea {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.wizard-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.wizard-step {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.wizard-step.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.wizard-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.map-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--map-fr, 2.2fr)) minmax(0, var(--side-fr, 1fr));
  gap: 16px;
  align-items: start;
}

.rider-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.rider-panel__header h3 {
  margin: 0;
}

.rider-list {
  display: grid;
  gap: 12px;
}

.rider-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.rider-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.rider-card__top h4 {
  margin: 0;
}

.rider-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

.rider-card__actions {
  display: grid;
  gap: 8px;
}

.rider-cash-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rider-cash-form input,
.rider-cash-form select {
  min-width: 120px;
  flex: 1;
}

.rider-cash-form button {
  white-space: nowrap;
}

#orders-map,
.map-canvas {
  width: 100%;
  height: 320px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.map-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #475569;
}

.map-info {
  font-size: 12px;
  color: #0f172a;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--swatch);
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

@media (max-width: 1100px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.big-number {
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 0;
}

.ops-shell {
  display: grid;
  gap: 16px;
}

.ops-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ops-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.ops-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-search {
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ops-board {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: start;
}

.ops-column {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 220px;
}

.ops-column__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: #0f172a;
}

.ops-column__list {
  display: grid;
  gap: 10px;
}

.ops-empty {
  text-align: center;
  padding: 10px 0;
}

@media (max-width: 1280px) {
  .ops-board {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 760px) {
  .ops-board {
    grid-template-columns: 1fr;
  }
}

.chip {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #111827;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.order-grid {
  display: grid;
  gap: 14px;
}

.order-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.order-card.compact {
  padding: 12px;
  border-radius: 12px;
  gap: 8px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.order-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.order-card__head h3 {
  margin: 0 0 6px;
}

.order-card.compact .order-card__head h3 {
  margin: 0;
  font-size: 15px;
}

.order-card__meta,
.order-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #475569;
}

.order-card.compact .order-card__meta,
.order-card.compact .order-card__details {
  font-size: 12px;
  gap: 8px;
}

.order-card__packs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-card__actions {
  display: grid;
  gap: 12px;
}

.order-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.order-card__tasks {
  display: grid;
  gap: 10px;
}

.primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-actions form {
  margin: 0;
}

.order-card details.order-details {
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

.order-card details.order-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
  list-style: none;
}

.order-card details.order-details summary::-webkit-details-marker {
  display: none;
}

.order-card details.order-details[open] summary {
  margin-bottom: 8px;
}

.order-card .order-details__content {
  display: grid;
  gap: 10px;
}

.pill {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.pill-pickup {
  background: #dcfce7;
  color: #166534;
}

.pill-delivery {
  background: #e0f2fe;
  color: #075985;
}

.pill-ok {
  background: #dcfce7;
  color: #166534;
}

.pill-warn {
  background: #fef9c3;
  color: #92400e;
}

.order-timer {
  font-weight: 700;
  color: #0f172a;
}

.order-timer.is-late {
  color: #b91c1c;
}

.ops-grid .card {
  border: 1px solid #e2e8f0;
}

.ghost-button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.ghost-button.small {
  padding: 6px 10px;
  font-size: 12px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.telephony-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.5fr) minmax(300px, 1fr);
  align-items: start;
}

.telephony-col {
  display: grid;
  gap: 16px;
}

.telephony-card {
  display: grid;
  gap: 10px;
}

.telephony-list {
  display: grid;
  gap: 10px;
}

.telephony-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.telephony-row__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.telephony-row__meta {
  font-size: 12px;
  color: var(--muted);
}

.telephony-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-soft);
  color: #0f3b3d;
}

.telephony-pill.is-ring {
  background: #ffedd5;
  color: #9a3412;
}

.telephony-pill.is-call {
  background: #dcfce7;
  color: #166534;
}

.telephony-queue {
  display: grid;
  gap: 8px;
}

.telephony-queue__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.telephony-queue__item strong {
  font-size: 14px;
}

.telephony-footnote {
  font-size: 12px;
  color: var(--muted);
}

.call-pop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.32);
  display: grid;
  gap: 6px;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(6px);
}

.call-pop__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.call-pop__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.call-pop[data-state="IN_CALL"] .call-pop__dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.call-pop[data-state="RINGING"] .call-pop__dot {
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.call-pop__meta {
  font-size: 13px;
  color: #e2e8f0;
  display: grid;
  gap: 5px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding-right: 2px;
}

.call-pop__identity {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.call-pop__line,
.call-pop__subline,
.call-pop__note,
.call-pop__warning,
.call-pop__section,
.call-pop__order,
.call-pop__customer-link {
  line-height: 1.35;
}

.call-pop__subline {
  color: #cbd5e1;
  font-size: 12px;
}

.call-pop__section {
  margin-top: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.call-pop__note {
  border-left: 3px solid rgba(148, 163, 184, 0.55);
  padding-left: 8px;
}

.call-pop__warning {
  color: #fde68a;
  font-weight: 700;
}

.call-pop__order,
.call-pop__customer-link {
  color: #93c5fd;
  font-weight: 800;
  text-decoration: none;
}

.call-pop__order:hover,
.call-pop__customer-link:hover {
  text-decoration: underline;
}

.call-pop__btn {
  background: #f59e0b;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.call-pop__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.call-pop__dismiss {
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.4);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.call-pop__snooze {
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.4);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.context-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.context-bar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.context-bar__meta {
  font-size: 12px;
  color: var(--muted);
}

.context-bar__btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.context-bar__btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.address-floor {
  display: none;
}

.pickup-fields {
  display: none;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  border: none;
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .content {
    padding: 16px;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    padding: 12px 14px;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .brand span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .main-nav {
    display: none;
    width: 100%;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 6px;
  }

  .nav-open .main-nav {
    display: grid;
  }

  .nav-group {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-label {
    position: sticky;
    left: 0;
    flex: 0 0 auto;
    background: var(--surface);
    padding-right: 4px;
  }

  .main-nav a,
  .chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .nav-meta {
    margin-left: 0;
  }

  .context-bar {
    padding: 10px 14px;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .context-bar__item {
    flex: 0 0 100%;
    min-width: min(320px, calc(100vw - 40px));
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .page-header,
  .admin-header,
  .page-actions,
  .row,
  .menu-toolbar,
  .menu-search,
  .menu-actions,
  .product-summary,
  .call-pop__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions > *,
  .row > *,
  .menu-search > *,
  .menu-actions > *,
  .call-pop__actions > * {
    width: 100%;
  }

  .grid,
  .form-grid,
  .summary-grid,
  .insight-grid,
  .product-grid,
  .media-grid,
  .labels-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .insight-panel,
  .auth-card {
    padding: 14px;
  }

  .table {
    min-width: 560px;
  }

  .call-pop {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}

@media (max-width: 980px) {
  .order-form.is-mobile-wizard .mobile-order-wizard {
    display: grid;
    gap: 10px;
    position: sticky;
    top: 10px;
    z-index: 6;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
  }

  .order-form.is-mobile-wizard .mobile-order-wizard__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .order-form.is-mobile-wizard .mobile-order-wizard__step {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
  }

  .order-form.is-mobile-wizard .mobile-order-wizard__step.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, #6ec6ca 100%);
    border-color: transparent;
    color: #ffffff;
  }

  .order-form.is-mobile-wizard .mobile-order-wizard__step.is-done {
    border-color: rgba(11, 93, 96, 0.24);
    color: var(--accent-strong);
  }

  .order-form.is-mobile-wizard .mobile-order-wizard__summary {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
  }

  .order-builder {
    grid-template-columns: 1fr;
  }

  .order-panel,
  .order-cart {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .order-panel {
    order: 1;
  }

  .order-cart {
    order: 2;
    margin-top: 0;
  }

  .order-menu {
    order: 3;
  }

  .order-cart {
    margin-top: 16px;
  }

  .category-nav {
    position: static;
  }

  .telephony-grid {
    grid-template-columns: 1fr;
  }

  .order-form.is-mobile-wizard .mobile-step-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
  }

  .order-form.is-mobile-wizard .mobile-step-actions > * {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .content {
    padding: 12px;
  }

  button:not(.stepper-btn):not(.context-bar__btn):not(.call-pop__btn):not(.call-pop__dismiss):not(.call-pop__snooze),
  .button,
  .ghost-button,
  select,
  input:not([type="checkbox"]):not([type="radio"]),
  textarea {
    width: 100%;
    min-height: 44px;
  }

  .chip,
  .main-nav a {
    font-size: 12px;
  }

  .table {
    min-width: 520px;
  }

  .order-form.is-mobile-wizard .mobile-order-wizard__steps,
  .order-form.is-mobile-wizard .mobile-step-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

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

.label-card {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  font-size: 13px;
  text-align: center;
}

.label-card__title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.label-card__type {
  margin-top: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.label-card__detail {
  margin-top: 4px;
  color: #475569;
}

.label-card__meta {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.qr-box {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.qr-box img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.print-page {
  break-after: auto;
  page-break-after: auto;
}

.print-zone {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
}

.no-print {
  margin-top: 16px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.media-card {
  background: linear-gradient(180deg, #ffffff 0%, #fefcf8 100%);
}

.media-inline-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.media-inline-status.is-ok {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.media-inline-status.is-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.media-inline-status.is-loading {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.media-card__head h3 {
  margin: 0 0 4px;
}

.media-current {
  display: grid;
  gap: 6px;
  align-items: start;
}

.media-current img {
  width: min(320px, 100%);
  height: 140px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.media-current--icon img {
  width: 72px;
  height: 72px;
}

.media-danger {
  color: var(--danger);
  font-weight: 600;
}

.media-seo-ai {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.media-seo-ai h4 {
  margin: 0;
  font-size: 15px;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.media-gallery__item {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}

.media-gallery__item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.media-gallery__item--editable {
  padding: 0;
  overflow: hidden;
}

.media-gallery__frame {
  position: relative;
}

.media-gallery__item--editable img {
  border: 0;
  border-radius: 0;
}

.media-gallery__meta {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.media-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: rgba(255, 255, 255, 0.95);
  color: #b91c1c;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
}

.media-delete-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.media-gallery__index {
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}

.media-gallery__url {
  display: block;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-gallery--products .media-gallery__item {
  padding: 0;
  overflow: hidden;
}

.media-gallery--products figcaption {
  font-size: 12px;
  color: var(--muted);
  padding: 8px;
}

@media print {
  header,
  .site-header,
  .no-print,
  nav {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .print-page + .print-page {
    break-before: page;
    page-break-before: always;
  }
  .print-zone {
    padding: 0;
    border: none;
  }
}
