body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.container {
  width: calc(100% - 32px);
  max-width: none;
  margin: 12px 16px 24px 16px;
  padding: 16px;
  box-sizing: border-box;
}

h1 {
  margin-bottom: 20px;
}

.test-environment-banner {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px 0;
  padding: 14px 18px;
  border: 3px solid #dc2626;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  animation: test-environment-blink 1s infinite;
}

.test-environment-banner[hidden] {
  display: none !important;
}

@keyframes test-environment-blink {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 rgba(220, 38, 38, 0);
  }

  50% {
    opacity: 0.25;
    box-shadow: 0 0 18px rgba(220, 38, 38, 0.55);
  }
}

.panel {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  align-items: center;
}

button {
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  background: #ef4444;
  color: white;
}

select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  background: white;
  min-width: 220px;
}

.order-code-filter-input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  background: white;
  min-width: 250px;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.status {
  margin-bottom: 15px;
  padding: 12px;
  background: white;
  border-radius: 8px;
}

.app-message {
  margin: 0 0 16px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  line-height: 1.35;
}

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

.app-message.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.app-message.success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.app-message.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.app-message.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 14px;
}

th {
  background: #111827;
  color: white;
}

.secondary {
  background: #374151;
}

.settings-section {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.courier-admin-section {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.form-row input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}

.settings-section[hidden] {
  display: none;
}

.settings-section h2 {
  margin-top: 0;
}

.small-note {
  color: #4b5563;
  font-size: 14px;
}

.settings-table {
  margin-bottom: 15px;
}

.settings-table input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 9px;
  font-size: 14px;
}

.settings-table .token-input {
  font-family: Consolas, monospace;
}

.remove-shop-btn {
  background: #6b7280;
  padding: 8px 10px;
}

.order-item {
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.order-item-name {
  color: #111827;
}

.order-item-qty {
  color: #dc2626;
  font-weight: bold;
}

.select-col {
  width: 42px;
  text-align: center;
}

.select-col input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.overdue-row td {
  background: #fee2e2;
}

.overdue-date {
  color: #b91c1c;
  font-weight: bold;
}

.current-cutoff-row td {
  background: #e8f8ee;
}

.current-cutoff-row:hover td {
  background: #d9f3e3;
}

.archive-delivered-row td {
  background: #e8f8ee;
}

.archive-delivered-row:hover td {
  background: #d9f3e3;
}

.archive-other-row td {
  background: #fee2e2;
}

.archive-other-row:hover td {
  background: #fecaca;
}

.shop-cutoff-input {
  min-width: 110px;
}

.order-item-name {
  color: #111827;
}

.order-item-qty {
  color: #dc2626;
  font-weight: bold;
  white-space: nowrap;
}

.success {
  background: #16a34a;
}

.success:hover:not(:disabled) {
  background: #15803d;
}

.success:disabled {
  background: #86efac;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 1;
}

.top-menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.top-menu-btn {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.top-menu-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.page-section {
  display: block;
}

.page-section[hidden] {
  display: none;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}

.view-tab {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.view-tab:hover {
  background: #f3f4f6;
}

.view-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.courier-table {
  margin-bottom: 20px;
}

.courier-form {
  margin-bottom: 20px;
}

.courier-form .panel {
  justify-content: flex-start;
}

.courier-form .small-note {
  margin-top: 8px;
}

.courier-action-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
}

.courier-action-btn:hover:not(:disabled) {
  background: #dc2626;
}

.archive-btn {
  background: #6b7280;
  color: #ffffff;
  border: none;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
}

.archive-btn:hover {
  background: #4b5563;
}

.order-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
}

.order-badge.missing {
  background: #fee2e2;
  color: #991b1b;
}

.order-badge.archive {
  background: #e5e7eb;
  color: #374151;
}

.archive-selected-btn {
  background: #6b7280;
  color: #ffffff;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.archive-selected-btn:hover:not(:disabled) {
  background: #4b5563;
}

.archive-selected-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.phone-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.phone-link:hover {
  text-decoration: underline;
}

.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

.auth-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: min(100%, 420px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.auth-card h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #374151;
  font-size: 14px;
}

.auth-form input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}

.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: white;
  border-radius: 10px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-meta span:first-child {
  font-weight: 700;
}

.user-meta span:last-child {
  color: #6b7280;
  font-size: 13px;
  text-transform: uppercase;
}

.courier-stub {
  background: white;
  border-radius: 12px;
  padding: 24px;
}

.courier-stub h2 {
  margin-top: 0;
}

.courier-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.courier-page-header h2 {
  margin: 0 0 4px 0;
}

.courier-orders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.courier-empty-state {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  color: #4b5563;
}

.courier-order-card {
  background: #e9fbef;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.courier-order-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.courier-order-title-wrap {
  min-width: 0;
}

.courier-order-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}

.courier-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #4b5563;
  font-size: 13px;
}

.courier-complete-btn {
  flex: 0 0 auto;
  padding: 9px 13px;
}

.courier-order-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.courier-order-field {
  background: #f8fffb;
  border: 1px solid #cdebd7;
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
}

.courier-order-field-wide {
  grid-column: 1 / -1;
}

.courier-order-field-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.courier-order-field-value {
  color: #111827;
  font-size: 14px;
  word-break: break-word;
}

@media (max-width: 760px) {
  .courier-order-card-header {
    flex-direction: column;
  }

  .courier-complete-btn {
    width: 100%;
  }

  .courier-order-fields {
    grid-template-columns: 1fr;
  }
}
.order-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.order-link:hover {
  text-decoration: underline;
}

.order-detail-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.order-detail-field {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}

.order-detail-label {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 4px;
}

.order-detail-value {
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  word-break: break-word;
}

.order-action-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.code-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.code-form input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
  min-width: 220px;
}

.order-detail-items {
  margin-top: 12px;
}

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

.order-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.order-page-header h1 {
  margin: 0;
}

.button-link {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  color: white;
  text-decoration: none;
}

.button-link.secondary {
  background: #374151;
}

.button-link.secondary:hover {
  background: #1f2937;
}

