/* Pedidos: list-only visual layer. Shared shell, detail and transactional
   sheets retain their own styles. All colors follow the current app theme. */
.mobile-page.morders-ui {
  --orders-meta: var(--m-ink-soft);
  --orders-accent-ink: var(--m-accent-deep);
  background: var(--m-surface);
}

.morders-ui > .mrec-order-search {
  padding: 10px 12px 8px;
  border-bottom: 0;
}

.morders-ui > .mrec-order-search .mrec-order-search-icon { left: 26px; }

.mrec.morders-ui > .mrec-order-search input {
  height: 48px;
  padding-left: 42px;
  border-color: var(--m-line-strong);
  border-radius: 10px;
  background: var(--m-surface-2);
  font-size: 16px;
}

.mrec.morders-ui > .mrec-order-search input:focus-visible {
  border-color: var(--m-accent);
  box-shadow: var(--m-focus);
}

.morders-ui > .mrec-list-tabs {
  min-height: 48px;
  gap: 4px;
  padding: 0 12px;
}

.morders-ui > .mrec-list-tabs button {
  min-height: 48px;
  padding: 5px 4px;
  color: var(--orders-meta);
  font-size: 12px;
  line-height: 1.2;
}

.morders-ui > .mrec-list-tabs button::after {
  right: 5px;
  left: 5px;
  height: 3px;
}

.morders-ui > .mrec-list-tabs button.is-active { color: var(--orders-accent-ink); }
.morders-ui .mrec-list-tab-main { gap: 6px; }
.morders-ui .mrec-list-tab-main > span { overflow: visible; white-space: normal; }
.morders-ui .mrec-list-tab-main > b {
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  color: var(--orders-meta);
  font-size: 12px;
}
.morders-ui > .mrec-list-tabs button.is-active .mrec-list-tab-main > b {
  color: var(--orders-accent-ink);
}

.morders-ui > .mrec-order-scope {
  min-height: 48px;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 16px;
  border-bottom: 1px solid var(--m-line-strong);
  background: var(--m-surface-2);
}

.morders-ui .mrec-order-scope-copy strong {
  color: var(--m-ink);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.morders-ui .mrec-order-scope-copy small {
  margin-top: 2px;
  color: var(--orders-meta);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 400;
}

.morders-ui .mrec-order-scope .morders-visible-count {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid var(--m-line-strong);
  border-radius: 7px;
  background: var(--m-surface);
  color: var(--m-ink);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mobile-page.morders-ui > .mrec-order-scroll {
  padding-bottom: 4px;
  overscroll-behavior-y: contain;
}

.morders-pagination {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px;
  border-top: 1px solid var(--m-line-strong);
  background: var(--m-surface);
  color: var(--orders-meta);
  font-size: 12px;
}

.morders-pagination button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--m-line-strong);
  border-radius: 7px;
  background: var(--m-surface-2);
  color: var(--orders-accent-ink);
  font: inherit;
  font-weight: 700;
}

.morders-pagination button:disabled { opacity: .45; }
.morders-pagination button:focus-visible { outline: 2px solid var(--m-accent); outline-offset: 2px; }

.morders-ui > .mrec-order-scroll .mrec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, max-content);
  align-items: start;
  column-gap: 12px;
  row-gap: 8px;
  min-height: 88px;
  padding: 12px 16px 10px;
  border-bottom-color: var(--m-line-strong);
  touch-action: pan-y;
  cursor: pointer;
}

.morders-ui > .mrec-order-scroll .mrec-row:active { background: var(--m-surface-2); }
.morders-ui > .mrec-order-scroll .mrec-row:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: -3px;
}

.morders-ui > .mrec-order-scroll .mrec-row-main > strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--m-ink);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}

.morders-ui > .mrec-order-scroll .mrec-row-main .morders-row-reference {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 4px;
  overflow: visible;
  color: var(--orders-meta);
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
.morders-row-reference > span { white-space: nowrap; }

.morders-ui > .mrec-order-scroll .mrec-row-money { min-width: 0; padding-top: 1px; }
.morders-ui > .mrec-order-scroll .mrec-row-money > strong {
  color: var(--m-ink);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.2px;
}
.morders-ui > .mrec-order-scroll .mrec-row-money > small {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
}
.morders-ui > .mrec-order-scroll .mrec-row-money > small.is-due {
  color: var(--orders-accent-ink);
}
.morders-ui > .mrec-order-scroll .mrec-row-money > small.is-paid {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.morders-ui .morders-row-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-right: 40px;
}

.morders-ui .morders-delivery {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
}
.morders-ui .morders-delivery svg { flex: 0 0 auto; width: 13px; height: 13px; }
.morders-ui .morders-delivery.is-no { color: var(--m-ink-soft); background: var(--m-surface-2); }
.morders-ui .morders-delivery.is-mid { color: var(--m-amber-ink); background: var(--m-amber-soft); }
.morders-ui .morders-delivery.is-ok { color: var(--m-green-ink); background: var(--m-green-soft); }

.morders-ui .morders-row-operator {
  min-width: 0;
  overflow: hidden;
  color: var(--orders-meta);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.morders-ui .morders-row-operator > span + span::before { content: ' · '; }

.morders-ui .morders-row-options {
  position: absolute;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--m-surface);
  color: var(--m-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
}
.morders-ui .morders-row-options:active { background: var(--m-accent-soft); color: var(--orders-accent-ink); }
.morders-ui .morders-row-options:focus-visible { outline: 2px solid var(--m-accent); outline-offset: -3px; }

.morders-ui > .morders-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--m-line-strong);
  background: var(--m-surface);
}

