:root {
  --bg: #f7f5f1;
  --panel: #ffffff;
  --text: #241f1b;
  --muted: #76695f;
  --line: #e7dfd7;
  --shadow: 0 16px 42px rgba(36, 31, 27, 0.09);

  --mint: #dff4ec;
  --mint-2: #93d7bf;
  --peach: #ffe1c7;
  --lav: #e8e3ff;
  --sky: #dff0ff;

  --primary: #0f7a5f;
  --primary-2: #075642;
  --accent: #d96c2c;
  --danger: #b42318;
  --warn: #b95b16;

  --radius: 8px;
  --radius-sm: 8px;
  --gap: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 500px at 10% 0%, var(--mint), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, var(--peach), transparent 55%),
    radial-gradient(900px 500px at 60% 100%, var(--lav), transparent 60%), var(--bg);
}

.container {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(251, 251, 253, 0.65);
  border-bottom: 1px solid rgba(231, 231, 238, 0.9);
}

.topbar__inner {
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--mint-2), #ffffff);
  border: 1px solid var(--line);
  font-weight: 800;
  color: var(--primary);
}

.brand__title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.topbar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.layout {
  padding: 18px 0 48px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--gap);
}

.panel {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(231, 231, 238, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel--main {
  min-height: calc(100vh - 140px);
}

.panel__header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(231, 231, 238, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.55));
}

.panel__header--stack {
  flex-direction: column;
  align-items: stretch;
}

.panel__headerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel__title {
  margin: 0;
  font-size: 16px;
}

.panel__body {
  padding: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--gap);
  align-items: start;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(231, 231, 238, 0.9);
  border-radius: var(--radius);
  overflow: hidden;
}

.cash-layout {
  padding: 22px 0 48px;
  display: grid;
  gap: 16px;
}

.cash-columns,
.cash-method-grid,
.cash-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cash-balance-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cash-balance {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--mint);
  display: grid;
  gap: 6px;
}

.cash-balance span { color: var(--muted); font-size: 13px; }
.cash-balance strong { color: var(--primary-2); font-size: 20px; }
.cash-subtitle { margin: 0 0 12px; font-size: 14px; }
.cash-message { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--mint); color: var(--primary-2); }
.cash-message[data-type="error"] { background: #fee4e2; color: var(--danger); }
.cash-message[data-type="working"] { background: var(--sky); color: var(--text); }

.report-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.report-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.report-metric { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 4px; background: rgba(255, 255, 255, .65); }
.report-metric span { color: var(--muted); font-size: 12px; }
.report-metric strong { font-size: 16px; }
.report-metric.is-positive strong { color: var(--primary); }
.report-metric.is-negative strong { color: var(--danger); }
.table-scroll { width: 100%; overflow: auto; }
.report-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.report-table th, .report-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.report-table .number, .report-table th:not(:first-child) { text-align: right; }
.report-table tfoot th { border-bottom: 0; }
.collection-confirm { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; cursor: pointer; line-height: 1.4; }
.collection-confirm input { width: 20px; height: 20px; flex: 0 0 auto; }
.overdue-tag { color: var(--danger); font-weight: 700; }
.overdue-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stock-alert-out { background: #fee4e2; color: var(--danger); }
.stock-alert-low { background: var(--peach); color: var(--warn); }

@media (max-width: 560px) {
  .overdue-item { align-items: stretch; flex-direction: column; }
}

@media (max-width: 720px) {
  .cash-columns,
  .cash-balance-grid,
  .report-grid,
  .report-metrics { grid-template-columns: 1fr; }
}

.card--full {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none !important;
}

.card__header {
  padding: 12px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(231, 231, 238, 0.75);
  background: linear-gradient(180deg, rgba(229, 242, 255, 0.45), rgba(255, 255, 255, 0.6));
}

.card__title {
  margin: 0;
  font-size: 14px;
}

.card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card__body {
  padding: 12px;
}

.btn {
  appearance: none;
  border: 1px solid rgba(93, 64, 55, 0.28);
  background: linear-gradient(180deg, rgba(141, 110, 99, 0.9), rgba(93, 64, 55, 0.85));
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 8px 20px rgba(93, 64, 55, 0.12);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(93, 64, 55, 0.16);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(231, 231, 238, 0.95);
  color: var(--text);
  box-shadow: none;
}

.btn--ghost:hover {
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}

.btn--quick-settle {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(22, 163, 74, 0.45);
  color: #14532d;
}

.btn--quick-settle:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(21, 128, 61, 0.65);
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.2);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(231, 231, 238, 0.95);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(231, 231, 238, 0.95);
  background: rgba(255, 255, 255, 0.75);
  outline: none;
}