.courier-zone-btn {
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.courier-zone-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  margin: 20px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.courier-zone-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.courier-zone-header h3 {
  margin: 0 0 6px 0;
}

.zone-map {
  width: 100%;
  height: 520px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
  background: #e5e7eb;
}

.zone-actions {
  margin-top: 12px;
}

.zone-point-list {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 12px 12px 32px;
  max-height: 180px;
  overflow: auto;
}

.zone-point-list li {
  margin-bottom: 6px;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.warehouse-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0 22px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.warehouse-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.warehouse-header h3 {
  margin: 0 0 6px 0;
}

.warehouse-map {
  width: 100%;
  height: 420px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
  background: #e5e7eb;
}

.gis-link {
  display: inline-block;
  border-radius: 8px;
  padding: 8px 12px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.gis-link:hover {
  background: #1d4ed8;
  text-decoration: none;
}

.order-map-actions {
  margin-top: 8px;
  margin-bottom: 12px;
}

.shop-warehouses-cell {
  min-width: 210px;
}

.shop-warehouse-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.shop-warehouse-count {
  min-width: 72px;
  color: #4b5563;
  font-size: 13px;
  white-space: nowrap;
}

.configure-warehouses-btn,
.warehouse-map-btn,
.add-warehouse-btn,
.remove-warehouse-btn {
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.warehouse-map-btn {
  background: #2563eb;
}

.warehouse-settings-modal[hidden],
.warehouse-map-modal[hidden] {
  display: none;
}

.warehouse-settings-modal,
.warehouse-map-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.55);
}

.warehouse-settings-modal {
  z-index: 1000;
}

.warehouse-map-modal {
  z-index: 1100;
}

.warehouse-settings-card,
.warehouse-map-card {
  width: min(100%, 1180px);
  max-height: 92vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.warehouse-map-card {
  width: min(100%, 920px);
}

.warehouse-settings-header,
.warehouse-map-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.warehouse-settings-header h3,
.warehouse-map-header h3 {
  margin: 0 0 6px 0;
}

.warehouse-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
  padding: 2px;
}

.warehouse-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.warehouse-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  min-width: 0;
}

.warehouse-settings-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.warehouse-settings-field-wide {
  grid-column: 1 / -1;
}

.warehouse-settings-row input {
  min-width: 0;
  width: 100%;
}

.warehouse-settings-row input[readonly] {
  background: #eef2f7;
  color: #475569;
  cursor: not-allowed;
}

.warehouse-settings-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.warehouse-modal-empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
  text-align: center;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
}

.warehouse-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.warehouse-settings-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.warehouse-point-map {
  width: 100%;
  height: 520px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
  background: #e5e7eb;
}

@media (max-width: 900px) {
  .shop-warehouses-cell {
    min-width: 190px;
  }

  .warehouse-settings-row,
  .warehouse-settings-fields {
    grid-template-columns: 1fr;
  }

  .warehouse-settings-field-wide {
    grid-column: auto;
  }

  .warehouse-settings-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .warehouse-settings-actions button {
    flex: 1 1 150px;
  }

  .warehouse-settings-card,
  .warehouse-map-card {
    max-height: 96vh;
  }

  .warehouse-settings-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .warehouse-settings-footer-actions {
    justify-content: stretch;
  }

  .warehouse-settings-footer-actions button,
  .warehouse-settings-footer > button {
    flex: 1;
  }

  .warehouse-point-map {
    height: 420px;
  }
}


.order-status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
  white-space: nowrap;
}

.order-status-badge.status-packed {
  background: #ecfdf5;
  color: #166534;
}

.order-status-badge.status-handed_to_courier {
  background: #eff6ff;
  color: #1d4ed8;
}

.order-status-badge.status-cancelled_after_courier_transfer {
  background: #fef2f2;
  color: #991b1b;
}

.order-status-badge.status-archive {
  background: #e5e7eb;
  color: #374151;
}


.problem-orders-warning {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
  animation: problem-warning-blink 1.2s infinite;
}

.problem-orders-warning[hidden] {
  display: none;
}

@keyframes problem-warning-blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.problem-order-row td {
  background: #fecaca !important;
  color: #7f1d1d;
  font-weight: 700;
}

.problem-order-row:hover td {
  background: #fca5a5 !important;
}


.scan-order-modal[hidden] {
  display: none;
}

.scan-order-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.55);
}

.scan-order-card {
  position: relative;
  width: min(100%, 560px);
  background: #ffffff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.scan-order-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

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

.scan-order-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.scan-order-form input {
  border: 2px solid #2563eb;
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.scan-order-status {
  margin-top: 12px;
  min-height: 20px;
  font-weight: 700;
}

.scan-order-status.success {
  color: #166534;
}

.scan-order-status.error {
  color: #991b1b;
}

.mobile-camera-scanner[hidden],
.camera-scanner-preview[hidden],
.camera-scanner-controls button[hidden] {
  display: none !important;
}

.mobile-camera-scanner {
  display: none;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

.camera-scanner-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #0f172a;
}

.camera-scanner-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-scanner-frame {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 29%;
  bottom: 29%;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.camera-scanner-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.camera-scan-start {
  min-height: 46px;
  font-size: 17px;
  font-weight: 800;
}

.camera-scanner-status {
  min-height: 20px;
  margin-top: 10px;
  font-weight: 700;
}

.camera-scanner-status.scanning {
  color: #1d4ed8;
}

.camera-scanner-status.success {
  color: #166534;
}

.camera-scanner-status.warning {
  color: #92400e;
}

.camera-scanner-status.error {
  color: #991b1b;
}

.camera-scanner-help {
  margin: 6px 0 0;
}

.camera-scanner-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.camera-scanner-divider::before,
.camera-scanner-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #cbd5e1;
}

.mobile-camera-scanner.camera-scanner-enabled:not([hidden]) {
  display: block;
}

@media (max-width: 860px), (pointer: coarse) {
  .scan-order-modal {
    align-items: flex-start;
    padding: 10px;
  }

  .scan-order-card {
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  .scan-order-form {
    grid-template-columns: 1fr;
  }

  .camera-scanner-controls {
    grid-template-columns: 1fr;
  }

  .camera-scanner-controls button {
    width: 100%;
  }
}


.orders-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 250px;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.orders-filter-sidebar,
.orders-scanner-sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-section + .sidebar-section {
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.orders-filter-sidebar h3,
.orders-scanner-sidebar h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.orders-filter-sidebar select,
.orders-filter-sidebar input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.orders-filter-sidebar select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: #e5e7eb;
  color: #6b7280;
}

.orders-main-content {
  min-width: 0;
}

.orders-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 15px;
}

.orders-toolbar-main {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.scan-actions-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
}

.scan-action-btn {
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 9px;
  color: #ffffff;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
}

.scan-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.18);
}

.scan-action-pack {
  background: #2563eb;
}

.scan-action-pack:hover:not(:disabled) {
  background: #1d4ed8;
}

.scan-action-pack-hand {
  background: #059669;
}

.scan-action-pack-hand:hover:not(:disabled) {
  background: #047857;
}

.scan-action-hand {
  background: #7c3aed;
}

.scan-action-hand:hover:not(:disabled) {
  background: #6d28d9;
}

.scan-action-accept {
  background: #f97316;
}

.scan-action-accept:hover:not(:disabled) {
  background: #ea580c;
}

.orders-distribution-section {
  margin: 0 0 16px 0;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.04);
}

.orders-distribution-section h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.distribution-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.distribution-toolbar button,
.distribution-toolbar select {
  width: auto;
  min-width: 180px;
  box-sizing: border-box;
}

.distribution-toolbar select {
  flex: 1 1 220px;
  max-width: 280px;
}

