/* ═══════════════════════════════════════════════════════════════
   document-upload.css — Document Hub v2 DH-3 Multi-File Upload UI
   Conforms to Upload.dc.html and Swiss Freight Skin B design tokens:
   - Archivo and Archivo Narrow typography
   - Zero border-radius across all interactive elements
   - Tabular numbers for sizes and percentages
   - Monochrome SVG line iconography
   - Full dark/dim/light theme compatibility
   ═══════════════════════════════════════════════════════════════ */

.dh3-upload-view {
  font-family: Archivo, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text, #0B0B0B);
  background: var(--bg, #F4F4F1);
  min-height: 800px;
  box-sizing: border-box;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dh3-header-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dh3-back-link {
  font-size: 13px;
  color: var(--text2, #5A5A55);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  cursor: pointer;
}

.dh3-back-link:hover,
.dh3-back-link:focus-visible {
  color: var(--text, #0B0B0B);
  text-decoration: underline;
}

.dh3-heading {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text, #0B0B0B);
}

/* ── Drop Zone ──────────────────────────────────────────────── */
.dh3-dropzone {
  border: 2px dashed var(--text, #0B0B0B);
  background: var(--emr-card-bg, #FFFFFF);
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  border-radius: 0 !important;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}

.dh3-dropzone.dh3-drag-active {
  border-color: var(--gold, #F5A623);
  background: rgba(245, 166, 35, 0.08);
}

.dh3-dropzone-icon {
  flex-shrink: 0;
  color: var(--text, #0B0B0B);
}

.dh3-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 320px;
}

.dh3-dropzone-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #0B0B0B);
}

.dh3-dropzone-desc {
  font-size: 14px;
  color: var(--text2, #3A3A36);
}

.dh3-btn-secondary {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--text, #0B0B0B);
  background: var(--emr-card-bg, #FFFFFF);
  color: var(--text, #0B0B0B);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 0 !important;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dh3-btn-secondary:hover:not(:disabled),
.dh3-btn-secondary:focus-visible:not(:disabled) {
  background: var(--bg, #F4F4F1);
}

.dh3-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Status & Action Bar ────────────────────────────────────── */
.dh3-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.dh3-count-read {
  font-weight: 700;
  font-size: 15px;
  color: var(--text, #0B0B0B);
}

.dh3-count-detail {
  font-size: 14px;
  color: var(--text2, #3A3A36);
}

.dh3-bar-spacer {
  flex: 1;
}

.dh3-private-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text, #0B0B0B);
  cursor: pointer;
  user-select: none;
}

.dh3-private-label input[type="checkbox"] {
  border-radius: 0 !important;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--gold, #F5A623);
}

.dh3-btn-primary {
  height: 44px;
  padding: 0 20px;
  border: 0;
  background: var(--gold, #F5A623);
  color: #0B0B0B;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border-radius: 0 !important;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.dh3-btn-primary:hover:not(:disabled),
.dh3-btn-primary:focus-visible:not(:disabled) {
  filter: brightness(0.95);
}

.dh3-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

/* ── Queue Table ────────────────────────────────────────────── */
.dh3-table-wrap {
  background: var(--emr-card-bg, #FFFFFF);
  border: 1px solid var(--border, #E4E4E0);
  overflow-x: auto;
  border-radius: 0 !important;
}

.dh3-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 900px;
}

.dh3-table thead tr {
  font-family: 'Archivo Narrow', Arial, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text2, #5A5A55);
  text-align: left;
  border-bottom: 1px solid var(--border, #E4E4E0);
}

.dh3-table th {
  padding: 12px 16px;
  font-weight: 500;
}

.dh3-table th.dh3-col-compact {
  padding: 12px 8px;
}

.dh3-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.dh3-table td.dh3-col-compact {
  padding: 12px 8px;
}

.dh3-row {
  border-top: 1px solid var(--border, #E4E4E0);
  background: var(--emr-card-bg, #FFFFFF);
  transition: background 0.1s ease;
}

.dh3-row.is-needs-attention {
  background: #F3EFFF;
}

body.theme-dark .dh3-row.is-needs-attention,
html:is([data-theme="dark"], [data-theme="dim"]) .dh3-row.is-needs-attention {
  background: rgba(124, 92, 224, 0.18);
}

.dh3-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dh3-file-name {
  font-weight: 600;
  color: var(--text, #0B0B0B);
  word-break: break-word;
}

.dh3-file-meta {
  font-size: 12px;
  color: var(--text2, #5A5A55);
}

.dh3-type-pill {
  font-family: 'Archivo Narrow', Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--chip-bg, #EDEDEA);
  color: var(--text, #0B0B0B);
  padding: 3px 8px;
  border-radius: 0 !important;
  display: inline-block;
  white-space: nowrap;
}

body.theme-dark .dh3-type-pill,
html:is([data-theme="dark"], [data-theme="dim"]) .dh3-type-pill {
  background: rgba(255, 255, 255, 0.12);
}

.dh3-dest-text {
  color: var(--text2, #3A3A36);
}

.dh3-conf-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dh3-conf-bar-track {
  width: 80px;
  height: 6px;
  background: var(--border, #EDEDEA);
  display: block;
  border-radius: 0 !important;
  overflow: hidden;
}

.dh3-conf-bar-fill {
  display: block;
  height: 6px;
  border-radius: 0 !important;
}

.dh3-conf-bar-fill.is-high {
  background: var(--emr-status-green, #16A34A);
}

.dh3-conf-bar-fill.is-low {
  background: var(--emr-status-purple, #7C5CE0);
}

.dh3-conf-percent {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text, #0B0B0B);
  min-width: 32px;
}

.dh3-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.dh3-btn-change {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle, #CFCFC9);
  background: var(--emr-card-bg, #FFFFFF);
  color: var(--text2, #3A3A36);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-radius: 0 !important;
  font-family: inherit;
}

.dh3-btn-change:hover,
.dh3-btn-change:focus-visible {
  background: var(--bg, #F4F4F1);
  color: var(--text, #0B0B0B);
}

.dh3-btn-pick {
  height: 36px;
  padding: 0 12px;
  border: 0;
  background: var(--emr-status-purple, #7C5CE0);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border-radius: 0 !important;
  font-family: inherit;
}

.dh3-btn-pick:hover,
.dh3-btn-pick:focus-visible {
  filter: brightness(1.1);
}

.dh3-btn-remove {
  background: transparent;
  border: 0;
  color: var(--text2, #5A5A55);
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 0 !important;
  margin-left: 6px;
}

.dh3-btn-remove:hover {
  color: var(--bad, #DC2626);
}

/* ── Unmatched / Needs Attention Card ───────────────────────── */
.dh3-unmatched-card {
  background: var(--emr-card-bg, #FFFFFF);
  border: 2px solid var(--emr-status-purple, #7C5CE0);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  border-radius: 0 !important;
}

.dh3-unmatched-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 320px;
}

.dh3-unmatched-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text, #0B0B0B);
}

.dh3-unmatched-subtitle {
  font-size: 14px;
  color: var(--text2, #3A3A36);
}

.dh3-unmatched-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dh3-candidate-btn-top {
  height: 44px;
  padding: 0 14px;
  border: 2px solid var(--text, #0B0B0B);
  background: var(--emr-card-bg, #FFFFFF);
  color: var(--text, #0B0B0B);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border-radius: 0 !important;
  font-family: inherit;
}

.dh3-candidate-btn-top:hover,
.dh3-candidate-btn-top:focus-visible {
  background: var(--bg, #F4F4F1);
}

.dh3-candidate-btn-sub {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle, #CFCFC9);
  background: var(--emr-card-bg, #FFFFFF);
  color: var(--text, #0B0B0B);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 0 !important;
  font-family: inherit;
}

.dh3-candidate-btn-sub:hover,
.dh3-candidate-btn-sub:focus-visible {
  background: var(--bg, #F4F4F1);
}

.dh3-load-search-input {
  height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--border-subtle, #CFCFC9);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  width: 170px;
  border-radius: 0 !important;
  background: var(--emr-card-bg, #FFFFFF);
  color: var(--text, #0B0B0B);
}

.dh3-load-search-input:focus {
  outline: none;
  border-color: var(--text, #0B0B0B);
}

/* ── Forward by Email Modal ─────────────────────────────────── */
.dh3-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.dh3-modal-box {
  background: var(--emr-card-bg, #FFFFFF);
  border: 2px solid var(--text, #0B0B0B);
  padding: 24px;
  max-width: 480px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 0 !important;
}

.dh3-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text, #0B0B0B);
}

.dh3-email-copy-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border, #E4E4E0);
  background: var(--bg, #F4F4F1);
  padding: 8px 12px;
  gap: 8px;
}

.dh3-email-address {
  font-weight: 700;
  font-size: 15px;
  font-family: monospace;
  color: var(--text, #0B0B0B);
  flex: 1;
}