.input:focus {
  border-color: rgba(93, 64, 55, 0.38);
  box-shadow: 0 0 0 4px rgba(141, 110, 99, 0.45);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field__label {
  font-size: 12px;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(231, 231, 238, 0.9);
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.list-item.is-active {
  border-color: rgba(47, 122, 103, 0.35);
  background: linear-gradient(180deg, rgba(217, 242, 234, 0.65), rgba(255, 255, 255, 0.75));
}

.list-item__title {
  font-weight: 800;
  font-size: 14px;
}

.list-item__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.list-item__debt {
  color: var(--danger);
  font-weight: 800;
  font-size: 13px;
  background: rgba(216, 67, 21, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 4px;
  display: inline-block;
}

.segmented {
  display: inline-flex;
  border: 1px solid rgba(231, 231, 238, 0.95);
  background: rgba(255, 255, 255, 0.65);
  padding: 4px;
  border-radius: 14px;
  gap: 4px;
}

.segmented__btn {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.segmented__btn.is-active {
  background: var(--panel);
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(93, 64, 55, 0.12);
  border-color: rgba(93, 64, 55, 0.2);
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(231, 231, 238, 0.95);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  color: var(--muted);
}

.badge strong {
  color: var(--text);
}

.badge--pending {
  background: rgba(254, 226, 226, 0.9);
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.3);
}

.badge--pending strong {
  color: #7f1d1d;
}

.badge--accepted {
  background: rgba(254, 249, 195, 0.9);
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.28);
}

.badge--accepted strong {
  color: #78350f;
}

.badge--delivered {
  background: rgba(219, 234, 254, 0.9);
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.28);
}

.badge--delivered strong {
  color: #1e3a8a;
}

.badge--paid {
  background: rgba(220, 252, 231, 0.95);
  color: #166534;
  border-color: rgba(22, 101, 52, 0.3);
}

.badge--paid strong {
  color: #14532d;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

#statusSync.status-health--online {
  color: #15803d;
  font-weight: 700;
}

#statusSync.status-health--unstable {
  color: #b45309;
  font-weight: 700;
}

#statusSync.status-health--offline {
  color: #b91c1c;
  font-weight: 700;
}

#statusSync.status-health--local {
  color: #1d4ed8;
  font-weight: 700;
}

.empty {
  padding: 18px 12px;
  border: 1px dashed rgba(231, 231, 238, 0.95);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

.order__summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(231, 231, 238, 0.9);
  background: linear-gradient(180deg, rgba(255, 230, 214, 0.5), rgba(255, 255, 255, 0.75));
}

.summaryLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 14px;
}

.divider {
  height: 1px;
  background: rgba(231, 231, 238, 0.95);
  margin: 14px 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.order__products {
  display: grid;
  gap: 10px;
}

.product-row {
  display: grid;
  grid-template-columns: 1fr 110px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(231, 231, 238, 0.9);
  background: rgba(255, 255, 255, 0.7);
}

.product-row__info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-row__img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: bold;
  font-size: 14px;
}

.product-row__name {
  display: grid;
  gap: 2px;
}

.product-row__title {
  font-weight: 800;
}

