/* Indkøber aktionsliste tab. All colors from style.css's shared tokens (light + dark). */

main[data-active-tab="aktion"] { max-width: 1900px; }

.aktion-wrap { display: flex; flex-direction: column; gap: var(--gap-stack); }

.aktion-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.aktion-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.aktion-sub { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; max-width: 720px; }

.aktion-dropzone {
  position: relative; margin-top: 12px;
  border: 2px dashed var(--border-strong, #c2c7cf); border-radius: var(--radius-sm);
  background: var(--surface2); padding: 28px 16px; text-align: center; cursor: pointer;
  transition: border-color .12s, background .12s; color: var(--text-muted);
}
.aktion-dropzone:hover, .aktion-dropzone.drag {
  border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink);
}
.aktion-dz-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.aktion-dz-sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 4px; }
.aktion-api-error-badge {
  position: absolute; top: 8px; right: 10px;
  background: var(--red-tint); color: var(--red);
  font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; cursor: help;
}
.aktion-filename { margin-top: 10px; font-size: 0.76rem; color: var(--text-2); font-family: var(--mono); }
.aktion-error {
  margin-top: 10px; padding: 9px 13px; border-radius: var(--radius-sm); font-size: 0.78rem;
  background: var(--red-tint); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.aktion-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.aktion-search-btn { min-width: 110px; }
.aktion-summary { font-size: 0.8rem; color: var(--text-2); margin-left: auto; }
.aktion-summary b { color: var(--text); }
.aktion-progress { display: flex; align-items: center; gap: 8px; }
.aktion-progress.hidden { display: none; }
.aktion-progress-bar { width: 180px; height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden; }
.aktion-progress-fill { height: 100%; background: var(--accent); transition: width .15s; }
.aktion-progress-label { font-size: 0.74rem; color: var(--text-muted); font-family: var(--mono); }

/* ── Table ───────────────────────────────────────────────────────────────── */
/* No overflow on the wrap — it would become the sticky header's containing block (see delivery.css). */
.aktion-table-wrap { margin-top: 12px; }
.aktion-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.aktion-table thead th {
  text-align: left; padding: 8px 10px; font-size: 0.68rem; font-weight: 700; white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  position: sticky; top: var(--aktion-header-offset, 0px); background: var(--surface); z-index: 3;
}
/* Input columns and result columns are visually grouped so it's clear what you fill in vs. what's found. */
.aktion-table thead th.aktion-th-input { color: var(--accent-ink); }
.aktion-table thead th.aktion-th-result { border-bottom-color: var(--accent); }
.aktion-table thead th.aktion-th-num { text-align: right; }
.aktion-table tbody td { padding: 6px 10px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.aktion-table tbody tr:hover td { background: var(--surface2); }

.aktion-td-mono { font-family: var(--mono); white-space: nowrap; }
.aktion-td-num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.aktion-td-note { max-width: 240px; color: var(--text-2); }
.aktion-td-msg { color: var(--text-faint); font-style: italic; }
.aktion-td-none { color: var(--red); font-style: normal; }
.aktion-td-input { background: color-mix(in srgb, var(--accent-tint) 45%, transparent); white-space: nowrap; }

.aktion-qty, .aktion-deadline {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: var(--radius-sm); padding: 4px 7px; font-size: 0.78rem; font-family: var(--mono);
}
.aktion-qty { width: 84px; text-align: right; }
.aktion-qty:focus, .aktion-deadline:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.aktion-deadline.is-moved { border-color: var(--yellow); background: var(--yellow-tint); }

.aktion-table a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.aktion-table a:hover { text-decoration: underline; }
.aktion-via { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; white-space: nowrap; }
.aktion-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 10px;
  font-size: 0.64rem; font-weight: 700; font-family: inherit; vertical-align: 1px;
  background: var(--surface3); color: var(--text-muted); cursor: help;
}
.aktion-tag-manual { background: var(--yellow-tint); color: var(--yellow); }

.aktion-table tbody tr.aktion-row-ok td:nth-child(n+7) { background: var(--green-tint); }
.aktion-table tbody tr.aktion-row-manual td:nth-child(n+7) { background: var(--yellow-tint); }
.aktion-table tbody tr.aktion-row-none td:nth-child(n+7) { background: var(--red-tint); }
/* Quantity/deadline edited since the last search — the result shown is outdated until "Søg" again. */
.aktion-table tbody tr.is-dirty td:nth-child(n+7) { opacity: 0.45; }

.aktion-tag-swap { background: var(--accent-tint); color: var(--accent-ink); }

.aktion-history { margin-top: 14px; }
.aktion-history-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 6px; }
.aktion-history-list { display: flex; flex-wrap: wrap; gap: 6px; }
.aktion-history-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-2);
  padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit;
  text-align: left; max-width: 280px;
}
.aktion-history-item:hover:not(:disabled) { border-color: var(--accent); }
.aktion-history-item:disabled { opacity: 0.5; cursor: default; }
.aktion-history-item.active { border-color: var(--accent); background: var(--accent-tint); }
.aktion-history-name {
  font-size: 0.76rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.aktion-history-meta { font-size: 0.66rem; color: var(--text-muted); }
/* Deadline can't be met — earliest possible delivery date. */
.aktion-via-late { color: var(--red); font-weight: 700; }