.distribution-status {
  margin: 12px 0 0 0;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  line-height: 1.35;
}

.distribution-error-dialog[hidden] {
  display: none;
}

.distribution-error-dialog {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(69, 10, 10, 0.48);
  backdrop-filter: blur(2px);
}

.distribution-error-card {
  width: min(100%, 520px);
  border: 2px solid #7f1d1d;
  border-radius: 14px;
  background: #b91c1c;
  color: #ffffff;
  padding: 20px;
  box-shadow: 0 22px 55px rgba(69, 10, 10, 0.42);
}

.distribution-error-title {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 900;
}

.distribution-error-message {
  margin-bottom: 18px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 700;
}

.distribution-error-ok-btn {
  display: block;
  min-width: 110px;
  margin-left: auto;
  background: #ffffff;
  color: #991b1b;
  font-weight: 900;
}

.distribution-error-ok-btn:hover:not(:disabled),
.distribution-error-ok-btn:focus {
  background: #fee2e2;
  outline: 3px solid rgba(255, 255, 255, 0.45);
}

.scan-error-dialog[hidden] {
  display: none;
}

.scan-error-dialog {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  border-radius: 14px;
}

.scan-error-card {
  width: min(100%, 430px);
  border: 2px solid #ef4444;
  border-radius: 14px;
  background: #fef2f2;
  color: #7f1d1d;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(127, 29, 29, 0.22);
}

.scan-error-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
}

.scan-error-message {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  margin-bottom: 16px;
}

.scan-error-ok-btn {
  display: block;
  min-width: 100px;
  margin-left: auto;
  background: #dc2626;
  color: #ffffff;
  font-weight: 900;
}

.scan-error-ok-btn:hover:not(:disabled),
.scan-error-ok-btn:focus {
  background: #b91c1c;
  outline: 3px solid rgba(239, 68, 68, 0.3);
}

@media (max-width: 1200px) {
  .orders-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .orders-scanner-sidebar {
    grid-column: 1 / -1;
    position: static;
  }

  .scan-actions-panel {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .scan-action-btn {
    flex: 1 1 220px;
  }
}

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

  .orders-filter-sidebar,
  .orders-scanner-sidebar {
    position: static;
  }

  .orders-toolbar {
    flex-direction: column;
  }

  .scan-actions-panel {
    width: 100%;
    flex: 0 0 auto;
    margin-left: 0;
  }

  .distribution-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .distribution-toolbar button,
  .distribution-toolbar select {
    width: 100%;
    max-width: none;
  }
}


.courier-order-field-map,
.order-detail-field-map {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.courier-order-field-map .gis-link,
.order-detail-field-map .gis-link {
  width: fit-content;
}

.courier-delivery-actions {
  background: #ffffff;
}

.courier-order-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.courier-security-code-input {
  min-width: 170px;
  max-width: 220px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

.courier-action-note {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .courier-order-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .courier-security-code-input,
  .courier-order-action-row button {
    width: 100%;
    max-width: none;
  }
}


.courier-delivery-actions,
.order-action-card {
  position: relative;
}

.inline-action-message {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 24px rgba(185, 28, 28, 0.16);
  pointer-events: none;
}

.inline-action-message[hidden] {
  display: none;
}

.order-action-message {
  left: 20px;
  right: 20px;
}

/* Courier order list visual highlight */
.courier-order-card {
  background: #d1d5db;
  border-color: #9ca3af;
}

.courier-order-card .courier-order-field {
  background: #f3f4f6;
  border-color: #cbd5e1;
}

.courier-order-card .courier-delivery-actions {
  background: #f3f4f6;
}

/* Match courier list send-code button with order detail send-code button */
.courier-send-code-btn:not(:disabled) {
  background: #ef4444;
  color: #ffffff;
}

.courier-send-code-btn:not(:disabled):hover {
  background: #dc2626;
}

/* Delivery zones management */
.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-title-row h2 {
  margin: 0 0 6px 0;
}

.delivery-zones-table .delivery-zone-comment-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-action-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table-action-row button {
  padding: 7px 10px;
  font-size: 13px;
}

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

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.58);
}

.app-modal-card {
  width: min(100%, 760px);
  max-height: 94vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.app-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.app-modal-header h3 {
  margin: 0 0 6px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.modal-close-btn {
  min-width: 38px;
  min-height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.modal-close-btn:hover:not(:disabled),
.modal-close-btn:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
}

.courier-create-modal-card,
.courier-delete-modal-card {
  position: relative;
}

.courier-create-modal-card {
  width: min(100%, 760px);
}

.courier-delete-modal-card {
  width: min(100%, 520px);
}

.courier-modal-form {
  margin-bottom: 0;
}

.courier-modal-status {
  min-height: 20px;
  margin-top: 12px;
  font-weight: 800;
}

.courier-modal-status.success {
  color: #15803d;
}

.courier-modal-status.error {
  color: #b91c1c;
}

.courier-inline-dialog[hidden] {
  display: none;
}

.courier-inline-dialog {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2px);
}

.courier-confirm-card {
  width: min(100%, 470px);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(120, 53, 15, 0.18);
}

.courier-confirm-warning {
  border: 2px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.courier-confirm-message {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.45;
}

.courier-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.courier-delete-question {
  padding: 15px 16px;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.4;
}

.courier-target-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}

.courier-target-field select {
  width: 100%;
}

@media (max-width: 640px) {
  .courier-create-modal-card .form-row {
    grid-template-columns: 1fr;
  }

  .courier-confirm-actions,
  .courier-create-modal-card .modal-actions,
  .courier-delete-modal-card .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.delivery-zone-editor-card {
  width: min(100%, 1100px);
}

.delivery-zone-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) minmax(260px, 1fr);
  gap: 12px;
}

.delivery-zone-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.delivery-zone-form-grid input,
.delivery-zone-form-grid textarea {
  width: 100%;
  box-sizing: border-box;
}

.delivery-zone-comment-field {
  grid-column: 1 / -1;
}

.delivery-zone-map {
  width: 100%;
  height: 470px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #e5e7eb;
}

.delivery-zone-map-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.delivery-zone-coordinate-table-wrap {
  max-height: 310px;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.delivery-zone-coordinate-table {
  margin: 0;
}

.delivery-zone-coordinate-table th,
.delivery-zone-coordinate-table td {
  padding: 8px;
}

.delivery-zone-coordinate-table input {
  min-width: 150px;
  width: 100%;
  box-sizing: border-box;
  font-family: Consolas, monospace;
}

.coordinate-remove-btn {
  padding: 7px 10px;
  font-size: 13px;
}

.courier-zone-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.courier-zone-codes {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  color: #374151;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.courier-zone-selection-card {
  width: min(100%, 760px);
}

.delivery-zone-selection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 55vh;
  overflow: auto;
  padding: 4px;
}