.morders-ui .morders-footer-total { min-width: 0; }
.morders-ui .morders-footer-total > span {
  display: block;
  color: var(--orders-meta);
  font-size: 12px;
  line-height: 1.3;
}
.morders-ui .morders-footer-total > strong {
  display: block;
  margin-top: 2px;
  color: var(--m-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.morders-ui .morders-refresh {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--m-accent-border);
  border-radius: 9px;
  background: var(--m-accent-soft);
  color: var(--orders-accent-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  touch-action: manipulation;
  cursor: pointer;
}
.morders-ui .morders-refresh svg { width: 18px; height: 18px; }
.morders-ui .morders-refresh:active { background: var(--m-accent-soft-2); }
.morders-ui .morders-refresh:focus-visible { outline: 2px solid var(--m-accent); outline-offset: 2px; }
.morders-ui .morders-refresh:disabled { opacity: .6; cursor: wait; }

.morders-ui > .mrec-order-scroll .mrec-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 48px 24px;
  text-align: center;
}
.morders-ui > .mrec-order-scroll .mrec-empty > strong { margin: 0; font-size: 16px; }
.morders-ui > .mrec-order-scroll .mrec-empty > span { margin: 0; max-width: 280px; font-size: 13px; line-height: 1.5; }
.morders-ui .morders-loading-mark {
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  border: 2px solid var(--m-line-strong);
  border-top-color: var(--m-accent);
  border-radius: 50%;
  animation: morders-loading-turn .8s linear infinite;
}
@keyframes morders-loading-turn { to { transform: rotate(360deg); } }

@media (max-width: 380px) {
  .morders-ui > .mrec-list-tabs { min-height: 64px; padding-inline: 8px; }
  .morders-ui > .mrec-list-tabs button { min-height: 64px; padding-block: 4px; }
  /* Keep full labels and counts readable on narrow phones. The counters
     move below the labels instead of stealing width from their text. */
  .morders-ui .mrec-list-tab-main {
    display: grid;
    grid-template-rows: minmax(28px, auto) 22px;
    justify-items: center;
    gap: 3px;
    width: 100%;
  }
  .morders-ui .mrec-list-tab-main > span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .morders-ui > .mrec-order-scroll .mrec-row { column-gap: 8px; padding-inline: 12px; }
  .morders-ui > .morders-footer { gap: 8px; padding-inline: 12px; }
  .morders-ui .morders-refresh { padding-inline: 10px; }
  .morders-ui .morders-row-units { display: none; }
  .morders-ui .morders-row-operator > span + span::before { content: ''; }
}

@media (prefers-reduced-motion: reduce) {
  .morders-ui .morders-loading-mark { animation: none; }
  .morders-ui > .mrec-list-tabs button,
  .morders-ui > .mrec-order-scroll .mrec-row { transition: none; }
}

.morders-ui .mrec-order-scope-copy{flex:1;min-width:0}
.morders-ui .morders-scope-actions{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.morders-ui .morders-new-quick{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:40px;padding:8px 10px;border:1px solid var(--m-accent-solid);border-radius:8px;background:var(--m-accent-solid);color:#fff;font:inherit;font-size:12px;font-weight:700;white-space:nowrap}
.morders-ui .morders-new-quick svg{width:15px;height:15px;flex:0 0 auto}
.morders-ui .morders-new-quick>span{display:inline;margin:0;color:inherit;font-size:18px;line-height:1;font-weight:inherit}
.morders-ui .morders-new-quick:focus-visible{outline:2px solid var(--m-accent);outline-offset:2px}
.morders-ui>.mrec-order-scroll .mrec-row-money>small.morders-row-advance{margin-top:2px;color:var(--m-ink-soft);font-size:11px}
@media(max-width:350px){.morders-ui>.mrec-order-scope{padding-inline:12px;gap:8px}.morders-ui .morders-scope-actions{gap:5px}.morders-ui .morders-new-quick{padding-inline:8px;font-size:11px}}
