.order-archive-panel {
  padding: 12px;
  background: var(--surface-soft, #f6f8fb);
}

.order-archive-toolbar {
  min-height: 48px;
  padding: 0 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line, #dbe3ec);
}

.order-archive-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.order-archive-title strong {
  color: var(--ink-strong, #182235);
  font-size: 15px;
  line-height: 1.3;
}

.order-archive-title span,
.order-archive-drop-copy span,
.order-archive-empty span {
  color: var(--muted, #6b778c);
  font-size: 12px;
  line-height: 1.5;
}

.order-archive-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #526176;
  font-size: 12px;
  white-space: nowrap;
}

.order-archive-stats span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line, #dbe3ec);
  border-radius: 6px;
  background: #fff;
}

.order-archive-stats strong {
  color: var(--blue-dark, #174ea6);
}

.order-archive-layout {
  padding-top: 12px;
  display: grid;
  grid-template-columns: minmax(270px, 0.7fr) minmax(0, 1.45fr);
  gap: 12px;
  align-items: start;
}

.order-archive-upload-column,
.order-archive-list-column {
  min-width: 0;
}

.order-archive-dropzone {
  min-height: 176px;
  padding: 18px;
  border: 1px dashed #9fb4cb;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #30445e;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.order-archive-dropzone:hover,
.order-archive-dropzone:focus-visible,
.order-archive-dropzone.is-dragging {
  border-color: var(--blue, #2563eb);
  background: #f5f9ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.order-archive-dropzone.is-disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
  box-shadow: none;
}

.order-archive-dropzone.is-busy {
  color: #718096;
  border-color: #b8c5d3;
  background: #f4f7fa;
  cursor: progress;
  box-shadow: none;
}

.order-archive-upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #1667c8;
  background: #eaf3ff;
}

.order-archive-upload-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.order-archive-drop-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.order-archive-drop-copy strong {
  color: var(--ink-strong, #182235);
  font-size: 14px;
}

.order-archive-choose {
  width: auto;
  min-width: 96px;
  height: 34px;
}

.order-archive-notice {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #cbd8e6;
  border-radius: 6px;
  color: #41536a;
  font-size: 12px;
  line-height: 1.5;
  background: #fff;
  overflow-wrap: anywhere;
}

.order-archive-notice[data-type="success"] {
  color: #166534;
  border-color: #b7dfc5;
  background: #f0fdf4;
}

.order-archive-notice[data-type="error"] {
  color: #b42318;
  border-color: #f2c4be;
  background: #fff6f5;
}

.order-archive-notice[data-type="progress"] {
  color: #174ea6;
  border-color: #bfd3ef;
  background: #f3f8ff;
}

.order-archive-list-column {
  border: 1px solid var(--line, #dbe3ec);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.order-archive-list-head,
.order-archive-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(88px, 0.55fr) minmax(138px, 0.75fr) minmax(150px, auto);
  align-items: center;
  gap: 12px;
}

.order-archive-list-head {
  min-height: 36px;
  padding: 0 12px;
  color: #627086;
  border-bottom: 1px solid var(--line, #dbe3ec);
  font-size: 11px;
  font-weight: 700;
  background: #f7f9fc;
}

.order-archive-row {
  min-height: 66px;
  padding: 9px 12px;
  border-bottom: 1px solid #e7edf3;
}

.order-archive-row:last-child {
  border-bottom: 0;
}

.order-archive-row:hover {
  background: #fbfdff;
}

.order-archive-file-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-archive-file-badge {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid #c6d6e8;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #175da8;
  font-size: 9px;
  font-weight: 800;
  background: #eef6ff;
}

.order-archive-file-badge.is-pdf {
  color: #b42318;
  border-color: #efc2bd;
  background: #fff2f0;
}

.order-archive-file-badge:is(.is-xls, .is-xlsx) {
  color: #16794b;
  border-color: #b7dfc5;
  background: #effbf4;
}

.order-archive-file-badge:is(.is-doc, .is-docx) {
  color: #245fc0;
  border-color: #bfd3ef;
  background: #f0f5ff;
}

.order-archive-file-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.order-archive-file-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong, #182235);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-archive-file-copy span,
.order-archive-meta-cell {
  color: #68778b;
  font-size: 12px;
}

.order-archive-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.order-archive-action {
  min-width: 42px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #cbd8e6;
  border-radius: 6px;
  color: #275071;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}

.order-archive-action:hover {
  color: #174ea6;
  border-color: #8fb3dc;
  background: #f4f8fd;
}

.order-archive-action.is-danger {
  color: #b42318;
}

.order-archive-action.is-danger:hover {
  border-color: #e5a7a0;
  background: #fff4f2;
}

.order-archive-empty {
  min-height: 150px;
  padding: 24px;
  display: grid;
  place-content: center;
  gap: 4px;
  color: #475569;
  text-align: center;
}

.order-archive-empty[hidden] {
  display: none;
}

.order-archive-empty strong {
  color: #334155;
  font-size: 14px;
}

body[data-sidebar-theme="dark"] .order-archive-panel {
  background: #0c1524;
}

body[data-sidebar-theme="dark"] .order-archive-toolbar,
body[data-sidebar-theme="dark"] .order-archive-list-column,
body[data-sidebar-theme="dark"] .order-archive-list-head,
body[data-sidebar-theme="dark"] .order-archive-row {
  border-color: #2a3a50;
}

body[data-sidebar-theme="dark"] .order-archive-stats span,
body[data-sidebar-theme="dark"] .order-archive-dropzone,
body[data-sidebar-theme="dark"] .order-archive-list-column,
body[data-sidebar-theme="dark"] .order-archive-notice,
body[data-sidebar-theme="dark"] .order-archive-action {
  color: #b8c6d8;
  border-color: #33465f;
  background: #111d2f;
}

body[data-sidebar-theme="dark"] .order-archive-list-head,
body[data-sidebar-theme="dark"] .order-archive-row:hover,
body[data-sidebar-theme="dark"] .order-archive-dropzone:hover,
body[data-sidebar-theme="dark"] .order-archive-dropzone:focus-visible,
body[data-sidebar-theme="dark"] .order-archive-dropzone.is-dragging {
  background: #162338;
}

body[data-sidebar-theme="dark"] .order-archive-title strong,
body[data-sidebar-theme="dark"] .order-archive-drop-copy strong,
body[data-sidebar-theme="dark"] .order-archive-file-copy strong,
body[data-sidebar-theme="dark"] .order-archive-empty strong {
  color: #e7edf6;
}

body[data-sidebar-theme="dark"] .order-archive-title span,
body[data-sidebar-theme="dark"] .order-archive-drop-copy span,
body[data-sidebar-theme="dark"] .order-archive-file-copy span,
body[data-sidebar-theme="dark"] .order-archive-meta-cell,
body[data-sidebar-theme="dark"] .order-archive-empty span {
  color: #95a8c0;
}

body[data-sidebar-theme="dark"] .order-archive-notice[data-type="success"] {
  color: #9be3b7;
  border-color: #28633f;
  background: #10291d;
}

body[data-sidebar-theme="dark"] .order-archive-notice[data-type="error"] {
  color: #ffb4aa;
  border-color: #7a3a35;
  background: #2b1819;
}

body[data-sidebar-theme="dark"] .order-archive-notice[data-type="progress"] {
  color: #a9c9ff;
  border-color: #34598a;
  background: #13243d;
}

body[data-sidebar-theme="dark"] .order-archive-action.is-danger {
  color: #ffaaa0;
}

body[data-sidebar-theme="dark"] .order-archive-action.is-danger:hover {
  color: #ffc0b8;
  border-color: #82463f;
  background: #301b1c;
}

body[data-sidebar-theme="dark"] .order-archive-dropzone:is(.is-disabled, .is-busy),
body[data-sidebar-theme="dark"] .order-archive-dropzone:is(.is-disabled, .is-busy):hover {
  color: #73869d;
  border-color: #314157;
  background: #0e1828;
  box-shadow: none;
}

@media (max-width: 1000px) {
  .order-archive-layout {
    grid-template-columns: 1fr;
  }

  .order-archive-dropzone {
    min-height: 116px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 700px) {
  #orderDetailDialog .detail-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
  }

  #orderDetailDialog .detail-tab {
    min-width: 74px;
    flex: 1 0 74px;
  }

  .order-archive-panel {
    padding: 9px;
  }

  .order-archive-toolbar {
    align-items: flex-start;
  }

  .order-archive-stats {
    display: grid;
    gap: 4px;
    text-align: right;
  }

  .order-archive-dropzone {
    min-height: 112px;
    padding: 13px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px 10px;
  }

  .order-archive-upload-icon {
    width: 36px;
    height: 36px;
  }

  .order-archive-choose {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .order-archive-list-head {
    display: none;
  }

  .order-archive-row {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
  }

  .order-archive-file-cell {
    grid-column: 1 / -1;
  }

  .order-archive-meta-cell {
    display: grid;
    gap: 2px;
  }

  .order-archive-meta-cell::before {
    content: attr(data-label);
    color: #94a3b8;
    font-size: 10px;
  }

  .order-archive-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