.product-row__sub {
  font-size: 12px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(231, 231, 238, 0.95);
  background: rgba(229, 242, 255, 0.6);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.qty {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(231, 231, 238, 0.95);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.qty input {
  width: 54px;
  text-align: center;
  padding: 8px 6px;
}

.draft-resume {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.draft-item strong {
  color: var(--text);
}

.caixa-resumo {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.caixa-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(231, 231, 238, 0.9);
  border-radius: 12px;
  font-size: 15px;
}

.caixa-item strong {
  font-size: 16px;
}

.stock {
  display: grid;
  gap: 10px;
}

.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(231, 231, 238, 0.9);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}

.stock-item:hover {
  background: var(--panel);
  border-color: rgba(47, 122, 103, 0.3);
}

.stock-item__img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: bold;
  font-size: 14px;
}

.stock-item__info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stock-item__name {
  font-weight: 800;
}

.stock-item__meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stock-item__qty {
  font-weight: 900;
}

.stock-item__qty.is-low {
  color: var(--warn);
}

.history {
  display: grid;
  gap: 10px;
}

.history-item {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(231, 231, 238, 0.9);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 6px;
}

.history-item__title {
  font-weight: 900;
}

.history-item__meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal::backdrop {
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(2px);
}

.modal__card {
  border: 1px solid rgba(231, 231, 238, 0.95);
  border-radius: var(--radius);
  padding: 0;
  width: min(820px, calc(100vw - 22px));
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
}

.modal__header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(231, 231, 238, 0.8);
}

.modal__title {
  margin: 0;
  font-size: 15px;
}

.modal__body {
  padding: 14px;
}

.modal__footer {
  padding: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(231, 231, 238, 0.8);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stock-edit {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.stock-edit-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(231, 231, 238, 0.9);
  background: rgba(255, 255, 255, 0.7);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(231, 231, 238, 0.95);
  background: rgba(239, 231, 255, 0.6);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
}

.tag--danger {
  background: rgba(249, 235, 224, 0.65);
  color: var(--danger);
  border-color: rgba(216, 67, 21, 0.18);
}

.tag--ok {
  background: rgba(244, 232, 225, 0.7);
  color: var(--primary-2);
  border-color: rgba(93, 64, 55, 0.2);
}

.tag--pending {
  background: rgba(254, 226, 226, 0.9);
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.3);
}

.tag--accepted {
  background: rgba(254, 249, 195, 0.9);
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.28);
}

.tag--ready {
  background: rgba(254, 240, 138, 0.95);
  color: #854d0e;
  border-color: rgba(133, 77, 14, 0.28);
}

.tag--delivered {
  background: rgba(219, 234, 254, 0.9);
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.28);
}

.tag--paid {
  background: rgba(220, 252, 231, 0.95);
  color: #166534;
  border-color: rgba(22, 101, 52, 0.3);
}

.tag--rejected {
  background: rgba(254, 226, 226, 0.9);
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.3);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .row {
    grid-template-columns: 1fr;
  }
  .product-row {
    grid-template-columns: 1fr;
  }
  .qty {
    justify-content: flex-start;
  }
}

/* Market-ready polish shared by the admin panel and public menu. */
body {
  background: linear-gradient(180deg, #fbfaf8 0%, var(--bg) 48%, #f2f7f4 100%);
}

.topbar {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(231, 223, 215, 0.95);
}

.panel,
.card,
.list-item,
.stock-item,
.history-item,
.product-row,
.caixa-item,
.order__summary,
.empty {
  border-color: rgba(231, 223, 215, 0.95);
}

.panel,
.card {
  background: rgba(255, 255, 255, 0.94);
}

.panel__header,
.card__header {
  border-bottom-color: rgba(231, 223, 215, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 247, 243, 0.88));
}

.brand__logo,
.btn,
.btn--ghost,
.icon-btn,
.input,
.list-item,
.card,
.panel,
.stock-item,
.history-item,
.product-row,
.caixa-item,
.order__summary,
.modal__card,
.empty {
  border-radius: 8px;
}

