@font-face {
  font-family: "HelveticaNeueBold";
  src: url("https://zrm.dk/wp-content/themes/flavor/assets/fonts/HelveticaNeueBold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "HelveticaNeueMedium";
  src: url("https://zrm.dk/wp-content/themes/flavor/assets/fonts/HelveticaNeueMedium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* ZRM brand */
  --orange: #ea7a17;
  --orange-600: #c66212;
  --orange-50: #fef5ec;
  --orange-200: #fbc78f;
  --navy: #0d1a27;
  --navy-700: #121e2d;
  --navy-500: #2a3e53;
  --navy-50: #eef1f4;
  /* UI neutrals */
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #0d1a27;
  --muted: #5d6b7a;
  --line: #dde3ea;
  /* semantic */
  --green: #147a4b;
  --amber: #8a5b00;
  --red: #a73535;
  --font-heading: "HelveticaNeueBold", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "HelveticaNeueMedium", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}

h1,
h2,
p {
  margin: 0;
  font-family: var(--font-heading);
}

h1 {
  font-size: 20px;
  font-weight: 700;
}

h2 {
  font-size: 17px;
}

/* ---------- Brand mark ---------- */
.brandMark {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brandDot {
  color: var(--orange);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--orange);
}

.brandLine {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brandLine .brandMark {
  font-size: 26px;
  color: #fff;
}

.topbar h1 {
  color: #fff;
}

#statusText {
  margin-top: 2px;
  color: #aebbc8;
  font-size: 13px;
}

/* ---------- Buttons ---------- */
button,
select,
input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}

button {
  padding: 0 14px;
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
}

button:hover:not(:disabled) {
  background: var(--orange-600);
  border-color: var(--orange-600);
}

/* secondary + ghost live on the navy topbar */
button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
button.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
}

button.ghost {
  background: transparent;
  color: #aebbc8;
  border-color: transparent;
}
button.ghost:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.iconButton {
  width: 36px;
  padding: 0;
  background: #fff;
  color: var(--text);
  border-color: var(--line);
  font-size: 24px;
  line-height: 1;
}
.iconButton:hover:not(:disabled) {
  background: var(--navy-50);
}

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Summary metrics ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  border-top: 3px solid var(--navy-50);
}

.metric {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
}

.label {
  color: var(--muted);
}

.match {
  color: var(--green);
}
.maybe {
  color: var(--amber);
}
.reject {
  color: var(--red);
}

/* ---------- Toolbar ---------- */
.toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.toolbar input {
  width: min(360px, 45vw);
  padding: 0 10px;
  background: #fff;
}

.toolbar select {
  min-width: 150px;
  padding: 0 8px;
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

/* ---------- Table ---------- */
.tableWrap {
  position: relative;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #fafbfc;
}

td:first-child {
  width: 92px;
}

.score {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  background: var(--navy-50);
}
.score.match {
  background: #e6f5ed;
  color: var(--green);
}
.score.maybe {
  background: #fff4d8;
  color: var(--amber);
}
.score.reject {
  background: #faeaea;
  color: var(--red);
}

.titleCell a {
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 700;
  text-decoration: none;
}
.titleCell a:hover {
  color: var(--orange-600);
  text-decoration: underline;
}

.subtext {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
}

/* ---------- Source tags ---------- */
.sourceTag {
  display: inline-block;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--navy-50);
  color: var(--navy-500);
  border: 1px solid var(--line);
}
.source-ted {
  background: #e8f0fb;
  color: #1b5faa;
  border-color: #cfe0f5;
}
.source-govgen {
  background: #e8f4ee;
  color: #147a4b;
  border-color: #cfe8da;
}
.source-udbuddk {
  background: var(--orange-50);
  color: var(--orange-600);
  border-color: var(--orange-200);
}
.source-ethics_mail {
  background: #f1eafb;
  color: #6b3fa0;
  border-color: #e0d2f3;
}

.rowActions {
  display: flex;
  gap: 8px;
}
.rowActions button {
  min-height: 34px;
  white-space: nowrap;
}

.empty {
  display: none;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Dialog ---------- */
dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
}
dialog::backdrop {
  background: rgb(13 26 39 / 55%);
}
.dialogHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: var(--navy-50);
}
pre {
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
  line-height: 1.55;
  max-height: 720px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* ---------- Login page ---------- */
.loginBody {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #1c2c3d, var(--navy));
}

.loginCard {
  width: min(400px, 100%);
  background: var(--panel);
  border-radius: 14px;
  padding: 34px 32px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 35%);
  border-top: 4px solid var(--orange);
}

.loginBrand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
}
.loginBrand .brandMark {
  font-size: 30px;
  color: var(--navy);
}
.brandSub {
  color: var(--muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.loginTitle {
  font-size: 22px;
}
.loginLede {
  margin: 6px 0 22px;
  color: var(--muted);
  font-family: var(--font-body);
}

.loginForm {
  display: grid;
  gap: 16px;
}
.loginForm label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 500;
}
.loginForm input {
  width: 100%;
  padding: 0 12px;
  background: #fff;
}
.loginForm button {
  margin-top: 4px;
  min-height: 44px;
  font-size: 15px;
}
.loginError {
  color: var(--red);
  min-height: 18px;
  margin: 0;
  font-family: var(--font-body);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .actions {
    justify-content: stretch;
  }
  .actions button {
    flex: 1;
  }
  .toolbar input {
    width: 100%;
  }
}
