@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;600&display=swap');
/* ============================================================
   Maskintjek — fælles layout for medarbejdernes skemaer og historik.
   Samme navy Tricolore-udseende som adminpanelet: flade flader, brandets
   blå til handling, rød kun til det vigtige, numre i datafont.
   ============================================================ */
:root{
  color-scheme: dark;
  --bg: #0B1428;
  --bg-glow: none;
  --surface: #111D38;
  --surface-2: #182748;
  --line: #1A2849;
  --border: #22325A;
  --border-input: #56699A;   /* ≥3:1 mod fladerne, så knapper og felter kan ses i genskin */
  --text: #ECEEF3;
  --text-dim: #A9B4CC;
  --text-faint: #8C97B3;
  --blue: #1E5FE0;
  --blue-dim: rgba(30,95,224,0.16);
  --link: #7FA6F7;
  --red: #E4291A;
  --red-text: #FF7A6B;
  --green: #4ADE80;
  --tricolore: linear-gradient(90deg, #1E5FE0 0 33.3%, #F5F5F2 33.3% 66.6%, #E4291A 66.6%);
  --font-display: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*{ box-sizing: border-box; }
[hidden]{ display: none !important; }   /* hidden skal vinde over display-regler, fx .archive-switch */
html, body{ margin: 0; padding: 0; }
body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  padding: max(20px, calc(env(safe-area-inset-top, 0px) + 16px)) 14px 110px;
}
body::before{ content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--tricolore); z-index: 70; pointer-events: none; }
::selection{ background: rgba(30,95,224,0.45); color: #fff; }
:focus-visible{ outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }

.app{ max-width: 640px; margin: 0 auto; }

/* ---- Header: tilbage · titel · log ud på én linje ---- */
.head{ display: flex; align-items: center; gap: 10px; }
.head h1{
  flex: 1; min-width: 0; margin: 0;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 5.6vw, 28px); letter-spacing: -0.015em; line-height: 1.15;
}
.icon-btn, .text-btn{
  flex-shrink: 0; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-body); font-size: 13px; font-weight: 600; text-decoration: none;
  border-radius: 999px; cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.icon-btn{ width: 44px; height: 44px; }
.icon-btn svg{ width: 17px; height: 17px; }
.text-btn{ height: 44px; padding: 0 16px; }
.icon-btn:hover, .text-btn:hover{ border-color: var(--text-dim); color: var(--text); }

/* ---- Vigtigt: eneste sted med rødt ---- */
.notice{
  margin: 14px 0 0; padding: 10px 14px;
  border: 1px solid rgba(228,41,26,0.5); background: rgba(228,41,26,0.08); border-radius: 10px;
  font-size: 14px; line-height: 1.5;
}
.notice.preview-notice{ border-color: rgba(30,95,224,0.6); background: var(--blue-dim); }
.notice.preview-notice b{ color: #7FB0FF; }
.notice b{ color: var(--red-text); font-weight: 700; margin-right: 6px; }

/* ---- Sektioner adskilt af tynde linjer i stedet for kort ---- */
.section{ padding: 18px 0; border-top: 1px solid var(--line); }
.notice + .section, .head + .section{ border-top: none; }
.section-title{
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: -0.005em; color: var(--text);
}
.section-meta{ font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--text-dim); }
.section-meta b{ color: var(--text); font-weight: 600; }

/* ---- Kodeforklaring ---- */
.legend{ display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-dim); }
.legend b{ color: var(--text); font-family: var(--font-mono); margin-right: 5px; }

/* ---- Tjek-rækker: navn + fire kompakte knapper ---- */
.check-row{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.check-row:first-child{ border-top: none; }
.check-name{ font-weight: 600; font-size: 15px; }
.check-name small{ display: block; font-weight: 400; font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.codes{ display: flex; gap: 6px; }
.code-btn{
  width: 48px; height: 44px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-mono); font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .1s ease;
}
.code-btn:active{ transform: scale(0.94); }
.code-btn[aria-pressed="true"]{ background: var(--blue); border-color: var(--blue); color: #fff; }

.field-label{ display: block; font-size: 13px; color: var(--text-dim); margin: 14px 0 6px; }
.note-input{
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-body); font-size: 16px; padding: 11px 14px; border-radius: 10px; resize: vertical; min-height: 48px;
}
.note-input::placeholder{ color: var(--text-faint); }
.note-input:focus{ border-color: var(--blue); outline: none; }

.form-error{ color: var(--red-text); font-size: 14px; margin: 10px 0 0; min-height: 1px; }
.accept-btn{
  width: 100%; min-height: 56px; margin-top: 10px; padding: 15px 18px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--blue); color: #fff; font-family: var(--font-body); font-size: 16px; font-weight: 700;
  transition: transform .1s ease, opacity .15s ease, filter .15s ease;
}
.accept-btn:hover{ filter: brightness(1.08); }
.accept-btn:active{ transform: scale(0.985); }
.accept-btn:disabled{ opacity: .55; cursor: default; }