.btn {
  border-color: rgba(15, 122, 95, 0.28);
  background: linear-gradient(180deg, #159a78, var(--primary));
  box-shadow: 0 10px 24px rgba(15, 122, 95, 0.16);
}

.btn:hover {
  box-shadow: 0 14px 30px rgba(15, 122, 95, 0.2);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(231, 223, 215, 0.95);
}

.input {
  border-color: rgba(218, 208, 198, 0.95);
}

.input:focus {
  border-color: rgba(15, 122, 95, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 122, 95, 0.14);
}

.list-item.is-active {
  border-color: rgba(15, 122, 95, 0.38);
  background: linear-gradient(180deg, rgba(223, 244, 236, 0.82), rgba(255, 255, 255, 0.92));
}

.segmented {
  border-color: rgba(231, 223, 215, 0.95);
  border-radius: 8px;
}

.segmented__btn {
  border-radius: 6px;
}

.segmented__btn.is-active {
  box-shadow: 0 5px 12px rgba(15, 122, 95, 0.14);
}

.order__summary {
  background: linear-gradient(180deg, rgba(223, 244, 236, 0.62), rgba(255, 255, 255, 0.9));
}

.tag--ok {
  background: rgba(223, 244, 236, 0.8);
  color: var(--primary-2);
  border-color: rgba(15, 122, 95, 0.2);
}

.mobile-page {
  min-height: 100%;
  background: #f7f5f1;
}

.mobile-login {
  min-height: 100vh;
  padding: 24px 16px;
  display: grid;
  place-items: center;
}

.mobile-login__card {
  width: min(100%, 390px);
  padding: 28px 18px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mobile-login__logo {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--primary);
}

.mobile-login h1 {
  margin: 16px 0 6px;
  color: var(--primary);
  font-size: 24px;
}

.mobile-login p {
  margin: 0 0 18px;
  color: var(--muted);
}

.mobile-login__connection {
  width: max-content;
  margin: 0 auto 16px;
}

.mobile-form {
  display: grid;
  gap: 12px;
}

.mobile-btn {
  width: 100%;
  min-height: 46px;
}

.mobile-error {
  display: none;
  margin-top: 12px;
  color: var(--danger);
  font-size: 14px;
}

.mobile-link {
  margin-top: 18px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.mobile-app {
  min-height: 100vh;
  padding-bottom: 28px;
}

.mobile-page .btn,
.mobile-page .input {
  min-height: 44px;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
}

.mobile-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.mobile-brand strong,
.mobile-brand span {
  display: block;
}

.mobile-header > .btn {
  min-width: 58px;
  min-height: 44px;
}

.mobile-brand strong {
  color: var(--primary);
  line-height: 1.1;
}

.mobile-brand span {
  max-width: 210px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-main {
  padding: 12px;
}

.mobile-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mobile-status__info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.mobile-status__info > span:not(.mobile-connection) {
  color: var(--muted);
  font-size: 12px;
}

.mobile-status__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-status__actions .btn {
  min-height: 44px;
}

.mobile-connection,
.mobile-sync-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f2ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-connection i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8d8981;
}

.mobile-connection[data-online="true"] {
  border-color: rgba(15, 122, 95, 0.24);
  background: rgba(223, 244, 236, 0.76);
  color: var(--primary-2);
}

.mobile-connection[data-online="true"] i { background: var(--primary); }

.mobile-connection[data-online="false"] {
  border-color: rgba(174, 54, 54, 0.24);
  background: rgba(255, 232, 229, 0.82);
  color: var(--danger);
}

.mobile-connection[data-online="false"] i { background: var(--danger); }

.mobile-sync-state[data-state="synced"] {
  border-color: rgba(15, 122, 95, 0.24);
  background: rgba(223, 244, 236, 0.76);
  color: var(--primary-2);
}

.mobile-sync-state[data-state="syncing"],
.mobile-sync-state[data-state="pending"] {
  border-color: rgba(182, 116, 19, 0.28);
  background: #fff4d8;
  color: #8a570d;
}

.mobile-sync-state[data-state="error"] {
  border-color: rgba(174, 54, 54, 0.24);
  background: rgba(255, 232, 229, 0.82);
  color: var(--danger);
}

.mobile-quick-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.mobile-quick-action { min-height: 50px; font-size: 15px; }

.mobile-dialog {
  width: min(100% - 20px, 520px);
  max-height: calc(100vh - 20px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.mobile-dialog::backdrop { background: rgba(36, 31, 27, .48); }

.mobile-dialog__card { display: grid; gap: 12px; padding: 16px; overflow: auto; max-height: calc(100vh - 20px); }
.mobile-dialog__card label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.mobile-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mobile-dialog__header h2 { margin: 0; font-size: 18px; color: var(--primary); }
.mobile-dialog__submit { min-height: 50px; }
.mobile-repeat-order { width: 100%; }
.mobile-favorites { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 9px; border-radius: 10px; background: #fff4d8; }
.mobile-favorites[hidden] { display: none; }
.mobile-favorites span { color: #8a570d; font-size: 12px; font-weight: 900; }
.mobile-favorites button { min-height: 44px; padding: 6px 9px; border: 1px solid rgba(182, 116, 19, .28); border-radius: 999px; background: #fff; color: #7a4d0a; font-weight: 800; }
.mobile-order-products { display: grid; gap: 8px; }
.mobile-order-product { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; }
.mobile-order-product > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.mobile-order-product strong, .mobile-order-product span { display: block; }
.mobile-order-product span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.mobile-qty { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.mobile-qty button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--primary); font-weight: 900; font-size: 20px; }
.mobile-qty b { min-width: 18px; text-align: center; }
.mobile-order-total { display: flex; justify-content: space-between; padding: 12px; border-radius: 10px; background: var(--mint); color: var(--primary-2); }

.mobile-tabs,
.mobile-filter {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.mobile-tabs {
  grid-template-columns: repeat(4, 1fr);
}

.mobile-filter {
  grid-template-columns: repeat(3, 1fr);
}

.mobile-tab,
.mobile-filter__btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.mobile-tab.is-active,
.mobile-filter__btn.is-active {
  border-color: rgba(15, 122, 95, 0.35);
  background: var(--primary);
  color: #fff;
}

.mobile-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mobile-summary div {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mobile-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.mobile-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 16px;
}

.mobile-tools {
  margin-bottom: 10px;
}

.mobile-route-tools {
  display: grid;
  grid-template-columns: 1fr 1.35fr auto;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mobile-route-tools label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mobile-route-tools .btn { align-self: end; }

.mobile-route-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--primary-2);
}

.mobile-route-summary strong,
.mobile-route-summary span { display: block; }
.mobile-route-summary span { color: var(--muted); font-size: 12px; text-align: right; }
.mobile-route-position { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 4px; border-radius: 50%; background: var(--primary); color: #fff; }
.mobile-route-status { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: #f3f2ef; color: var(--muted); font-size: 11px; font-weight: 800; }
.mobile-route-stop[data-route-status="visited"] { border-color: rgba(15, 122, 95, .3); background: rgba(246, 255, 251, .92); }
.mobile-route-stop[data-route-status="skipped"] { opacity: .72; }

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

.mobile-card,
.mobile-empty {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mobile-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mobile-card__top strong,
.mobile-card__top span {
  display: block;
}

.mobile-pending-label {
  display: inline-flex;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff4d8;
  color: #8a570d;
  font-size: 10px;
  font-style: normal;
  vertical-align: middle;
}

.mobile-card__top span,
.mobile-card p,
.mobile-card__meta,
.mobile-note {
  color: var(--muted);
  font-size: 13px;
}

.mobile-card p {
  margin: 8px 0;
}

.mobile-card__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mobile-actions,
.mobile-stepper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-actions .btn,
.mobile-stepper .btn {
  min-height: 44px;
}

@media (max-width: 360px) {
  .mobile-status,
  .mobile-summary,
  .mobile-tabs,
  .mobile-filter,
  .mobile-actions,
  .mobile-stepper {
    grid-template-columns: 1fr;
  }

  .mobile-status__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-route-tools {
    grid-template-columns: 1fr;
  }

  .mobile-route-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-route-summary span { text-align: left; }

  .mobile-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* JANA_MOBILE_LOOKUP_FIX_20260908 */
.customer-lookup__hint{min-width:0;max-width:100%;overflow-wrap:anywhere}
.customer-lookup__hint .stock-item{align-items:flex-start;cursor:default;min-width:0}
.customer-lookup__hint .stock-item>div:first-child{flex:1 1 auto;min-width:0}
.customer-lookup__hint .stock-item__meta{flex:0 0 auto;flex-direction:column;align-items:flex-end}
.customer-order-edit-row{display:flex;gap:8px;align-items:center;margin-bottom:6px;min-width:0}
.customer-order-edit-row>span{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
@media(max-width:640px){.customer-lookup__hint .stock-item{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch}.customer-lookup__hint .stock-item__meta{width:100%;align-items:flex-start;text-align:left!important}.customer-lookup__hint .stock-item__meta .btn,.customer-lookup__hint .edit-order-box .btn{width:100%;white-space:normal}.customer-order-edit-row{align-items:flex-start}}
