:root {
  --vault-soft: #eceefa;
  --vault: #4d587c;
  --mint-soft: #e7f4ef;
}

.vault-mark { background: var(--vault-soft); color: var(--vault); }
.archive-main { max-width: 1600px; margin: 0 auto; }

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

.archive-metric {
  min-height: 92px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.archive-metric > div { display: grid; gap: 4px; }
.archive-metric > div span { color: var(--muted); font-size: 12px; font-weight: 700; }
.archive-metric > div strong { font-size: 24px; }
.archive-metric.dpe .metric-icon { background: var(--primary-soft); color: var(--primary); }
.archive-metric.pauta .metric-icon { background: var(--mint-soft); color: var(--green); }

.archive-policy {
  min-height: 64px;
  margin-bottom: 18px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #bcd7cb;
  border-radius: 7px;
  background: var(--mint-soft);
  color: var(--green);
}

.archive-policy > svg { width: 22px; height: 22px; }
.archive-policy > div { display: grid; gap: 3px; }
.archive-policy strong { font-size: 13px; }
.archive-policy span { color: var(--muted); font-size: 12px; line-height: 1.4; }

.archive-toolbar {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.archive-tabs {
  min-height: 42px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.archive-tab {
  min-height: 34px;
  padding: 6px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.archive-tab:hover { color: var(--primary); }
.archive-tab.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(31, 59, 69, 0.12); }
.archive-tab > span { min-width: 22px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 5px; background: var(--primary-soft); font-size: 10px; }
.archive-search { width: min(420px, 45vw); }
.archive-surface { overflow: hidden; }

.archive-table { min-width: 1040px; }
.archive-table th:nth-child(1) { width: 14%; }
.archive-table th:nth-child(2) { width: 18%; }
.archive-table th:nth-child(3) { width: 12%; }
.archive-table th:nth-child(4) { width: 18%; }
.archive-table th:nth-child(5) { width: 25%; }
.archive-table th:nth-child(6) { width: 13%; }
.archive-table td > small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.archive-table td:last-child { text-align: right; }
.archive-table td:last-child .button { white-space: nowrap; }
.archive-reason { color: var(--muted); line-height: 1.45; }

.archive-status {
  min-height: 24px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
}

.archive-status.closed { background: var(--green-soft); color: var(--green); }
.restore-context { margin-bottom: 15px; font-size: 12px; }

.fatal-state {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.fatal-state span { color: var(--muted); }

@media (max-width: 880px) {
  .archive-metrics { grid-template-columns: 1fr; }
  .archive-metric { min-height: 72px; }
  .archive-toolbar { align-items: stretch; flex-direction: column; }
  .archive-tabs { width: 100%; }
  .archive-tab { flex: 1; justify-content: center; }
  .archive-search { width: 100%; }
}

@media (max-width: 520px) {
  .archive-tab { padding-inline: 7px; }
  .archive-tab svg { display: none; }
  .archive-policy { align-items: flex-start; }

  .archive-surface .table-scroll { overflow: visible; }
  .archive-table { min-width: 0; display: block; }
  .archive-table thead { display: none; }
  .archive-table tbody { display: block; }
  .archive-table tr { padding: 8px 13px; display: grid; border-bottom: 1px solid var(--border); }
  .archive-table tr:last-child { border-bottom: 0; }
  .archive-table td,
  .archive-table td:last-child {
    min-width: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    border: 0;
    text-align: left;
  }
  .archive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .archive-table td > small { grid-column: 2; margin-top: -5px; }
  .archive-table td > .button { justify-self: start; }
}