.delivery-zone-selection-item {
  display: grid;
  grid-template-columns: auto minmax(58px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  cursor: pointer;
}

.delivery-zone-selection-item:hover {
  background: #f9fafb;
}

.delivery-zone-selection-code {
  font-weight: 800;
  white-space: nowrap;
}

.delivery-zone-selection-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .page-title-row {
    flex-direction: column;
  }

  .delivery-zone-form-grid,
  .delivery-zone-selection-list {
    grid-template-columns: 1fr;
  }

  .delivery-zone-map {
    height: 390px;
  }

  .courier-zone-cell {
    align-items: flex-start;
    flex-direction: column;
  }

  .courier-zone-codes {
    max-width: 170px;
  }
}


/* Постраничная навигация для административных списков */
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 18px;
  padding: 10px 12px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
}

.list-pagination[hidden] {
  display: none !important;
}

.list-pagination-summary {
  font-weight: 700;
  white-space: nowrap;
}

.list-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.list-pagination-page {
  min-width: 118px;
  text-align: center;
  font-weight: 700;
}

.list-page-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 18px;
  line-height: 1;
}

.list-page-btn:hover:not(:disabled) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.list-page-btn:disabled {
  cursor: default;
  opacity: 0.38;
}

@media (max-width: 640px) {
  .list-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .list-pagination-controls {
    justify-content: space-between;
  }

  .list-pagination-page {
    min-width: 0;
  }
}

/* Courier availability, limits and calculated load */
.courier-table {
  min-width: 1380px;
}

.courier-availability-field {
  display: flex;
  min-width: 110px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.courier-availability-field input,
.courier-availability-toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.courier-availability-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.courier-unavailable-row td {
  background: #f3f4f6;
  color: #6b7280;
}

.courier-unavailable-row:hover td {
  background: #e5e7eb;
}

.courier-load-list {
  display: grid;
  gap: 7px;
  min-width: 220px;
}

.courier-load-row {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 12px;
  line-height: 1.25;
}

.courier-load-row span {
  color: #4b5563;
}

.courier-load-full {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.courier-load-exceeded {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.courier-limit-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
}

.courier-limit-editor input {
  width: 90px;
  min-width: 0;
  padding: 6px 8px;
}

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

.courier-settings-save-btn {
  padding: 6px 10px;
  white-space: nowrap;
}

.courier-zone-selection-card {
  position: relative;
}

.last-order-sync-at {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 4px;
  color: #4b5563;
  font-size: 14px;
  white-space: nowrap;
}

.last-order-sync-at.sync-running {
  color: #b45309;
  font-weight: 700;
}

#loadOrdersBtn.sync-running {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.program-settings-section {
  max-width: 980px;
}

.program-settings-card {
  padding: 20px;
  border: 1px solid #d9dee7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.program-settings-card h3 {
  margin-top: 0;
}

.program-settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 700;
}

.program-settings-toggle input,
.weekday-checkboxes input {
  width: 18px;
  height: 18px;
}

.program-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.program-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 600;
}

.program-settings-grid input {
  width: 100%;
}

.program-settings-days {
  margin-bottom: 16px;
}

.program-settings-days-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 700;
}

.weekday-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.weekday-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 68px;
  padding: 9px 12px;
  border: 1px solid #d7dce5;
  border-radius: 8px;
  background: #f8fafc;
}

@media (max-width: 900px) {
  .program-settings-grid {
    grid-template-columns: 1fr;
  }

  .last-order-sync-at {
    width: 100%;
  }
}

.product-sync-status {
  margin: 10px 0 8px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
}

.product-sync-status.success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.product-sync-status.error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.product-sync-status.running {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.product-photo-col {
  width: 112px;
  min-width: 112px;
}

.order-product-photos {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  overflow-x: auto;
  padding: 2px 0;
}

.order-product-photo,
.order-detail-product-photo {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: cover;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  background: #fff;
}

.order-product-photo {
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.order-product-photo:hover,
.order-product-photo:focus-visible {
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.16);
  outline: none;
  transform: scale(1.04);
}

.product-image-preview-open {
  overflow: hidden;
}

.product-image-preview-modal[hidden] {
  display: none !important;
}

.product-image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.82);
}

.product-image-preview-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(94vw, 1100px);
  max-height: 94vh;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.product-image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 8px 10px 8px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.product-image-preview-title {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-preview-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.product-image-preview-close:hover,
.product-image-preview-close:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
  outline: none;
}

.product-image-preview-body {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 18px;
  background: #f8fafc;
}

.product-image-preview-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(94vh - 118px);
  object-fit: contain;
}

.product-image-preview-caption {
  min-height: 42px;
  padding: 11px 18px 13px;
  overflow: hidden;
  border-top: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .product-image-preview-modal {
    padding: 10px;
  }

  .product-image-preview-dialog {
    width: 100%;
    max-height: 96vh;
    border-radius: 10px;
  }

  .product-image-preview-body {
    padding: 8px;
  }

  .product-image-preview-img {
    max-height: calc(96vh - 108px);
  }

  .product-image-preview-caption {
    padding: 9px 12px 11px;
    font-size: 12px;
  }
}

.product-photo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 9px;
  text-align: center;
}

.order-detail-photo-col {
  width: 76px;
  min-width: 76px;
}

.order-detail-product-photo {
  width: 64px;
  height: 64px;
}

.order-detail-photo-placeholder {
  width: 64px;
  height: 64px;
}

.photo-agent-card {
  margin-top: 18px;
}

.photo-agent-auth-card {
  width: min(460px, calc(100vw - 32px));
}

.photo-agent-password-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
}

.photo-agent-password-label input {
  width: 100%;
}

/* Brand header and favicon logo */
.brand-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: block;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0 0 4px;
  line-height: 1.15;
}

.brand-copy p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .brand-header {
    gap: 12px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 13px;
  }

  .brand-copy h1 {
    font-size: 25px;
  }

  .brand-copy p {
    font-size: 13px;
  }
}


/* =========================================================
   Новый административный интерфейс
   ========================================================= */
:root {
  --ui-bg: #f7f8fa;
  --ui-card: #ffffff;
  --ui-border: #e5e8ee;
  --ui-text: #111827;
  --ui-muted: #6b7280;
  --ui-red: #ef4444;
  --ui-red-dark: #dc2626;
  --ui-red-soft: #fff1f2;
  --ui-green: #16a34a;
  --ui-shadow: 0 10px 30px rgba(15, 23, 42, 0.055);
  --sidebar-width: 246px;
  --sidebar-collapsed-width: 78px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body > .container {
  display: none;
}

/* Страница отдельной карточки заказа использует старый контейнер. */
body.order-detail-page > .container {
  display: block;
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(239, 68, 68, 0.09), transparent 34%),
    #f7f8fa;
}

.auth-page[hidden] {
  display: none !important;
}

.auth-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--ui-shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

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

.auth-brand strong {
  margin-bottom: 3px;
  font-size: 16px;
}

