/* ============================================================
   Arkiv i admin-udseende — kun når html har klassen .admin-archive
   (sættes i <head> på arkivsiderne, når den indloggede er Admin).
   Medarbejdernes historik-sider bruger fortsat maskintjek.css som før.
   ============================================================ */
html.admin-archive{
  --bg: #0B1428;
  --bg-glow: none;
  --surface: #111D38;
  --surface-2: #182748;
  --row-hover: #15223F;
  --line: #1A2849;
  --border: #22325A;
  --border-input: #56699A;
  --text: #ECEEF3;
  --text-dim: #A9B4CC;
  --text-faint: #8C97B3;
  --blue: #1E5FE0;
  --blue-hover: #1A52C4;
  --blue-dim: rgba(30,95,224,0.16);
  --link: #7FA6F7;
  --red: #E4291A;
  --red-text: #FF7A6B;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --tricolore: linear-gradient(90deg, #1E5FE0 0 33.3%, #F5F5F2 33.3% 66.6%, #E4291A 66.6%);
  background: var(--bg);
}
.admin-archive body{
  background: var(--bg); font-size: 14px;
  padding: max(32px, calc(env(safe-area-inset-top, 0px) + 24px)) 40px 64px;
  scrollbar-color: var(--border) transparent;
}
/* Tricolore-striben hen over toppen, som i adminpanelet */
.admin-archive body::before{ content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--tricolore); z-index: 70; pointer-events: none; }
.admin-archive ::selection{ background: rgba(30,95,224,0.45); color: #fff; }
.admin-archive :focus-visible{ outline-color: var(--link); border-radius: 4px; }
.admin-archive .app{ max-width: 1200px; }

/* ---- Hoved: "← Adminpanel" og Log ud øverst, titlen under ---- */
.admin-archive .head{ flex-wrap: wrap; justify-content: space-between; }
.admin-archive .head h1{ order: 3; flex-basis: 100%; margin-top: 18px; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.admin-archive .icon-btn, .admin-archive .text-btn{
  width: auto; height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px;
  border: 0; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-dim);
}
.admin-archive .icon-btn{ margin-left: -10px; }
.admin-archive .icon-btn::after{ content: "Adminpanel"; }
.admin-archive .icon-btn svg{ width: 16px; height: 16px; }
.admin-archive .icon-btn:hover, .admin-archive .text-btn:hover{ background: var(--surface-2); color: var(--text); }

/* ---- Faner: understreget som i adminpanelets mobilvisning ---- */
.admin-archive .archive-switch{
  width: 100%; gap: 24px; padding: 0; margin: 14px 0 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
}
.admin-archive .archive-switch a{
  padding: 10px 0 12px; margin-bottom: -1px; border-radius: 0; border-bottom: 2px solid transparent;
  font-size: 14px; font-weight: 500; color: var(--text-dim);
}
.admin-archive .archive-switch a:hover{ color: var(--text); }
.admin-archive .archive-switch a[aria-current="page"]{ background: none; color: var(--text); border-bottom-color: var(--blue); }

/* ---- Værktøjslinje: kvartal, hal og eksport ---- */
.admin-archive .toolbar{ margin: 20px 0 0; }
.admin-archive .quarter-select{
  height: 38px; padding: 0 34px 0 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  background-color: var(--surface); border-color: var(--border-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A9B4CC' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.admin-archive .ghost-btn{
  height: 38px; padding: 0 12px; border-radius: 8px; gap: 7px;
  border-color: var(--border-input); font-weight: 500; color: var(--text);
}
.admin-archive .ghost-btn:hover{ background: var(--surface-2); }
.admin-archive .ghost-btn svg{ width: 15px; height: 15px; color: var(--text-dim); }
.admin-archive .quarter-label{ font-size: 14px; }
.admin-archive .archive-note{ margin: 10px 0 0; font-size: 12px; color: var(--text-faint); }
.admin-archive .page-error{ color: var(--red-text); }

/* ---- Hvert skema i sit eget panel; tabellen fylder panelets bredde ---- */
.admin-archive .section{
  margin-top: 16px; padding: 16px 0 0; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); overflow: hidden;
}
.admin-archive .section-title{
  margin: 0 16px 12px; font-family: var(--font-body); font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em; text-transform: none; color: var(--text);
}
.admin-archive .section-meta{ font-size: 13px; font-weight: 400; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.admin-archive .section > .toolbar-group{ padding: 0 16px; }
.admin-archive .section > .toolbar-group .ghost-btn{ height: 32px; font-size: 13px; }
.admin-archive .table-wrap{ border-top: 1px solid var(--border); }
.admin-archive .history{ font-size: 13px; }
.admin-archive .history th, .admin-archive .history td{ border: 0; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 9px 10px; }
.admin-archive .history th:first-child, .admin-archive .history td:first-child{ border-left: 0; }
.admin-archive .history tr:last-child td{ border-bottom: 0; }
.admin-archive .history th{
  background: var(--surface-2); font-family: var(--font-body); font-size: 12px; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--text-dim); white-space: normal; vertical-align: bottom;
}
.admin-archive .history th small{ color: var(--text-faint); font-size: 11px; }
.admin-archive .history tbody tr:hover td{ background: var(--row-hover); }
.admin-archive .history td.date, .admin-archive .history td.date-name{ font-size: 12px; color: var(--text-dim); }
.admin-archive .history td.date-name small{ font-size: 13px; }
.admin-archive .history td.codes-cell{ font-size: 12.5px; letter-spacing: 0.08em; }
.admin-archive .history td.yn-cell.is-no{ color: var(--red-text); }
.admin-archive .history-empty{
  margin: 0; padding: 22px 16px; text-align: center; font-size: 13px; color: var(--text-faint); border-top: 1px solid var(--line);
}
/* Kort og kodeforklaring holder samme indryk som panelets titel */
.admin-archive .section > .history-cards{ padding: 0 16px; border-top: 1px solid var(--border); }
.admin-archive .section > .history-legend{ margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
/* Spørgsmålskolonner bredt nok til at overskriften ikke bliver et smalt tårn */
.admin-archive .history th.q-head{ min-width: 132px; font-size: 12px; }
/* En tom tabel viser kun overskriftsrækken over beskeden — skjul den */
.admin-archive .table-wrap:has(tbody:empty){ display: none; }

@media (max-width: 860px){
  .admin-archive body{ padding: max(20px, calc(env(safe-area-inset-top, 0px) + 14px)) 16px 48px; }
  .admin-archive .archive-switch{ overflow-x: auto; mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); padding-right: 24px; }
  .admin-archive .archive-switch a{ min-height: 44px; }
}
