/* SuuB 3D — Ordre-manager · moderne tema */
:root {
  --bg: #0c0f14;
  --panel: rgba(23, 27, 34, .88);
  --panel-solid: #171b21;
  --panel2: #1f252e;
  --line: #2a313b;
  --line-soft: rgba(255, 255, 255, .06);
  --text: #eef1f5;
  --muted: #98a1ad;
  --accent: #4cc38a;
  --accent2: #3d9f71;
  --accent-soft: rgba(76, 195, 138, .12);
  --warn: #e6b654;
  --warn-soft: rgba(230, 182, 84, .13);
  --danger: #e06b6b;
  --danger-soft: rgba(224, 107, 107, .13);
  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
  --glow: 0 0 0 3px rgba(76, 195, 138, .22);
  --glass: linear-gradient(135deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .028) 45%, rgba(255, 255, 255, .06));
  --glass-shine: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .09) 42%, transparent 58%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(76, 195, 138, .1), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(90, 140, 255, .09), transparent 60%),
    radial-gradient(500px 350px at 40% 55%, rgba(180, 130, 255, .06), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(76, 195, 138, .3); }

/* ---------------- topbar ---------------- */
/* Topbjælken er en fast, mørk flade i temaets farver — ikke en lys/transparent
   glasflade, som kan fremstå hvid over lyse elementer. */
header.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  background-color: #0f131a;
  background-image: linear-gradient(180deg, #171c24 0%, #10141a 100%);
  border-bottom: 1px solid rgba(76, 195, 138, .3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 6px 22px rgba(0, 0, 0, .45);
  flex-wrap: wrap;
  color: var(--text);
  row-gap: 2px;
}
/* Række 1: brand, aktiv ordreside og live-status. Række 2: fanerne, så de
   ikke skubber topbjælken ud i tre rækker på mellemstore skærme. */
.brand { order: 0; }
.pageChip { order: 1; }
.liveStatus { order: 2; margin-left: auto; }
.navToggle { order: 3; }
nav.tabs { order: 4; flex: 1 0 100%; padding-top: 5px; }
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 0;
}
.brandLogoBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 12px;
  border: 1px solid rgba(76, 195, 138, .38);
  background-color: rgba(76, 195, 138, .14);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background-color .15s ease, transform .12s ease, border-color .15s ease;
}
.brandLogoBtn:hover { background-color: rgba(76, 195, 138, .24); border-color: rgba(76, 195, 138, .6); }
.brandLogoBtn:active { transform: scale(.95); }
#brandLogo { display: inline-flex; align-items: center; }
.brandNameBtn {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.2px;
  cursor: pointer;
  border-radius: 8px;
  transition: color .15s ease;
}
.brandNameBtn:hover { color: var(--accent); }
.brandNameBtn:focus-visible { outline: 2px solid rgba(76, 195, 138, .55); outline-offset: 3px; }
.brandTag {
  margin-left: 2px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  background-color: rgba(255, 255, 255, .07);
  color: #cfd6e0;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.brandTag:hover { background-color: rgba(255, 255, 255, .13); color: #fff; border-color: rgba(255, 255, 255, .34); }
.brandLogo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  padding: 2px;
  vertical-align: -5px;
}

/* aktiv ordreside */
.pageChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(76, 195, 138, .42);
  background-color: rgba(76, 195, 138, .14);
  color: #d8ffe9;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color .15s ease, border-color .15s ease;
}
.pageChip:hover { background-color: rgba(76, 195, 138, .24); border-color: rgba(76, 195, 138, .65); }
.pageChip.shared {
  border-color: rgba(230, 182, 84, .55);
  background-color: rgba(230, 182, 84, .18);
  color: #ffe7b8;
}
.pageBanner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 22px;
  background-image: linear-gradient(90deg, rgba(230, 182, 84, .2), rgba(230, 182, 84, .06));
  background-color: rgba(230, 182, 84, .08);
  border-bottom: 1px solid rgba(230, 182, 84, .35);
  color: #ffe7b8;
  font-size: 13px;
}
.pageBanner[hidden] { display: none; }
.pageBanner .pbDot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e6b654;
  box-shadow: 0 0 0 3px rgba(230, 182, 84, .22);
  flex: 0 0 auto;
}
.pageBanner .pbText { flex: 1 1 260px; }
.pageBanner .pbActions { display: flex; gap: 8px; flex-wrap: wrap; }
.pageBanner .pbActions button { padding: 6px 13px; font-size: 12.5px; }
/* Genvejen til Ordre Manager vises kun i ☰-menuen på mobil. */
.navShortcut { display: none; }