.auth-brand span {
  color: var(--ui-muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.app-shell[hidden] {
  display: none !important;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--ui-border);
  background: #fff;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 8px 16px;
  border-bottom: 1px solid #f0f1f4;
}

.sidebar-brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
}

.sidebar-brand-title {
  min-width: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.sidebar-navigation {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
}

.sidebar-nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 2px;
}

.side-nav-item,
.tree-toggle-btn,
.sidebar-collapse-btn {
  border: 0;
  background: transparent;
  color: #374151;
  box-shadow: none;
}

.side-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}

.side-nav-item:hover:not(:disabled),
.tree-toggle-btn:hover:not(:disabled),
.sidebar-collapse-btn:hover:not(:disabled) {
  background: #f6f7f9;
  color: #111827;
}

.side-nav-item.active,
.side-nav-item.active-parent {
  background: var(--ui-red-soft);
  color: var(--ui-red-dark);
}

.side-nav-root {
  font-weight: 800;
}

.side-nav-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: #475569;
  font-size: 19px;
  line-height: 1;
}

.side-nav-item.active .side-nav-icon {
  color: var(--ui-red);
}

.side-nav-label {
  min-width: 0;
  flex: 1 1 auto;
}

.tree-toggle-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  color: #64748b;
  font-size: 18px;
  transform: rotate(0deg);
}

.tree-toggle-btn.collapsed {
  transform: rotate(-90deg);
}

.tree-children[hidden] {
  display: none !important;
}

.tree-children {
  position: relative;
  padding-left: 18px;
}

.tree-children::before {
  position: absolute;
  top: 2px;
  bottom: 7px;
  left: 17px;
  width: 1px;
  background: #e2e5ea;
  content: "";
}

.tree-item {
  min-height: 38px;
  padding: 7px 8px 7px 14px;
  font-size: 13px;
  font-weight: 500;
}

.tree-branch {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 1px;
  flex: 0 0 10px;
  background: #d4d9e1;
}

.archive-tree-toggle {
  padding-right: 6px;
}

.tree-chevron {
  margin-left: 2px;
  color: #64748b;
  font-size: 16px;
  transition: transform 0.16s ease;
}

.archive-tree-toggle.collapsed .tree-chevron {
  transform: rotate(-90deg);
}

.tree-children-nested {
  margin-left: 9px;
  padding-left: 10px;
}

.tree-children-nested::before {
  left: 9px;
}

.tree-item-nested {
  padding-left: 8px;
}

.all-orders-tree-item {
  margin-top: 4px;
  font-weight: 700;
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.nav-count[hidden] {
  display: none !important;
}

.nav-count-zero {
  background: #f1f3f5;
  color: #9ca3af;
}

.nav-count-danger:not(.nav-count-zero) {
  background: #fee2e2;
  color: #b91c1c;
}

.nav-count-primary:not(.nav-count-zero) {
  background: #d1fae5;
  color: #047857;
}

.sidebar-divider {
  height: 1px;
  margin: 10px 8px;
  background: #eef0f3;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-top: 1px solid #eef0f3;
  border-radius: 8px;
  color: #64748b;
  font-size: 13px;
  text-align: left;
}

.app-workspace {
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 24px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-title-block {
  min-width: 0;
}

.topbar-title-block h1 {
  margin: 0;
  color: #111827;
  font-size: 25px;
  line-height: 1.2;
}

.topbar-subtitle {
  display: block;
  margin-top: 3px;
  color: #7a8290;
  font-size: 12px;
}

.topbar-subtitle[hidden] {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 16px;
}

.last-order-sync-at {
  min-height: auto;
  padding: 0;
  color: #64748b;
  font-size: 12px;
}

.auto-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 16px;
  border-left: 1px solid #e5e7eb;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.auto-sync-indicator strong {
  color: #64748b;
}

.auto-sync-indicator.enabled strong {
  color: #16a34a;
}

.auto-sync-indicator.disabled strong {
  color: #dc2626;
}

.auto-sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.14);
}

.auto-sync-indicator.enabled .auto-sync-dot {
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.13);
}

.auto-sync-indicator.disabled .auto-sync-dot {
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12);
}

.topbar-icon-btn,
.toolbar-icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e1e5eb;
  border-radius: 9px;
  background: #fff;
  color: #475569;
  box-shadow: none;
  font-size: 20px;
}

.topbar-icon-btn:hover:not(:disabled),
.toolbar-icon-btn:hover:not(:disabled) {
  border-color: #cbd2dc;
  background: #f8fafc;
  color: #111827;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 1px solid #e5e7eb;
  border-radius: 0;
  background: transparent;
}

.user-bar[hidden] {
  display: none !important;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef1f5;
  color: #9ca3af;
  font-size: 14px;
}

.user-meta {
  gap: 1px;
}

