/* ARS-X 4.2 — заказы и работы */
.orders-table small.block, .order-items small.block { display: block; }
.order-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 12px; }
.order-grid .span-2 { grid-column: span 2; }
.order-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.order-items .qty-input { width: 90px; text-align: right; }
.order-items tr.row-done td { color: var(--muted, #667085); }
.order-items .ico.ok { color: var(--success, #12b76a); margin-right: 4px; vertical-align: -3px; }
.order-items tr.total td { border-top: 2px solid var(--line, #e4e7ec); }
.order-foot { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.orders-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.orders-day { background: var(--surface, #fff); border: 1px solid var(--line, #e4e7ec); border-radius: 10px; padding: 8px; min-height: 140px; display: flex; flex-direction: column; gap: 6px; }
.orders-day.today { border-color: var(--primary, #2563eb); box-shadow: inset 0 3px 0 var(--primary, #2563eb); }
.orders-day-head { font-weight: 600; font-size: 13px; text-transform: capitalize; }
.orders-chip { display: flex; gap: 6px; align-items: flex-start; text-align: left; width: 100%; border: 1px solid var(--line, #e4e7ec); background: var(--surface-2, #f8fafc);
  border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; color: inherit; cursor: pointer; min-height: 44px; }
.orders-chip small { display: block; color: var(--muted, #667085); }
.orders-chip.visit { background: color-mix(in srgb, var(--primary, #2563eb) 9%, transparent); }
.orders-chip.due { border-left: 3px solid var(--warning, #f79009); }
.orders-chip.overdue { border-left: 3px solid var(--danger, #f04438); }
.orders-chip .ico { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary, #2563eb); text-decoration: underline; cursor: pointer; font: inherit; }
@media (max-width: 900px) {
  .order-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-week { grid-template-columns: 1fr; }
  .orders-day { min-height: 0; }
}
.order-grid > .field { min-width: 0; }
.order-grid input, .order-grid select { width: 100%; min-width: 0; box-sizing: border-box; }
.next-modal-body .table-wrap { max-width: 100%; overflow-x: auto; }
.order-foot .btn { flex: 0 1 auto; }
@media (max-width: 600px) {
  .order-grid { grid-template-columns: 1fr; }
  .order-grid .span-2 { grid-column: auto; }
  .order-items th:nth-child(4), .order-items td:nth-child(4) { display: none; }
  .order-items .qty-input { width: 64px; }
  .order-foot .btn { flex: 1 1 100%; }
}
/* 4.2: окно не шире экрана — широкое содержимое (таблицы) прокручивается внутри, а не раздвигает окно на телефоне */
.next-modal-backdrop { grid-template-columns: minmax(0, 1fr); }
.next-modal { min-width: 0; max-width: 100%; }
.next-modal-body { min-width: 0; overflow-x: hidden; }