/* Fanerne har popover-attribut, så mobilmenuen kan ligge i top-layer. Uden
   denne reset tegner browseren den lukkede popover som en hvid boks midt på
   siden (den hvide "topbar"). På desktop er fanerne en helt almindelig række. */
nav.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  position: static;
  inset: auto;
  margin: 0;
  padding: 0;
  width: auto;
  max-width: none;
  max-height: none;
  border: 0;
  background: none;
  color: inherit;
  z-index: auto;
}
nav.tabs::-webkit-scrollbar { display: none; }
/* menu-knap: kun synlig på mobil, hvor fanerne ligger i en dropdown */
.navToggle { display: none; }
nav.tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
  background:
    var(--glass-shine);
  background-color: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease;
}
nav.tabs button:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, .08);
  background-image: var(--glass-shine);
  border-color: rgba(255, 255, 255, .14);
}
nav.tabs button:active { transform: scale(.97); }
nav.tabs button.active {
  color: var(--text);
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  font-weight: 600;
}

/* ---------------- layout ---------------- */
main { padding: 22px 24px 48px; max-width: 1200px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fadeUp .28s cubic-bezier(.2, .8, .3, 1); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes navDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes glassDrop {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes raise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 { font-size: 21px; margin: 6px 0 18px; letter-spacing: -.3px; }
h2 { font-size: 15.5px; margin: 0 0 12px; }

/* ---------------- cards ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.card {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(255, 255, 255, .03),
    0 6px 22px rgba(0, 0, 0, .32);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
  animation: raise .3s ease backwards;
}
.card:hover {
  transform: translateY(-3px);
  background-color: rgba(255, 255, 255, .065);
  border-color: rgba(255, 255, 255, .26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .26),
    0 12px 34px rgba(0, 0, 0, .4);
}
.cards .card:nth-child(1) { animation-delay: .02s; }
.cards .card:nth-child(2) { animation-delay: .05s; }
.cards .card:nth-child(3) { animation-delay: .08s; }
.cards .card:nth-child(4) { animation-delay: .11s; }
.cards .card:nth-child(5) { animation-delay: .14s; }
.cards .card:nth-child(6) { animation-delay: .17s; }
.cards .card:nth-child(7) { animation-delay: .2s; }
.cards .card:nth-child(8) { animation-delay: .23s; }
.card .label {
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
}
.card .value { font-size: 23px; font-weight: 750; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.value.pos { color: var(--accent); }
.value.neg { color: var(--danger); }
.value.warn { color: var(--warn); }

/* ---------------- toolbar ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .muted { font-size: 13px; }

input.search {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px 9px 36px;
  font-size: 13.5px;
  font-family: inherit;
  min-width: 220px;
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2398a1ad' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"),
    var(--glass-shine),
    var(--glass);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: 12px center, 0 0, 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 3px 12px rgba(0, 0, 0, .28);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input.search:focus {
  outline: none;
  border-color: rgba(255, 255, 255, .4);
  background-color: rgba(255, 255, 255, .095);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 0 0 3.5px rgba(76, 195, 138, .22),
    0 6px 18px rgba(0, 0, 0, .35);
}
input.search::placeholder { color: var(--muted); opacity: .75; }

/* månedsvælger i regnskabet bruger samme udseende som søgefeltet */
select.search {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--text);
  border-radius: 999px;
  font-size: 13.5px;
  font-family: inherit;
  color-scheme: dark;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 3px 12px rgba(0, 0, 0, .28);
  cursor: pointer;
}
select.search:focus {
  outline: none;
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 0 0 3.5px rgba(76, 195, 138, .22);
}
select.search option { background: #1a1e26; color: var(--text); }

/* ---------------- knapper · Liquid Glass ---------------- */
button.primary, a.primary {
  background:
    var(--glass-shine),
    linear-gradient(135deg, rgba(76, 195, 138, .92), rgba(63, 179, 126, .85));
  color: #06281a;
  border: 1px solid rgba(255, 255, 255, .35);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 650;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    0 6px 20px rgba(76, 195, 138, .32);
  transition: transform .14s ease, box-shadow .18s ease, filter .18s ease;
}
button.primary:hover, a.primary:hover { transform: translateY(-1.5px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 9px 26px rgba(76, 195, 138, .42); filter: brightness(1.06); }
button.primary:active, a.primary:active { transform: translateY(0) scale(.97); }
button.secondary {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .055);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 9px 17px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .26),
    0 3px 12px rgba(0, 0, 0, .3);
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease, box-shadow .18s ease;
}
button.secondary:hover {
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .3);
  transform: translateY(-1.5px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 18px rgba(0, 0, 0, .38);
}
button.secondary:active { transform: scale(.97); }
button.danger {
  background:
    var(--glass-shine),
    linear-gradient(135deg, rgba(224, 107, 107, .92), rgba(201, 83, 83, .85));
  border: 1px solid rgba(255, 255, 255, .35);
  color: #2a0d0d;
  padding: 10px 20px;
  font-weight: 650;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .42),
    0 6px 20px rgba(224, 107, 107, .3);
  transition: transform .14s ease, filter .18s ease;
}
button.danger:hover { transform: translateY(-1.5px); filter: brightness(1.08); }
button.iconBtn {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--muted);
  border-radius: 12px;
  padding: 4.5px 10px;
  cursor: pointer;
  font-size: 12.5px;
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: color .14s ease, background-color .14s ease, border-color .14s ease, transform .12s ease;
}
button.iconBtn:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .3);
  transform: translateY(-1px);
}
button.iconBtn:active { transform: scale(.95); }