.user-meta span:first-child {
  max-width: 170px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span:last-child {
  font-size: 10px;
}

.logout-btn {
  padding: 7px 9px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #64748b;
  font-size: 11px;
}

.logout-btn:hover:not(:disabled) {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.app-content {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 18px 22px 30px;
}

.test-environment-banner {
  margin-bottom: 14px;
  font-size: 20px;
}

.app-message {
  margin-bottom: 14px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.orders-command-card,
.orders-list-card,
.page-section > .courier-form,
.page-section > table,
.delivery-zones-section,
.settings-section,
.program-settings-card,
.courier-stub {
  border: 1px solid var(--ui-border);
  border-radius: 13px;
  background: var(--ui-card);
  box-shadow: var(--ui-shadow);
}

.orders-command-card {
  margin-bottom: 14px;
  padding: 12px;
}

.orders-toolbar {
  justify-content: flex-end;
  margin: 0 0 12px;
}

.orders-toolbar-main {
  justify-content: flex-end;
  gap: 9px;
}

.primary-action-btn,
.toolbar-action-btn {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  background: #fff;
  color: #273244;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.primary-action-btn {
  border-color: var(--ui-red);
  background: linear-gradient(180deg, #f04444 0%, #e93434 100%);
  color: #fff;
  box-shadow: 0 7px 16px rgba(239, 68, 68, 0.22);
}

.primary-action-btn:hover:not(:disabled) {
  background: var(--ui-red-dark);
  transform: translateY(-1px);
}

.toolbar-action-btn:hover:not(:disabled) {
  border-color: #c9d0db;
  background: #f8fafc;
}

.toolbar-action-btn:disabled,
.primary-action-btn:disabled {
  border-color: #e5e7eb;
  background: #f1f3f5;
  color: #a0a7b2;
  box-shadow: none;
}

.orders-filters-card {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(260px, 1.4fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid #ebedf1;
  border-radius: 10px;
  background: #fff;
}

.orders-filters-card label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.orders-filters-card label > span,
.order-filter-label {
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
}

.order-filter-field {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.order-multiselect-btn {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid #dfe3e9;
  border-radius: 8px;
  background: #fff;
  color: #243044;
  font-size: 12px;
  text-align: left;
}

.order-multiselect-btn > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-multiselect-btn:hover:not(:disabled),
.order-multiselect-btn[aria-expanded="true"] {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.09);
}

.order-multiselect-btn:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.order-multiselect-chevron {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 10px;
}

.order-multiselect-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: min(360px, calc(100vw - 36px));
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #dfe3e9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.shop-warehouse-filter-panel {
  width: min(470px, calc(100vw - 36px));
}

.order-multiselect-option {
  display: flex !important;
  min-height: 34px;
  align-items: center;
  flex-direction: row !important;
  gap: 8px !important;
  padding: 7px 8px;
  border-radius: 7px;
  color: #243044;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.order-multiselect-option:hover {
  background: #f8fafc;
}

.order-multiselect-option > span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

.order-multiselect-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  accent-color: var(--ui-red);
}

.order-multiselect-option-all {
  margin-bottom: 5px;
  border-bottom: 1px solid #edf0f3;
  border-radius: 0;
  font-weight: 700;
}

.order-shop-filter-group + .order-shop-filter-group {
  margin-top: 3px;
}

.order-shop-filter-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-shop-option {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 700;
}

.order-shop-option > span,
.order-warehouse-option > span:not(.order-filter-inactive-badge) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-shop-expand-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  border: 1px solid #dfe3e9;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-weight: 800;
}

.order-shop-expand-btn:disabled {
  visibility: hidden;
}

.order-shop-warehouse-list {
  margin: 2px 0 5px 32px;
  padding-left: 6px;
  border-left: 1px solid #e5e7eb;
}

.order-warehouse-option.is-inactive {
  color: #64748b;
}

.order-filter-inactive-badge {
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.order-filter-empty {
  padding: 10px;
  color: #94a3b8;
  font-size: 11px;
  text-align: center;
}

.orders-filters-card select,
.orders-filters-card input,
.orders-selection-toolbar select {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 8px 11px;
  border: 1px solid #dfe3e9;
  border-radius: 8px;
  background: #fff;
  color: #243044;
  font-size: 12px;
  outline: none;
}

.orders-filters-card select:focus,
.orders-filters-card input:focus,
.orders-selection-toolbar select:focus {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.09);
}

.orders-filters-card select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
}

.reset-filters-btn {
  min-height: 39px;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.reset-filters-btn:hover:not(:disabled) {
  background: #f8fafc;
  color: #111827;
}

.orders-list-card {
  overflow: hidden;
}

.orders-selection-toolbar {
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #eceef2;
  background: #fff;
  flex-wrap: wrap;
}

.orders-selection-toolbar strong {
  min-width: 95px;
  margin-right: 4px;
  color: #374151;
  font-size: 12px;
}

.orders-selection-toolbar select {
  width: auto;
  min-width: 190px;
}

.orders-status-strip {
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) minmax(230px, 1fr) minmax(230px, 1fr);
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #eceef2;
  background: #fafbfc;
}

.orders-status-strip .status,
.orders-status-strip .product-sync-status {
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.orders-status-strip .product-sync-status.success,
.orders-status-strip .product-sync-status.error,
.orders-status-strip .product-sync-status.running {
  background: transparent;
}

.orders-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.orders-table {
  min-width: 1360px;
  border-radius: 0;
  background: #fff;
}

.orders-table th,
.orders-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf0f3;
  font-size: 11px;
  line-height: 1.4;
  vertical-align: middle;
}

.orders-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafbfc;
  color: #334155;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.orders-table tbody tr:hover td {
  background: #fafcff;
}

.orders-table .select-col {
  width: 46px;
}

.orders-table input[type="checkbox"] {
  accent-color: var(--ui-red);
}

.orders-table .order-link {
  color: #1570d8;
  font-weight: 800;
}

.orders-table .order-status-badge {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 10px;
}

.order-status-badge.status-new {
  background: #eaf2ff;
  color: #2563eb;
}

.order-status-badge.status-packed {
  background: #e8f8ee;
  color: #16834a;
}

.order-status-badge.status-handed_to_courier {
  background: #fff1df;
  color: #e47a13;
}

.order-status-badge.status-cancelled_after_courier_transfer {
  background: #fee8e8;
  color: #ef4444;
}

.order-status-badge.status-archive {
  background: #f0f1f3;
  color: #606a78;
}

.orders-table .order-product-photo,
.orders-table .product-photo-placeholder {
  width: 46px;
  height: 46px;
  border-radius: 8px;
}

.orders-table .product-photo-col {
  width: 82px;
  min-width: 82px;
}

.orders-list-card .list-pagination {
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.app-modal[hidden],
.scan-order-modal[hidden] {
  display: none !important;
}

.scanner-actions-card {
  width: min(100%, 520px);
}

.scanner-actions-card .scan-actions-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.scanner-actions-card .scan-action-btn {
  min-height: 48px;
  text-align: center;
}

.page-section > h2,
.delivery-zones-header h2,
.settings-section h2,
.program-settings-section h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.page-section > .courier-form,
.page-section > table,
.settings-section,
.program-settings-card,
.courier-stub {
  padding: 18px;
}

.page-section > table {
  overflow: hidden;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

body.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
  padding-right: 9px;
  padding-left: 9px;
}

body.sidebar-collapsed .sidebar-brand-title,
body.sidebar-collapsed .side-nav-label,
body.sidebar-collapsed .nav-count,
body.sidebar-collapsed .tree-toggle-btn,
body.sidebar-collapsed .tree-children,
body.sidebar-collapsed .sidebar-divider {
  display: none !important;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

body.sidebar-collapsed .sidebar-nav-row {
  display: block;
}

body.sidebar-collapsed .side-nav-item,
body.sidebar-collapsed .sidebar-collapse-btn {
  justify-content: center;
  padding-right: 7px;
  padding-left: 7px;
}

body.sidebar-collapsed .sidebar-collapse-btn > span:first-child {
  transform: rotate(180deg);
}

@media (max-width: 1380px) {
  .orders-filters-card {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .orders-search-field {
    grid-column: span 2;
  }

  .orders-status-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .user-bar {
    margin-left: auto;
  }
}

@media (max-width: 860px) {
  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block;
  }

  .app-sidebar,
  body.sidebar-collapsed .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-border);
  }

  .sidebar-brand {
    justify-content: flex-start !important;
  }

  .sidebar-brand-title,
  .side-nav-label,
  .nav-count,
  .tree-toggle-btn,
  .tree-children,
  .sidebar-divider {
    display: initial !important;
  }

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

  .sidebar-order-tree {
    grid-column: 1 / -1;
  }

  .sidebar-collapse-btn {
    display: none !important;
  }

  .app-topbar {
    position: static;
    padding: 14px 16px;
  }

  .app-content {
    padding: 14px;
  }

  .orders-filters-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .sidebar-navigation,
  .orders-filters-card {
    grid-template-columns: 1fr;
  }

  .orders-search-field {
    grid-column: auto;
  }

  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .auto-sync-indicator,
  .user-bar {
    padding-left: 0;
    border-left: 0;
  }

  .user-bar {
    width: 100%;
    margin-left: 0;
  }

  .orders-toolbar-main {
    justify-content: stretch;
  }

  .primary-action-btn,
  .toolbar-action-btn {
    flex: 1 1 100%;
  }

  .orders-selection-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .orders-selection-toolbar select,
  .orders-selection-toolbar button {
    width: 100%;
  }
}