/* ---- Historik (som papirskemaet) ---- */
.table-wrap{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
.history{ width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.history.wide{ min-width: 720px; }
.history th, .history td{ border: 1px solid var(--line); padding: 8px 6px; text-align: center; vertical-align: top; }
.history th{
  font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--text-dim); white-space: nowrap; background: var(--surface-2);
}
.history th small{ display: block; font-family: var(--font-body); font-weight: 400; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.history td.date{ font-family: var(--font-mono); font-size: 12px; white-space: nowrap; color: var(--text-dim); }
.history td.codes-cell{ font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.12em; }
.history td.name{ text-align: left; white-space: nowrap; }
.history td.note{ text-align: left; min-width: 90px; color: var(--text-dim); overflow-wrap: anywhere; }
.history-empty{ color: var(--text-dim); font-size: 14px; padding: 6px 0 0; margin: 0; }

/* ---- Toast ---- */
.toast{
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--text); border: 0; color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 12px 20px; border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.6);
  transition: opacity .2s ease, transform .2s ease; z-index: 10;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 600px){
  body{ padding: max(14px, calc(env(safe-area-inset-top, 0px) + 10px)) 14px 90px; }
  .code-btn{ width: 44px; }
}
@media (max-width: 360px){
  .check-row{ flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---- Historik-side: kvartalsvalg + eksport ---- */
.toolbar{ display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.quarter-label{ font-weight: 600; font-size: 15px; }
.quarter-select{
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-body); font-size: 15px; font-weight: 600; padding: 10px 36px 10px 14px; border-radius: 10px;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E94A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.quarter-select:focus{ border-color: var(--blue); outline: none; }
.ghost-btn{
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--blue); color: var(--text);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  transition: background .12s ease;
}
.ghost-btn:hover{ background: var(--blue-dim); }
.ghost-btn:disabled{ opacity: .55; cursor: default; }
.ghost-btn svg{ width: 16px; height: 16px; }
.archive-note{ margin: 8px 0 0; font-size: 13px; color: var(--text-dim); }
.page-error{ color: #FF6B5C; font-size: 13px; margin: 8px 0 0; min-height: 1px; }

/* ---- Hal-tjek: kodeknapper med bogstav + tekst ---- */
.info-row{ display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; font-size: 13px; color: var(--text-dim); }
.info-row b{ color: var(--text); font-weight: 600; }
.code-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.code-toggle{
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 12px; cursor: pointer; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-body); font-size: 14px; font-weight: 500; line-height: 1.25;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .1s ease;
}
.code-toggle:active{ transform: scale(0.98); }
.code-toggle .letter{
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 15px; font-weight: 600; border: 1px solid var(--border); color: var(--text);
}
.code-toggle[aria-pressed="true"]{ border-color: var(--blue); color: var(--text); background: var(--blue-dim); }
.code-toggle[aria-pressed="true"] .letter{ background: var(--blue); border-color: var(--blue); color: #fff; }
.history.narrow{ min-width: 0; }
@media (max-width: 360px){ .code-grid{ grid-template-columns: 1fr; } }
.head h1.long-title{ font-size: clamp(18px, 4.6vw, 24px); }

/* ---- Hal-tjek: ja/nej-spørgsmål (Bygningskontrol) ---- */
.question-row{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.question-row:first-child{ border-top: none; }
.question-label{ font-weight: 600; font-size: 15px; line-height: 1.3; }
.yes-no{ display: flex; gap: 6px; flex-shrink: 0; }
.yn-btn{
  width: 64px; height: 44px; border-radius: 10px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .1s ease;
}
.yn-btn:active{ transform: scale(0.95); }
.yn-btn[aria-pressed="true"]{ background: var(--blue); border-color: var(--blue); color: #fff; }
.yn-btn.no[aria-pressed="true"]{ background: var(--red); border-color: var(--red); }
.history th.q-head{ white-space: normal; min-width: 92px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 12px; }
.history td.date-name{ text-align: left; white-space: nowrap; font-family: var(--font-mono); color: var(--text-dim); }
.history td.date-name small{ display: block; font-family: var(--font-body); font-size: 12px; color: var(--text); margin-top: 2px; }
.history td.yn-cell{ font-weight: 600; }
.history td.yn-cell.is-no{ color: #FF6B5C; }
@media (max-width: 380px){ .yn-btn{ width: 54px; } }

/* ---- Hal-tjek: nummer-skema (Kontrol af truck) ---- */
.form-description{ margin: -4px 0 12px; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.nr-input{ min-height: 0; resize: none; font-family: var(--font-mono); font-size: 18px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.nr-input::placeholder{ font-family: var(--font-body); font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; }

/* ---- Arkiv: skift mellem Maskiner og Haller (kun admin) ---- */
.archive-switch{ display: flex; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 4px; padding: 4px; margin: 14px 0 0; border: 1px solid var(--border); border-radius: 12px; }
.archive-switch::-webkit-scrollbar{ display: none; }
.archive-switch a{
  flex-shrink: 0; padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-dim); text-decoration: none;
}
.archive-switch a[aria-current="page"]{ background: var(--blue); color: #fff; }
.toolbar-group{ display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Hal-tjek: tekstfelter (Visuel skadedyrkontrol) ---- */
#fieldList .field-label:first-child{ margin-top: 0; }
.history td.field-cell{ font-family: var(--font-mono); font-weight: 600; text-align: left; }

/* ---- Skadesrapport (skade.html) ---- */
.optional{ color: var(--text-dim); font-weight: 400; }
.urgency-label{ margin-top: 16px; }
.urgency{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.urgency-btn{
  min-height: 52px; padding: 10px 12px; border-radius: 12px; cursor: pointer; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 1.25;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.urgency-btn[aria-pressed="true"]{ background: var(--blue); border-color: var(--blue); color: #fff; }
.urgency-btn.now[aria-pressed="true"]{ background: var(--red); border-color: var(--red); }
.sent-box{ margin-top: 18px; padding: 18px; border: 1px solid var(--blue); border-radius: 14px; background: var(--blue-dim); }
.sent-title{ margin: 0 0 4px; font-weight: 700; font-size: 17px; }
.sent-text{ margin: 0 0 14px; color: var(--text-dim); font-size: 14px; }
.sent-log{ margin: 0 0 6px; padding: 0; list-style: none; font-size: 14px; color: var(--text-dim); }
.sent-log li{ padding: 2px 0; }
.sent-log b{ color: var(--text); }
.mail-row{ display: flex; gap: 8px; }
.mail-row .note-input{ flex: 1; min-width: 0; min-height: 0; }
.new-btn{ margin-top: 14px; }

/* ---- Skadesrapport: skemavalg og maskintyper ---- */
.type-label{ margin-top: 0; }
.type-choice{ display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.type-btn{
  min-height: 56px; padding: 12px 16px; border-radius: 12px; cursor: pointer; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1.3;
  transition: background .12s ease, border-color .12s ease;
}
.type-btn[aria-pressed="true"]{ background: var(--blue-dim); border-color: var(--blue); }
.type-choice:has(.type-btn[aria-pressed="true"]) .type-btn[aria-pressed="false"]{ color: var(--text-dim); }
.machine-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.machine-grid .urgency-btn{ min-height: 44px; }

/* ---- Hal-tjek: Meld skade fra skemaet ---- */
.damage-link{ display: flex; justify-content: center; width: 100%; margin-top: 10px; border-color: var(--red); text-decoration: none; }
.damage-link:hover{ background: rgba(228,41,26,0.08); }

/* ---- Forsendelsesrapport (forsendelse.html) ---- */
.pair{ display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.pair .note-input{ min-width: 0; }
.hint{ margin: 10px 0 0; font-size: 13px; color: var(--text-dim); }
.loc-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.loc-grid .urgency-btn{ min-height: 46px; font-family: var(--font-mono); font-size: 15px; }
.count-table{ width: 100%; border-collapse: collapse; font-size: 14px; }
.count-table th, .count-table td{ padding: 4px 0; text-align: left; }
.count-table td{ padding-left: 8px; width: 30%; }
.count-table thead th{ font-family: var(--font-body); font-size: 12px; color: var(--text-dim); font-weight: 500; padding-left: 8px; }
.count-table tbody th, .count-table tfoot th{ font-weight: 600; }
.count-table tfoot th, .count-table tfoot td{ padding-top: 10px; }
.count-input{ min-height: 0; padding: 9px 10px; resize: none; }
.count-table.view td{ font-family: var(--font-mono); font-weight: 600; }
.count-table.view th, .count-table.view td{ border-top: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; }
.check-group{ margin: 18px 0 2px; font-weight: 700; font-size: 15px; color: var(--blue); filter: brightness(1.6); }
.check-group:first-child{ margin-top: 0; }
.ship-check{ padding: 10px 0; border-top: 1px solid var(--line); }
.check-group + .ship-check{ border-top: none; }
.ship-check-label{ margin: 0 0 8px; font-size: 14px; line-height: 1.4; }
.ship-answers{ display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ship-answers .yn-btn{ width: auto; min-width: 64px; padding: 0 12px; }
.note-toggle{ margin-left: auto; background: none; border: none; color: var(--text-dim); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 4px; }
.note-toggle:hover{ color: var(--text); }
.ship-note{ margin-top: 8px; min-height: 0; }
.ship-check.missing .ship-check-label{ color: #FF6B5C; }
.ship-check.missing .yn-btn{ border-color: rgba(228,41,26,0.6); }
.answer-tag{ display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--blue-dim); border: 1px solid var(--blue); font-size: 13px; font-weight: 600; }
.answer-tag.bad{ background: rgba(228,41,26,0.12); border-color: var(--red); color: #FF6B5C; }
.ship-check-note{ margin: 6px 0 0; font-size: 14px; color: var(--text-dim); }
.view-list{ margin: 0; }
.view-row{ display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.view-row:first-child{ border-top: none; }
.view-row dt{ color: var(--text-dim); }
.view-row dd{ margin: 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.sent-box .ghost-btn{ text-decoration: none; }
@media (max-width: 420px){ .view-row{ grid-template-columns: 1fr; gap: 2px; } }
.stamp-btn{
  width: 100%; min-height: 56px; padding: 8px 12px; border-radius: 12px; cursor: pointer;
  background: var(--blue); border: 1px solid var(--blue); color: #fff;
  font-family: var(--font-body); font-size: 15px; font-weight: 700; line-height: 1.25;
  transition: background .12s ease, border-color .12s ease, opacity .15s ease, transform .1s ease;
}
.stamp-btn:active{ transform: scale(0.98); }
.stamp-btn:disabled{ background: var(--surface-2); border-color: var(--border); color: var(--text-dim); opacity: .6; cursor: default; }
.stamp-btn.stamped{ background: var(--blue-dim); color: var(--text); }
.stamp-btn b{ display: block; font-family: var(--font-mono); font-size: 14px; }
.stamp-btn small{ display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--text-dim); }

/* ---- Stregkode-scanner (scanner.js) ---- */
.label-row{ display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.label-row .field-label{ margin-bottom: 6px; }
.scan-btn{
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; margin-bottom: 6px; border-radius: 999px; cursor: pointer;
  background: var(--blue); border: 1px solid var(--blue); color: #fff;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
}
.scan-btn svg{ width: 18px; height: 18px; }
body.scan-open{ overflow: hidden; }
.scan-overlay{
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background: #05070D; color: var(--text);
  padding: max(14px, env(safe-area-inset-top, 0px)) 14px max(14px, env(safe-area-inset-bottom, 0px));
}
.scan-head{ display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.scan-title{ margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.015em; }
.scan-done{
  height: 42px; padding: 0 20px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--blue); color: #fff; font-family: var(--font-body); font-size: 15px; font-weight: 700;
}
.scan-view{ position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; background: #000; }
.scan-view video{ width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame{
  position: absolute; left: 8%; right: 8%; top: 35%; bottom: 35%;
  border: 3px solid rgba(255,255,255,0.85); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
  transition: border-color .15s ease;
}
.scan-overlay.flash .scan-frame{ animation: scan-flash .5s ease; }
@keyframes scan-flash{ 0%{ border-color: #22C55E; box-shadow: 0 0 0 9999px rgba(34,197,94,0.25); } 100%{ border-color: rgba(255,255,255,0.85); } }
.scan-status{
  position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; padding: 0 16px; text-align: center;
  font-size: 14px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.scan-list{ list-style: none; margin: 12px 0 0; padding: 0; max-height: 28vh; overflow-y: auto; }
.scan-list li{ display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; margin-bottom: 6px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.scan-list li b{ font-family: var(--font-mono); overflow-wrap: anywhere; }
.scan-list li span{ color: #22C55E; font-weight: 600; flex-shrink: 0; }
.scan-list li.dup span{ color: var(--text-dim); }

/* ---- Billed-dokumentation (forsendelse.html) ---- */
.photo-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-grid:empty{ display: none; }
.photo-thumb{ position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); padding: 0; cursor: pointer; }
.photo-thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del{
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 18px; line-height: 1;
}
.photo-add{
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; min-height: 48px; border-radius: 12px; cursor: pointer;
  border: 1px dashed var(--blue); color: var(--text); font-weight: 600; font-size: 15px;
}
.photo-add:hover{ background: var(--blue-dim); }
.photo-add svg{ width: 20px; height: 20px; }
.photo-lightbox{
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(0,0,0,0.92); padding: 16px; cursor: zoom-out;
}
.photo-lightbox img{ max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; border-radius: 8px; }
.photo-lightbox span{ color: var(--text-dim); font-size: 13px; }

@media (max-width: 420px){ .archive-switch a{ padding: 8px 10px; font-size: 13px; } }


/* ============================================================
   Navy Tricolore — tilføjelser (16-11-2026)
   ============================================================ */
/* Knapper og felter man kan trykke på får en kant, der kan ses i genskin */
.code-btn, .yn-btn, .code-toggle, .urgency-btn, .type-btn, .note-input, .quarter-select{ border-color: var(--border-input); }
.code-toggle .letter{ border-color: var(--border-input); }

/* Maskintjek: navnet over, koderne som store knapper i hele rækkens bredde (handsker, én hånd) */
.check-row{ display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px 0; }
.check-name{ position: relative; padding-right: 26px; }
.check-row.has-codes .check-name::after{
  content: ""; position: absolute; top: 2px; right: 0; width: 18px; height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ADE80' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.codes{ display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 10px; }
.code-btn{
  position: relative; width: auto; height: auto; min-height: 60px; padding: 8px 6px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.code-btn .code-letter{ font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--text); line-height: 1; }
.code-btn .code-label{ font-family: var(--font-body); font-size: 11.5px; font-weight: 500; line-height: 1.2; color: var(--text-dim); text-align: center; }
.code-btn[aria-pressed="true"] .code-letter, .code-btn[aria-pressed="true"] .code-label{ color: #fff; }
/* Flueben i hjørnet — valgt ses ikke kun på farven */
.code-btn[aria-pressed="true"]::after{
  content: ""; position: absolute; top: 5px; right: 6px; width: 13px; height: 13px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.code-btn[aria-pressed="true"]:focus-visible{ outline-color: #fff; }
@media (min-width: 700px){
  .check-row{ grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); align-items: center; }
  .codes{ grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
}
.rows-loading{ padding: 24px 0; text-align: center; color: var(--text-faint); font-size: 14px; }

/* Kvittering efter gem: bliver stående, med Fortryd i 30 sek. */
.receipt{
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; padding: 14px;
  border: 1px solid rgba(74,222,128,.45); border-radius: 12px; background: rgba(74,222,128,.10);
}
.receipt svg{ width: 22px; height: 22px; color: var(--green); flex-shrink: 0; margin-top: 1px; }
.receipt-text{ flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.receipt-text b{ display: block; font-size: 15px; }
.receipt-text span{ color: var(--text-dim); overflow-wrap: anywhere; }
.receipt-undo{
  flex-shrink: 0; min-height: 44px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--border-input); color: var(--text); font: 600 14px var(--font-body);
}
.receipt-undo:disabled{ opacity: .5; cursor: progress; }

/* Historik: kort pr. tjek på telefon, tabel på større skærme */
.history-cards{ display: none; list-style: none; margin: 0; padding: 0; }
.history-card{ padding: 12px 0; border-top: 1px solid var(--line); }
.history-card:first-child{ border-top: 0; }
.history-card-head{ display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-dim); }
.history-card-head .date{ font-family: var(--font-mono); font-size: 12px; }
.history-card-codes{ margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.history-card-codes span{ padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }
.history-card-codes b{ font-family: var(--font-mono); margin-left: 4px; letter-spacing: .06em; }
.history-card-note{ margin: 6px 0 0; font-size: 13px; color: var(--text-dim); }
.history-legend{ margin-top: 12px; }
@media (max-width: 600px){
  .table-wrap.has-cards{ display: none; }
  .history-cards{ display: block; }
}