:is(button, input, select):focus-visible {
  outline: none;
  box-shadow: var(--glow);
}

/* ---------------- tabeller · Liquid Glass ---------------- */
.tableWrap {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    0 6px 22px rgba(0, 0, 0, .3);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 11px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  background: rgba(255, 255, 255, .06);
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.accent { color: var(--accent); font-weight: 600; }
.neg { color: var(--danger); }
.muted { color: var(--muted); }

/* ---------------- formularer · Liquid Glass ---------------- */
form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 500; }
form input, form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 14px;
  position: relative;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  font-size: 14.5px;
  font-family: inherit;
  color-scheme: dark;
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .045);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(255, 255, 255, .05),
    0 2px 10px rgba(0, 0, 0, .28);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .12s ease;
}
form input:hover, form select:hover { background-color: rgba(255, 255, 255, .075); transform: translateY(-1px); }
form input:focus, form select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, .4);
  background-color: rgba(255, 255, 255, .09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    inset 0 -1px 0 rgba(255, 255, 255, .06),
    0 0 0 3.5px rgba(76, 195, 138, .25),
    0 6px 18px rgba(0, 0, 0, .35);
}
form select option { background: #1a1e26; color: var(--text); }

/* ---------------- dialoger · Liquid Glass ---------------- */
.dlg {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(30, 36, 46, .72);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 26px;
  padding: 22px 24px;
  width: min(640px, 94vw);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 24px 70px rgba(0, 0, 0, .55);
}
.dlg[open] { animation: popIn .2s cubic-bezier(.2, .9, .3, 1.2); }
.dlg::backdrop { background: rgba(4, 6, 9, .65); backdrop-filter: blur(3px); }
.dlg h2 { font-size: 17px; letter-spacing: -.2px; }
.dlg.small { width: min(420px, 94vw); }
.rowEnd { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.inline3 { display: flex; gap: 8px; }
.inline3 input { margin-top: 4px; }
.dlg table { min-width: 0; }
.dlg table th, .dlg table td { padding: 7px 10px; font-size: 12.5px; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(30, 36, 46, .78);
  border: 1px solid rgba(255, 255, 255, .22);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.2), opacity .25s ease;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty {
  color: var(--muted);
  padding: 36px 24px;
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 10px;
}

/* ---------------- firma-bar · dashboard ---------------- */
.companyBar {
  display: flex;
  align-items: center;
  gap: 14px;
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 4px 16px rgba(0, 0, 0, .3);
}
.companyLogo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  padding: 4px;
}
.companyName { font-weight: 700; font-size: 16.5px; letter-spacing: -.2px; }

/* logo-felter i indstillinger */
.logoRow { display: flex; align-items: center; gap: 12px; }
.logoPrev {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 4px;
}

/* ---------------- printer-panel · dashboard ---------------- */
.printerPanel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.printerCard {
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 13px 15px;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 4px 16px rgba(0, 0, 0, .3);
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}
.printerCard:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, .065);
  border-color: rgba(255, 255, 255, .26);
}
.printerCard.igaang { border-color: rgba(230, 182, 84, .45); background-color: rgba(230, 182, 84, .07); }
.printerCard.bussy { border-color: rgba(230, 182, 84, .45); }
.printerCard.reperation { border-color: rgba(90, 170, 255, .45); background-color: rgba(90, 170, 255, .07); }
.printerCard.ude_drift { border-color: rgba(224, 107, 107, .45); background-color: rgba(224, 107, 107, .07); opacity: .85; }
.printerCard .pHead { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14.5px; justify-content: space-between; }
.printerCard .pHead .pName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.printerCard .pBody { margin-top: 7px; font-size: 13px; }
.badge.pst-ledig { background: var(--accent-soft); color: var(--accent); }
.badge.pst-igaang { background: var(--warn-soft); color: var(--warn); }
.badge.pst-reperation { background: rgba(90, 170, 255, .15); color: #7cb9ff; }
.badge.pst-ude_drift { background: var(--danger-soft); color: var(--danger); }

/* ---------------- status-meny ---------------- */
.stMenu { position: relative; display: inline-block; }
.stDropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  min-width: 150px;
  display: none;
  background: rgba(22, 27, 35, .95);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  padding: 5px;
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 12px 34px rgba(0, 0, 0, .5);
  display: none;
}
.stMenu.open .stDropdown { display: block; }
.stDropdown.floating { position: fixed; }
.stOpt {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.stOpt:hover { background: rgba(255, 255, 255, .09); }
.stOpt.cur { color: var(--accent); font-weight: 600; }

/* ---------------- foldbar afsluttede ordrer ---------------- */
.finishedSec {
  margin-top: 18px;
  background:
    var(--glass-shine),
    var(--glass);
  background-color: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  overflow: hidden;
}
.finishedSec summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  user-select: none;
  transition: background .15s ease;
}
.finishedSec summary::-webkit-details-marker { display: none; }
.finishedSec summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform .18s ease;
}
.finishedSec[open] summary::after { transform: rotate(180deg); }
.finishedSec summary:hover { background: rgba(255, 255, 255, .05); }
.finishedSec > .tableWrap,
.finishedSec > .empty {
  margin: 0 10px 10px;
}
.finishedSec > .empty { margin-top: 0; }