.app-sidebar[hidden] {
  display: none !important;
}

.app-sidebar[hidden] + .app-workspace {
  grid-column: 1 / -1;
}

.page-section table:not(.orders-table) th {
  background: #fafbfc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.page-section table:not(.orders-table) td {
  background: #fff;
}

.orders-filters-card {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(250px, 1.3fr) minmax(230px, 1.2fr) auto;
}

.orders-date-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.orders-date-field > span {
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
}

.orders-date-field > div {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto minmax(112px, 1fr);
  align-items: center;
  gap: 6px;
}

.orders-date-field > div > span {
  color: #9ca3af;
  font-size: 12px;
}

@media (max-width: 1380px) {
  .orders-date-field,
  .orders-search-field {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .orders-date-field,
  .orders-search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .orders-date-field,
  .orders-search-field {
    grid-column: auto;
  }

  .orders-date-field > div {
    grid-template-columns: 1fr;
  }

  .orders-date-field > div > span {
    display: none;
  }
}

/* Browser worker, cabinet settings and full product catalog */
.shop-cabinet-summary,
.shop-warehouse-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.configure-cabinet-btn {
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.cabinet-mini-status,
.catalog-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cabinet-mini-status.success,
.catalog-status-badge.active {
  background: #dcfce7;
  color: #15803d;
}

.cabinet-mini-status.error,
.catalog-status-badge.inactive {
  background: #fee2e2;
  color: #b91c1c;
}

.cabinet-settings-modal[hidden] {
  display: none !important;
}

.cabinet-settings-modal {
  position: fixed;
  z-index: 1050;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.58);
}

.cabinet-settings-card {
  width: min(100%, 920px);
  max-height: 94vh;
  overflow: auto;
  padding: 20px;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.28);
}

.cabinet-settings-header,
.cabinet-settings-footer,
.catalog-page-header,
.browser-worker-status-card,
.worker-status-main {
  display: flex;
  align-items: center;
}

.cabinet-settings-header,
.catalog-page-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.cabinet-settings-header h3,
.catalog-page-header h2 {
  margin: 0 0 6px;
}

.cabinet-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.cabinet-settings-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.cabinet-settings-grid input[type="text"],
.cabinet-settings-grid input[type="password"],
.cabinet-settings-grid input[type="url"],
.cabinet-settings-grid input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 9px 11px;
  border: 1px solid #d7dee8;
  border-radius: 9px;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
}

.cabinet-wide-field {
  grid-column: 1 / -1;
}

.cabinet-settings-grid .cabinet-toggle-field {
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}

.cabinet-toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: #ef4444;
}

.cabinet-status-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.cabinet-status-panel > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}

.cabinet-status-panel span,
.cabinet-status-panel strong {
  display: block;
}

.cabinet-status-panel span {
  margin-bottom: 5px;
  color: #64748b;
  font-size: 11px;
}

.cabinet-status-panel strong {
  overflow-wrap: anywhere;
  color: #1f2937;
  font-size: 12px;
}

.success-text { color: #15803d !important; }
.warning-text { color: #b45309 !important; }

.cabinet-settings-footer {
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

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

.catalog-section {
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: 13px;
  background: var(--ui-card);
  box-shadow: var(--ui-shadow);
}

.browser-worker-status-card {
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0;
  padding: 13px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
}

.worker-status-main {
  min-width: 0;
  gap: 11px;
}

.worker-status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.14);
}

.worker-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
}

.worker-current-task {
  color: #475569;
  font-size: 12px;
  text-align: right;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-toolbar label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.catalog-toolbar select,
.catalog-toolbar input {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
}

.catalog-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.catalog-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
}

.catalog-table th,
.catalog-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf0f3;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  vertical-align: middle;
}

.catalog-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  white-space: nowrap;
}

.catalog-table a {
  color: #1570d8;
  font-weight: 700;
  text-decoration: none;
}

.catalog-product-image,
.catalog-product-image-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 9px;
}

.catalog-product-image {
  display: block;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.catalog-product-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 9px;
  text-align: center;
}

@media (max-width: 900px) {
  .cabinet-settings-grid,
  .cabinet-status-panel,
  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .cabinet-wide-field {
    grid-column: auto;
  }

  .cabinet-settings-footer,
  .browser-worker-status-card {
    align-items: stretch;
    flex-direction: column;
  }

  .worker-current-task {
    text-align: left;
  }
}

/* Роли и пользователи системы */
.management-section {
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.management-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.management-table th,
.management-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  vertical-align: middle;
}

.management-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.management-table tbody tr:last-child td {
  border-bottom: 0;
}

.management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 320px;
}

.management-actions button {
  white-space: nowrap;
}

.management-actions button:disabled,
#addRoleBtn:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.system-user-access-cell {
  min-width: 260px;
  max-width: 420px;
  line-height: 1.45;
}

.role-users-card {
  width: min(1100px, calc(100vw - 40px));
}

.system-user-card {
  width: min(980px, calc(100vw - 40px));
}

.system-user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.system-user-form-grid label,
.system-user-access-field,
.password-generator-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #334155;
  font-weight: 700;
}

.system-user-form-grid input,
.system-user-form-grid select {
  width: 100%;
}

.system-user-form-grid input:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.system-user-access-field,
.password-generator-field {
  justify-content: flex-end;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  padding-right: 46px;
}

.password-eye-btn {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 34px;
  height: 34px;
  padding: 7px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
}

.password-eye-btn:hover,
.password-eye-btn.is-visible {
  background: #e2e8f0;
  color: #0f172a;
}

.password-eye-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.nested-app-modal {
  z-index: 1100;
  background: rgba(15, 23, 42, .58);
}

.system-user-access-card {
  width: min(760px, calc(100vw - 40px));
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
}

.system-user-access-tree {
  display: grid;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}

.system-access-shop {
  overflow: hidden;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: #fff;
}

.system-access-shop-row,
.system-access-warehouse-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.system-access-shop-row {
  padding: 12px 14px;
  background: #f8fafc;
}

.system-access-warehouses {
  display: grid;
  gap: 8px;
  padding: 10px 14px 12px 42px;
}

.system-access-warehouse-row {
  padding: 5px 0;
  font-weight: 500;
}

.system-access-shop-row input,
.system-access-warehouse-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #ef4444;
}

.system-access-empty {
  padding: 4px 0;
}

@media (max-width: 760px) {
  .system-user-form-grid {
    grid-template-columns: 1fr;
  }

  .management-actions {
    min-width: 220px;
  }
}

