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

.order-stat {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 2px 12px;
  min-height: 106px;
  padding: 15px 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text-primary);
  text-align: left;
  cursor: default;
  box-shadow: var(--shadow-sm);
}
.order-stat[onclick] { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.order-stat[onclick]:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.order-stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); }
.order-stat > span { align-self: end; font-size: 13px; font-weight: 650; }
.order-stat > strong { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--primary); font-size: 27px; line-height: 1; }
.order-stat > strong small { margin-left: 3px; color: var(--text-hint); font-size: 11px; font-weight: 400; }
.order-stat > b { color: var(--text-secondary); font-size: 14px; }
.order-stat > em { grid-column: 1 / 3; color: var(--text-hint); font-size: 11px; font-style: normal; }
.order-stat-green::before { background: #22a06b; } .order-stat-green > strong { color: #16875b; }
.order-stat-purple::before { background: #7867d9; } .order-stat-purple > strong { color: #6656c7; }
.order-stat-cyan::before { background: #1f9fb5; } .order-stat-cyan > strong { color: #187f92; }
.order-stat-orange::before { background: #f59e0b; } .order-stat-orange > strong { color: #c87800; }
.order-stat-slate::before { background: #64748b; } .order-stat-slate > strong { color: #526176; }

.order-card .card-header { align-items: flex-start; }
.order-help, .order-modal-sub, .order-section-tip { margin-top: 3px; color: var(--text-hint); font-size: 12px; }
.order-filters { margin-bottom: 12px; }
.order-list-table th:first-child, .order-list-table td:first-child { width: 148px; }
.order-list-table th:last-child, .order-list-table td:last-child { min-width: 150px; }
.order-list-table td > strong, .order-list-table td > small, .order-list-table td > span { display: block; }
.order-list-table td > small { margin-top: 2px; color: var(--text-hint); font-size: 11px; }
.order-number { display: block; border: 0; padding: 0; background: none; color: var(--primary); font: inherit; font-weight: 650; cursor: pointer; }
.order-money { color: #2b6f4e; font-weight: 650; white-space: nowrap; }
.order-actions { white-space: nowrap; }
.order-muted { color: var(--text-hint); font-size: 12px; }
.order-empty { padding: 42px !important; text-align: center; color: var(--text-hint); }
.order-page-total { line-height: 32px; color: var(--text-hint); font-size: 12px; }
.order-danger-text { color: var(--danger) !important; }

.order-status { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 13px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.order-status-draft { color: #667085; background: #f2f4f7; }
.order-status-payment { color: #5b4ab8; background: #efedff; }
.order-status-shipping { color: #0d7180; background: #e4f7fa; }
.order-status-invoice { color: #9a5b00; background: #fff3d6; }
.order-status-final { color: #40566f; background: #eaf0f6; }
.order-status-archived { color: #16794d; background: #e3f7ed; }
.order-status-cancelled { color: #777; background: #eee; }
.order-status-overdue { color: #b42318; background: #fee4e2; }

.order-modal { width: min(1120px, 96vw); max-height: 94vh; }
.order-modal .modal-body { padding: 18px 24px; }
.order-progress { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; padding: 4px 4px 22px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.order-progress-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #a2a8b3; font-size: 11px; text-align: center; }
.order-progress-step:not(:last-child)::after { content: ''; position: absolute; top: 13px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: #e8eaee; }
.order-progress-step i { position: relative; z-index: 1; display: flex; width: 27px; height: 27px; align-items: center; justify-content: center; border: 2px solid #d8dce3; border-radius: 50%; background: #fff; font-size: 11px; font-style: normal; font-weight: 700; }
.order-progress-step.done, .order-progress-step.current { color: var(--primary); font-weight: 600; }
.order-progress-step.done i, .order-progress-step.current i { border-color: var(--primary); background: var(--primary); color: #fff; }
.order-progress-step.done:not(:last-child)::after { background: var(--primary); }
.order-progress.cancelled { opacity: .45; }

.order-form-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.order-form-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.order-section-title { margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.order-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.order-section-heading .order-section-title { margin-bottom: 0; }
.order-identity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.order-identity-grid > div { padding: 10px 12px; border-radius: 7px; background: #f7f8fa; }
.order-identity-grid label, .order-identity-grid strong { display: block; }
.order-identity-grid label { margin-bottom: 3px; color: var(--text-hint); font-size: 11px; }
.order-identity-grid strong { font-size: 13px; }

.order-customer-box { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 14px; min-height: 66px; padding: 10px 12px; border: 1px dashed #cfd4dc; border-radius: 8px; background: #fafbfc; }
.order-customer-box.selected { border-style: solid; border-color: #ccd2f7; background: #fafaff; }
.order-customer-box div > strong, .order-customer-box div > span { display: block; }
.order-customer-box div > span { margin-top: 2px; color: var(--text-secondary); font-size: 12px; }
.order-customer-box div:nth-child(2) { display: flex; gap: 18px; }

.order-stage-card { padding: 16px; border: 1px solid #dfe3fb; border-radius: 9px; background: #fbfbff; }
.order-stage-card.success { border-color: #bee6d1; background: #f4fbf7; }
.order-stage-card.cancelled { border-color: #e4e4e4; background: #f8f8f8; }
.order-stage-note { margin: -4px 0 13px; color: var(--text-secondary); font-size: 12px; }

.order-recognition-panel { display: grid; gap: 3px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid #cfd6ee; border-radius: 8px; background: #f6f8ff; color: #4d5d84; }
.order-recognition-panel strong { font-size: 13px; }
.order-recognition-panel span, .order-recognition-panel small { font-size: 12px; line-height: 1.55; }
.order-recognition-panel small { color: #8b5a00; }
.order-recognition-panel.loading { border-color: #bed2f6; background: #f2f7ff; }
.order-recognition-panel.success { border-color: #a9dec3; background: #f0faf5; color: #176846; }
.order-recognition-panel.warning { border-color: #efd18e; background: #fff9e9; color: #805500; }
.order-invoice-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
.order-invoice-summary > div { padding: 9px 11px; border-radius: 7px; background: rgba(255,255,255,.7); }
.order-invoice-summary label, .order-invoice-summary strong { display: block; }
.order-invoice-summary label { margin-bottom: 3px; color: var(--text-hint); font-size: 11px; }
.order-invoice-summary strong { overflow-wrap: anywhere; font-size: 12px; }

.order-file-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.order-file-button { display: inline-flex; padding: 6px 10px; border: 1px dashed #a7afea; border-radius: 6px; background: #fafaff; color: var(--primary); font-size: 12px; font-weight: 550; cursor: pointer; }
.order-file-button input { display: none; }
.order-file-list, .order-new-files { display: grid; gap: 6px; }
.order-new-files { margin-top: 7px; }
.order-file-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 7px; background: #f7f8fa; color: var(--text-secondary); font-size: 12px; }
.order-file-item.new { background: #f0f7ff; color: #3178c6; }
.order-file-item span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-file-item b { margin-right: 9px; color: var(--text-primary); font-size: 11px; }
.order-file-item small { margin-left: 6px; color: var(--text-hint); }
.order-check-row { display: inline-flex; align-items: center; gap: 7px; margin: 6px 0 10px; cursor: pointer; }
.order-check-row input { width: 15px; height: 15px; accent-color: var(--primary); }

.order-timeline { display: grid; gap: 0; }
.order-timeline > div { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 9px; padding-bottom: 13px; }
.order-timeline > div:not(:last-child)::before { content: ''; position: absolute; top: 12px; bottom: 0; left: 5px; width: 1px; background: #dfe3e8; }
.order-timeline i { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 2px solid #8b96db; border-radius: 50%; background: #fff; }
.order-timeline span strong, .order-timeline span small, .order-timeline span em { display: block; }
.order-timeline span small { margin-top: 2px; color: var(--text-hint); font-size: 11px; }
.order-timeline span em { margin-top: 3px; color: var(--text-secondary); font-size: 12px; font-style: normal; }
.order-delete-button { margin-left: auto; }

.order-picker-search { width: 100%; margin-bottom: 12px; }
.order-picker-table { max-height: 60vh; border: 1px solid var(--border); border-radius: var(--radius-md); }
.order-picker-table thead { position: sticky; top: 0; z-index: 1; }

@media (max-width: 1050px) {
  .order-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-modal { width: 97vw; }
}

@media (max-width: 720px) {
  .order-summary { grid-template-columns: 1fr; }
  .order-progress { overflow-x: auto; justify-content: flex-start; }
  .order-progress-step { min-width: 88px; }
  .order-identity-grid, .order-form-section .form-row { grid-template-columns: 1fr; }
  .order-customer-box { grid-template-columns: 1fr; }
  .order-invoice-summary { grid-template-columns: 1fr; }
  .order-section-heading { flex-direction: column; }
  .order-file-actions { justify-content: flex-start; }
}