/* ---------------- sidefod ---------------- */
#appFooter a { color: var(--muted); text-decoration: none; }
#appFooter a:hover { color: var(--text); text-decoration: underline; }

/* handlings-kolonnen (knapper) må ikke klemmes til flere linjer */
@media (min-width: 721px) {
  .tableWrap th:last-child,
  .tableWrap td:last-child { width: 1%; white-space: nowrap; }
  /* datokolonnen må ikke knække over tre linjer */
  #tab-orders .tableWrap td:first-child,
  #tab-dashboard .tableWrap td:first-child,
  #tab-accounting .tableWrap td:first-child { white-space: nowrap; }
}

/* ---------------- desktop-scrollbar ---------------- */
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #3a424f; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- responsivt ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- connector + live printerstatus ---- */
.connectorBox {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.connectorTitle { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.connSteps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.connStep { display: flex; gap: 12px; align-items: flex-start; background: rgba(127, 127, 127, .06); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.connNum { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #2f9e44; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.connStepBody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.connStepBody code { background: rgba(127, 127, 127, .16); padding: 2px 7px; border-radius: 5px; font-size: 12.5px; user-select: all; }
.connBtn { display: inline-block; text-decoration: none; align-self: flex-start; font-size: 14px; padding: 9px 18px; }
.connWait { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted, #666); }
.connDot { width: 9px; height: 9px; border-radius: 50%; background: #fab005; animation: connPulse 1.2s ease-in-out infinite; }
@keyframes connPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.connMore { margin-top: 10px; font-size: 13px; }
.connMore summary { cursor: pointer; color: var(--muted, #666); }
.connMore p { margin: 6px 0 0; }
.connectorKey code { display: inline-block; background: var(--bg, #f5f5f5); padding: 6px 10px; border-radius: 6px; font-size: 13px; user-select: all; }
.connectorKey code + .hint { margin-top: 6px; }
.jobMatch { margin-top: 4px; font-size: 12px; color: #2f9e44; font-weight: 600; word-break: break-all; }
.liveBox { margin-top: 6px; min-width: 240px; }
.liveHead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.liveJob { font-size: 12px; }
.liveBar { height: 8px; background: rgba(127,127,127,.18); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.liveBarFill { height: 100%; background: linear-gradient(90deg, #2f9e44, #69db7c); border-radius: 4px; transition: width .4s ease; }
.liveNums { font-size: 13px; }
.liveHint { font-size: 12px; margin-top: 4px; }

/* ================================================================
   Live-status · kamera · labelscanning (2026-10)
   ================================================================ */

/* ---------------- live-opdatering i topbaren ---------------- */
.liveStatus {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.liveStatus.ok { color: #7ee2b0; border-color: rgba(76, 195, 138, .38); background: rgba(76, 195, 138, .1); }
.liveStatus.warn { color: #f0c877; border-color: rgba(230, 182, 84, .4); background: rgba(230, 182, 84, .1); }
.liveStatus.err { color: #ff9c9c; border-color: rgba(224, 107, 107, .45); background: rgba(224, 107, 107, .12); }

.connStatusLine { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.connState.ok { color: #7ee2b0; font-weight: 650; }
.connState.warn { color: #f0c877; font-weight: 650; }

/* ---------------- kamera i printertabellen ---------------- */
.camCell { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.camThumbBox {
  width: 124px;
  height: 70px;
  border-radius: 12px;
  overflow: hidden;
  background: #05070a;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.camThumbBox.empty { background: rgba(255, 255, 255, .03); }
.camThumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.camThumbIcon { font-size: 22px; opacity: .35; }
.camBtn { padding: 6px 10px !important; font-size: 12px !important; }

/* ---------------- kameradialog ---------------- */
.camDlg { width: min(900px, 96vw); }
.camHead { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.camHead h2 { margin: 0; }
.camLive {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #7ee2b0;
  background: rgba(76, 195, 138, .12);
  border: 1px solid rgba(76, 195, 138, .35);
  padding: 4px 10px;
  border-radius: 999px;
}
.camLive.wait { color: #f0c877; background: rgba(230, 182, 84, .1); border-color: rgba(230, 182, 84, .4); }
.camStage {
  position: relative;
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(76, 195, 138, .08), transparent 70%),
    #05070a;
  border: 1px solid var(--line);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.camStage img { max-width: 100%; max-height: 68vh; width: auto; height: auto; object-fit: contain; display: block; margin: auto; }

/* links, der bruges som sekundærknapper (fx "Åbn i nyt vindue") */
a.secondary {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .055);
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.3;
}
a.secondary:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.camMsg {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #d7dde7;
  background: rgba(5, 7, 10, .82);
}
.camMsg.show { display: flex; }

/* ---------------- labelscanning ---------------- */
.scanRow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(76, 195, 138, .07);
  border: 1px solid rgba(76, 195, 138, .22);
}
.scanRow .hint { margin: 0; flex: 1; min-width: 200px; }
.scanDlg { width: min(760px, 96vw); }
.scanStage {
  position: relative;
  margin-top: 12px;
  border-radius: 18px;
  overflow: hidden;
  background: #05070a;
  border: 1px solid var(--line);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanStage video { width: 100%; max-height: 58vh; object-fit: cover; display: block; }
.scanFrame {
  position: absolute;
  inset: 12% 8%;
  border: 2px dashed rgba(126, 226, 176, .65);
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28);
}
.scanMsg {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  text-align: center;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: #e7edf5;
  background: rgba(5, 7, 10, .78);
  border: 1px solid rgba(255, 255, 255, .14);
}
.scanMsg.ok { color: #7ee2b0; border-color: rgba(76, 195, 138, .4); }
.scanMsg.warn { color: #f0c877; border-color: rgba(230, 182, 84, .42); }
.scanActions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.scanActions button { padding: 9px 14px; font-size: 13px; }
.scanSummary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .03);
  font-size: 13px;
}
.scanSummary .full { grid-column: 1 / -1; }
.scanSummary b { color: var(--text); }

/* tekstfelt i formularer */
form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  color-scheme: dark;
}
form textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .09);
  box-shadow: 0 0 0 3.5px rgba(76, 195, 138, .25);
}
.full { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .liveStatus { margin-left: auto; }
  .camThumbBox { width: 96px; height: 56px; }
  .scanSummary { grid-template-columns: 1fr; }
  .scanActions button { flex: 1 1 45%; }
}

/* ================================================================
   Mobil (telefon og lille tablet)
   To rækker i topbjælken, vandret scrollende faner, tabeller som kort,
   større trykflader og formularer, der ikke zoomer på iPhone.
   ================================================================ */
@media (max-width: 720px) {
  body {
    background-attachment: scroll;
    font-size: 14.5px;
  }

  /* ---- topbjælke: brand + live-status på række 1, faner på række 2 ---- */
  header.topbar {
    gap: 8px 10px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 4px;
  }
  .brand { font-size: 16.5px; gap: 6px; }
  .brand .brandTag { display: none; }
  /* genvejen til Ordre Manager flyttes ned i ☰-menuen på mobil */
  nav.tabs .navShortcut {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(76, 195, 138, .35);
    border-radius: 14px;
    background-color: rgba(76, 195, 138, .12);
    color: #d8ffe9;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
  }
  .brandLogo { width: 24px; height: 24px; }
  .liveStatus {
    font-size: 11.5px;
    padding: 6px 11px;
    gap: 5px;
  }
  /* menu-knap i stedet for faner i toppen — «liquid glass» */
  .navToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-left: 2px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    background:
      linear-gradient(160deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .10)),
      rgba(18, 22, 28, .45);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    color: var(--text);
    font-family: inherit;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .38),
      inset 0 -1px 0 rgba(0, 0, 0, .28),
      0 6px 18px rgba(0, 0, 0, .3);
    transition: border-color .18s ease, transform .12s ease, box-shadow .18s ease;
  }
  .navToggle:active { transform: scale(.94); }
  .navToggle[aria-expanded="true"] {
    border-color: rgba(255, 255, 255, .38);
    background:
      linear-gradient(160deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .08) 55%, rgba(255, 255, 255, .16)),
      rgba(18, 22, 28, .5);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .5),
      inset 0 -1px 0 rgba(0, 0, 0, .3),
      0 8px 22px rgba(0, 0, 0, .38);
  }

  nav.tabs {
    display: none;
    position: fixed;
    top: 64px;
    left: 10px;
    right: 10px;
    bottom: auto;
    margin: 0;
    width: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 9px;
    max-height: min(70dvh, 440px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, .14);
    background:
      linear-gradient(168deg, rgba(255, 255, 255, .19), rgba(255, 255, 255, .05) 42%, rgba(255, 255, 255, .11) 100%),
      rgba(20, 25, 33, .34);
    -webkit-backdrop-filter: blur(34px) saturate(200%) brightness(1.08);
    backdrop-filter: blur(34px) saturate(200%) brightness(1.08);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .42),
      inset 0 16px 30px -20px rgba(255, 255, 255, .5),
      inset 0 -1px 0 rgba(0, 0, 0, .4),
      inset 0 0 24px rgba(255, 255, 255, .06),
      0 26px 60px rgba(0, 0, 0, .5),
      0 3px 12px rgba(0, 0, 0, .32);
    z-index: 60;
    isolation: isolate;
  }
  /* lysende glas-kant (specular rim) */
  nav.tabs::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    background:
      linear-gradient(155deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .14) 26%, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, .34) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    z-index: 3;
  }
  nav.tabs.open,
  nav.tabs:popover-open { display: flex; animation: glassDrop .2s cubic-bezier(.2, .8, .3, 1); }
  /* glans oven på glasset */
  nav.tabs.open::before,
  nav.tabs:popover-open::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
      radial-gradient(120% 70% at 18% -12%, rgba(255, 255, 255, .32), transparent 58%),
      radial-gradient(90% 60% at 100% 4%, rgba(255, 255, 255, .14), transparent 62%),
      linear-gradient(118deg, transparent 34%, rgba(255, 255, 255, .1) 46%, transparent 58%);
    opacity: .85;
    z-index: 0;
  }
  nav.tabs button {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 14px;
    border-radius: 15px;
    border: 1px solid transparent;
    background-color: transparent;
    font-size: 15px;
  }
  nav.tabs button:hover {
    background-color: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .1);
  }
  nav.tabs button:active { background-color: rgba(255, 255, 255, .14); }
  nav.tabs button.active {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .07)),
      rgba(76, 195, 138, .16);
    border-color: rgba(255, 255, 255, .26);
    color: #f2fff9;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .38),
      inset 0 -1px 0 rgba(0, 0, 0, .16),
      0 3px 12px rgba(0, 0, 0, .22);
  }
  nav.tabs #logoutBtn {
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: var(--muted);
  }
  /* uden backdrop-filter: fast baggrund, så teksten stadig kan læses */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    nav.tabs { background-color: #171c23; }
    .navToggle { background-color: #1b212a; }
  }

  /* ---- indhold ---- */
  main { padding: 14px 12px calc(36px + env(safe-area-inset-bottom)); }
  h1 { font-size: 20px; margin: 2px 0 14px; }
  h2 { font-size: 15px; }

  /* ---- nøgletal: to pr. række ---- */
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
  .card { padding: 12px 13px; border-radius: 18px; }
  .card .label { font-size: 10.5px; letter-spacing: .5px; margin-bottom: 4px; }
  .card .value { font-size: 20px; }
  .card .sub { font-size: 11.5px; }
  .card:hover { transform: none; }

  .companyBar { padding: 12px 14px; gap: 12px; }
  .companyLogo { width: 44px; height: 44px; }
  .companyName { font-size: 15.5px; }

  .printerPanel { grid-template-columns: 1fr; gap: 10px; }
  .printerCard { padding: 12px 13px; }
  .printerCard:hover { transform: none; }
  .liveBox { min-width: 0; }

  /* ---- værktøjslinje ---- */
  .toolbar { gap: 8px; margin-bottom: 14px; }
  .toolbar .spacer { display: none; }
  .toolbar > .muted { flex: 1 1 100%; font-size: 12.5px; }
  .toolbar > button, .toolbar > a.primary { flex: 1 1 45%; }
  input.search {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 16px;
    padding: 11px 16px 11px 38px;
  }
  select.search {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 16px;
    padding: 11px 14px;
  }

  /* ---- trykflader ---- */
  button.primary, a.primary, button.secondary, button.danger { min-height: 42px; }
  button.iconBtn {
    min-width: 40px;
    min-height: 36px;
    font-size: 14px;
    padding: 6px 9px;
  }

  /* ---- tabeller som kort ---- */
  .tableWrap {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
  }
  .tableWrap table { min-width: 0; display: block; }
  .tableWrap thead { display: none; }
  .tableWrap tbody { display: block; }
  .tableWrap tbody tr {
    display: block;
    margin-bottom: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background-color: rgba(255, 255, 255, .045);
    background-image: var(--glass-shine);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .18),
      0 4px 16px rgba(0, 0, 0, .28);
  }
  .tableWrap tbody tr:hover { background-color: rgba(255, 255, 255, .06); }
  .tableWrap td {
    display: block;
    padding: 7px 0;
    font-size: 13.5px;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
    overflow-wrap: anywhere;
  }
  .tableWrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
  }
  .tableWrap tbody tr td:last-child { border-bottom: 0; }
  .tableWrap td[data-label=""]::before { display: none; }
  .tableWrap td[data-label=""] {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 10px;
  }
  .tableWrap td.num, .tableWrap th.num { text-align: left; }
  .tableWrap .camCell { flex-direction: row; align-items: center; gap: 10px; }
  .tableWrap .jobMatch { margin-top: 2px; }
  .finishedSec > .tableWrap { margin: 0 10px 4px; }
  .finishedSec summary { padding: 12px 14px; font-size: 14px; }
  .empty { padding: 26px 16px; margin-top: 6px; }

  /* ---- dialoger: scrollbare ark med fast bund ---- */
  .dlg,
  .dlg.small,
  .camDlg,
  .scanDlg {
    width: min(94vw, 640px);
    max-height: calc(100dvh - 20px);
    padding: 18px 16px 0;
    border-radius: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .dlg h2 { font-size: 17px; }
  .dlg .rowEnd {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 14px -16px 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(28, 34, 43, .99) 55%, rgba(28, 34, 43, 0));
  }
  .dlg .rowEnd button, .dlg .rowEnd a.secondary {
    flex: 1 1 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  form label { font-size: 13px; margin-bottom: 12px; }
  form input, form select, form textarea {
    font-size: 16px;
    padding: 12px 13px;
    border-radius: 14px;
  }
  .inline3 { gap: 8px; }
  .inline3 input { flex: 1 1 0; min-width: 0; }
  .inline3 button { flex: 0 0 auto; }

  /* ---- kamera og labelscanning ---- */
  .camHead { flex-wrap: wrap; gap: 8px; }
  .camDlg .rowEnd { flex-wrap: wrap; }
  .dlg.camDlg .rowEnd a.secondary,
  .dlg.camDlg .rowEnd button { flex: 1 1 100%; }
  .camStage { min-height: 200px; border-radius: 14px; }
  .camStage img { max-height: 58dvh; }
  .scanStage { min-height: 220px; border-radius: 14px; }
  .scanStage video { max-height: 50dvh; }
  .scanActions button { min-height: 44px; }
  .scanRow { padding: 10px 12px; gap: 10px; }
  .scanRow .hint { min-width: 0; }

  /* ---- besked ---- */
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    text-align: center;
    transform: translateY(90px);
  }
  .toast.show { transform: translateY(0); }

  footer#appFooter { padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important; }
  footer#appFooter a { display: inline-block; padding: 4px 2px; }
}

/* Bredere telefoner og små tablets: to kolonner i hvert tabelkort */
@media (min-width: 520px) and (max-width: 720px) {
  .tableWrap tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
  }
  .tableWrap td[data-label=""] { grid-column: 1 / -1; }
  .tableWrap .camCell { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 360px) {
  .card .value { font-size: 18.5px; }
  .toolbar > button, .toolbar > a.primary { flex: 1 1 100%; }
  .scanActions button, .dlg .rowEnd button { flex: 1 1 100%; }
}

/* Meget smalle telefoner: kun status-prikken i topbjælken, så den bliver på én række */
@media (max-width: 360px) {
  header.topbar .liveStatus {
    font-size: 0;
    gap: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
  header.topbar .liveStatus::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
  }
}

/* genvej til administration (kun admin) */
.adminLink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background:
    var(--glass-shine),
    rgba(255, 255, 255, .05);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
  transition: background-color .15s ease, border-color .15s ease;
}
.adminLink span { color: var(--muted); font-weight: 500; font-size: 13px; }
.adminLink:hover { background-color: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .24); }

/* ================================================================
   Ordresider, statusknapper og kvitteringer (20261021)
   ================================================================ */
.badge.statusBtn {
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease, background-color .15s ease, border-color .15s ease;
}
.badge.statusBtn:hover { filter: brightness(1.14); transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); }
.badge.statusBtn:active { transform: scale(.96); }
.badge.todo { background: rgba(255, 255, 255, .09); color: #cbd3dd; }
.badge.todo::before { background: #cbd3dd; }
.badge.payBadge.pending::before { background: var(--warn); }
.badge.printBadge.ok::before { background: var(--accent); }
.nowrap { white-space: nowrap; }

.pagesDlg { width: min(620px, 95vw); max-height: 88dvh; overflow-y: auto; }
.pagesDlg h3 { font-size: 14px; margin: 18px 0 8px; }
.pagesDlg .pagesHead { color: var(--text); }
.pageList { display: flex; flex-direction: column; gap: 8px; }
.pageRow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background-color: rgba(255, 255, 255, .04);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.pageRow:hover { background-color: rgba(255, 255, 255, .09); }
.pageRow.active { border-color: rgba(76, 195, 138, .55); background-color: rgba(76, 195, 138, .12); }
.pageRowIcon { font-size: 19px; line-height: 1; }
.pageRowText { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pageRowText .muted { font-size: 12px; }
.pageRowBadge { color: var(--accent); font-weight: 700; font-size: 12px; white-space: nowrap; }
.pageRowGo { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.shareBox {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background-color: rgba(0, 0, 0, .18);
}
.shareBox h3 { margin-top: 0; }
.shareBox h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 16px 0 8px;
}
.shareForm { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.shareForm label { margin: 0; }
.shareMsg:empty { display: none; }
.shareOk { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: #bdf5d7; font-size: 13px; }
.shareWarn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: #ffd7d7; font-size: 13px; line-height: 1.5; }
.shareLink { display: flex; gap: 8px; margin-top: 8px; }
.shareLink input { margin: 0; font-size: 12.5px; }
.shareList { display: flex; flex-direction: column; gap: 6px; }
.shareItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  font-size: 13px;
}
.shareItem > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.shareItem .muted { font-size: 11.5px; }
.shareItem.dim { opacity: .62; }
.shareActions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.inviteCard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid rgba(76, 195, 138, .35);
  background-color: rgba(76, 195, 138, .1);
}
.inviteIcon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background-color: rgba(76, 195, 138, .18);
  font-size: 22px;
  flex: 0 0 auto;
}
.inviteKicker { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.invitePage { font-size: 18px; font-weight: 750; letter-spacing: -.2px; }
#inviteActions { flex-wrap: wrap; }
#inviteActions a { padding: 10px 18px !important; border-radius: 999px !important; }

.receiptList { display: flex; flex-direction: column; gap: 6px; max-height: 40dvh; overflow-y: auto; padding: 4px 2px; }
.receiptRow {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 !important;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.receiptRow input { width: 18px; height: 18px; margin: 0; min-width: 18px; accent-color: #4cc38a; }
.receiptRow.dim { opacity: .6; cursor: default; }
.rOrderMain { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rOrderMain .muted { font-size: 11.5px; }
.receiptTotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background-color: rgba(76, 195, 138, .1);
  border: 1px solid rgba(76, 195, 138, .3);
}
.receiptRecentHead { margin-top: 20px; font-size: 14px; }
.receiptRecent { display: flex; flex-direction: column; gap: 6px; }
.receiptRecentRow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  font-size: 13px;
}
.receiptRecentRow > div:first-child { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.receiptRecentRow .muted { font-size: 11.5px; }

@media (max-width: 720px) {
  .pageChip { max-width: 100%; font-size: 11.5px; padding: 5px 11px; }
  .pageBanner { padding: 8px 12px; font-size: 12px; }
  .pageBanner .pbActions { width: 100%; }
  nav.tabs.open,
  nav.tabs:popover-open {
    background-image: none;
    background-color: #141922;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .shareForm { grid-template-columns: 1fr; }
  .shareForm button { width: 100%; }
  .pagesDlg { width: 96vw; padding: 18px 16px; }
  .receiptList { max-height: 36dvh; }
  .shareItem { flex-wrap: wrap; }
  .shareActions { width: 100%; justify-content: flex-start; }
}

/* ordreliste: metadata under varen + statusknapper på én linje */
.orderMeta { font-size: 11.5px; margin-top: 2px; line-height: 1.35; }
.badge.statusBtn { white-space: nowrap; }