/* Склады и зоны курьера */
.courier-zone-selection-card {
  width: min(1040px, calc(100vw - 40px));
  max-height: min(880px, calc(100vh - 40px));
  overflow: auto;
}

.delivery-zone-selection-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-height: 60vh;
  overflow: auto;
  padding: 4px;
}

.courier-zone-tree-shop {
  overflow: hidden;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: #fff;
}

.courier-zone-tree-shop-row,
.courier-zone-tree-warehouse-row,
.courier-zone-tree-zone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.courier-zone-tree-shop-row {
  padding: 13px 15px;
  background: #eef2f7;
}

.courier-zone-tree-warehouses {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px 38px;
}

.courier-zone-tree-warehouse {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.courier-zone-tree-warehouse-row {
  padding: 11px 13px;
  background: #f8fafc;
}

.courier-zone-tree-zones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px 13px 13px 38px;
}

.courier-zone-tree-zone-row {
  display: grid;
  grid-template-columns: auto minmax(54px, auto) minmax(0, 1fr);
  padding: 7px 9px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  font-size: 13px;
}

.courier-zone-tree-zone-row:hover {
  background: #f8fafc;
}

.courier-zone-tree-shop-row input,
.courier-zone-tree-warehouse-row input,
.courier-zone-tree-zone-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #ef4444;
}

.courier-zone-tree-empty {
  padding: 12px 14px;
}

@media (max-width: 760px) {
  .courier-zone-tree-warehouses {
    padding-left: 14px;
  }

  .courier-zone-tree-zones {
    grid-template-columns: 1fr;
    padding-left: 14px;
  }
}

/* Mobile navigation and order cards */
.mobile-menu-toggle,
.mobile-menu-backdrop {
  display: none;
}

@media (max-width: 860px) {
  body.mobile-menu-open {
    overflow: hidden;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 22px;
  }

  .mobile-menu-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 199;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.42);
  }

  .app-sidebar,
  body.sidebar-collapsed .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
    display: flex;
    width: min(88vw, 330px);
    height: 100dvh;
    max-height: none;
    overflow-y: auto;
    padding: 12px;
    border-right: 1px solid var(--ui-border);
    border-bottom: 0;
    background: #fff;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.mobile-menu-open .app-sidebar,
  body.mobile-menu-open.sidebar-collapsed .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-navigation {
    display: flex;
    grid-template-columns: none;
    flex-direction: column;
  }

  .sidebar-order-tree {
    grid-column: auto;
  }

  .app-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-content {
    padding: 10px;
  }

  .orders-command-card,
  .orders-list-card {
    border-radius: 10px;
  }

  .orders-toolbar-main,
  .orders-selection-toolbar {
    gap: 6px;
  }

  .orders-toolbar-main .primary-action-btn,
  .orders-toolbar-main .toolbar-action-btn {
    width: auto;
    min-height: 34px;
    flex: 1 1 auto;
    padding: 7px 9px;
    font-size: 10px;
  }

  .orders-selection-toolbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 7px 8px;
  }

  .orders-selection-toolbar strong {
    min-width: 78px;
    font-size: 10px;
  }

  .orders-selection-toolbar select {
    width: auto;
    min-width: 150px;
    flex: 1 1 170px;
    padding: 7px 8px;
    font-size: 10px;
  }

  .orders-selection-toolbar button {
    width: auto;
    min-height: 34px;
    flex: 0 1 auto;
    padding: 7px 9px;
    font-size: 10px;
  }

  .orders-status-strip {
    gap: 4px;
    padding: 5px 7px;
  }

  .orders-status-strip .status,
  .orders-status-strip .product-sync-status {
    padding: 5px 6px;
    font-size: 9px;
  }

  .orders-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .orders-table {
    display: table;
    width: 100%;
    min-width: 1220px;
    table-layout: auto;
    background: #fff;
  }

  .orders-table thead {
    display: table-header-group;
  }

  .orders-table tbody {
    display: table-row-group;
  }

  .orders-table tbody tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .orders-table th,
  .orders-table td {
    width: auto;
    min-width: 0;
    padding: 7px 6px;
    border-bottom: 1px solid #edf0f3;
    font-size: 9.5px;
    line-height: 1.25;
    vertical-align: middle;
  }

  .orders-table th {
    font-size: 9px;
  }

  .orders-table tbody td {
    display: table-cell;
    overflow-wrap: normal;
  }

  .orders-table tbody td::before {
    display: none;
    content: none;
  }

  .orders-table tbody .select-col {
    position: static;
    display: table-cell;
    width: 34px;
    padding: 6px 5px;
    border-bottom: 1px solid #edf0f3;
    background: inherit !important;
  }

  .orders-table tbody .product-photo-col {
    display: table-cell;
    width: 48px;
    min-width: 48px;
    min-height: 0;
    padding: 5px;
  }

  .orders-table .order-product-photo,
  .orders-table .product-photo-placeholder {
    width: 40px;
    height: 40px;
  }

  .orders-table .order-status-badge {
    padding: 3px 5px;
    font-size: 8.5px;
  }

  .orders-table tbody .orders-empty-row {
    display: table-row;
    border: 0;
  }

  .orders-table tbody .orders-empty-row td {
    display: table-cell;
    padding: 18px;
    border: 0;
    text-align: center;
  }

  .orders-list-card .list-pagination {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }

  .list-pagination-controls {
    justify-content: flex-start;
    gap: 5px;
  }

  .list-pagination-controls button {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .list-pagination-summary,
  .list-pagination-page {
    text-align: left;
    font-size: 10px;
  }

  .orders-filters-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }

  .orders-filters-card > *,
  .orders-filters-card input,
  .orders-filters-card select,
  .orders-date-field,
  .orders-search-field {
    width: 100%;
    min-width: 0;
  }

  .orders-filters-card label > span,
  .orders-date-field > span {
    font-size: 9px;
  }

  .orders-filters-card input,
  .orders-filters-card select,
  .order-multiselect-btn,
  .reset-filters-btn {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 10px;
  }

  .order-multiselect-panel,
  .shop-warehouse-filter-panel {
    width: min(420px, calc(100vw - 28px));
    max-height: 320px;
  }

  .orders-date-field,
  .orders-search-field {
    grid-column: 1 / -1;
  }

  .orders-date-field > div {
    gap: 5px;
  }
}

.app-sidebar[hidden] ~ .app-workspace .mobile-menu-toggle {
  display: none !important;
}

#stageFilter .order-multiselect-panel,
#courierFilter .order-multiselect-panel {
  right: 0;
  left: auto;
}

@media (max-width: 620px) {
  #shopWarehouseFilter .order-multiselect-panel,
  #courierFilter .order-multiselect-panel {
    right: auto;
    left: 0;
  }

  #stageFilter .order-multiselect-panel {
    right: 0;
    left: auto;
  }
}
