/* =====================================================================
   2do IT — fælles stylesheet for portal og alle demo-apps.

   Ét stylesheet, ikke ét per app. Divergerer udseendet, ser en bruger
   der skifter mellem to af vores løsninger, to forskellige produkter.

   Portalen er en administrationskonsol: mørk topbar, sidebar med grupper,
   søgestribe og kort i gitter. Apps bruger kun topbar + .wrap/.card, så
   de gamle klasser findes stadig — restylet, ikke fjernet.

   Brandfarver: anker #113A4E petrol, CTA #0E63AE.
   Typografi: Geist til alt (én familie, kontrast via vægt), Geist Mono til
   tokens og nøgler. Skift skrifttype ét sted: --font-sans / --font-mono.
   ===================================================================== */

:root {
  --petrol: #113A4E;
  --petrol-dark: #0C2A38;
  --petrol-soft: #E8EEF1;
  --cta: #0E63AE;
  --cta-hover: #0A4F8C;
  --cta-soft: #E3EDF8;

  --ground: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #14202A;
  --ink-soft: #4A5A66;
  --ink-faint: #7A8B96;
  --rule: #E6EAEE;
  --rule-strong: #CBD3DA;
  --field: #D5DCE2;

  --ok: #2F6F4F;
  --ok-soft: #E6F0EA;
  --warn: #8A6D1F;
  --warn-soft: #F6F0DF;
  --danger: #A14A2E;
  --danger-soft: #F7EAE5;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 32, 42, 0.04);
  --hero: linear-gradient(112deg, #DCEFE7 0%, #D3E6F8 42%, #F7ECD3 100%);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 12px;
}
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a { color: var(--cta); text-decoration: none; font-weight: 500; }
a:hover { color: var(--cta-hover); text-decoration: underline; }
svg { display: block; flex: none; }
strong { font-weight: 600; }

/* ---------- topbar (portal og apps) ---------- */

.topbar {
  background: var(--petrol);
  color: #fff;
  min-height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar .brand {
  display: flex;
  align-items: center;
  margin-right: 10px;
}
.topbar .brand .logo { height: 26px; display: block; }
.topbar .app-name {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}
.topbar .spacer { flex: 1; }
.topbar .who {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.86);
  text-align: right;
  line-height: 1.3;
}
.topbar .who b { display: block; font-weight: 600; color: #fff; }
.topbar a.logout {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 5px 10px;
  border-radius: 6px;
}
.topbar a.logout:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.topbar .ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}
.topbar .ico:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.topbar .ico.on { background: rgba(255, 255, 255, 0.14); color: #fff; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #F0B27A;
  color: var(--petrol-dark);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-left: 6px;
  text-decoration: none;
}
.avatar:hover { text-decoration: none; color: var(--petrol-dark); }
.avatar .dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3CC27A;
  border: 2px solid var(--petrol);
}

/* type-mærkat: gør løsningstypen synlig i fladen (apps) */
.type-badge {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ---------- klassisk layout (apps) ---------- */

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.narrow { max-width: 480px; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.lede { color: var(--ink-soft); margin: 0 0 24px; }

/* ---------- konsol-skal (portal) ---------- */

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 52px minmax(0, 1fr);
  background: var(--surface);
}
.shell .topbar { grid-column: 1 / -1; flex-wrap: nowrap; }

.side {
  background: var(--ground);
  border-right: 1px solid var(--rule);
  padding: 16px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.seg { display: flex; background: var(--rule); border-radius: 999px; padding: 3px; }
.side .seg { margin: 0 4px 18px; }
.seg a, .seg span, .seg button {
  flex: 1;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.seg .on, .seg [aria-selected="true"] { background: var(--petrol); color: #fff; font-weight: 600; }
.seg a:hover { text-decoration: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}
.nav-item:hover { background: #ECEFF2; color: var(--ink); text-decoration: none; }
.nav-item.home { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.nav-item.on { background: #E3E7EC; font-weight: 500; }
.nav-item.home.on { font-weight: 700; }
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--cta-soft);
  color: var(--cta);
  border-radius: 999px;
  padding: 1px 7px;
}
.group { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-weight: 700; font-size: 15px; }
.group-head .chev { margin-left: auto; color: var(--ink-faint); }
.tile {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.group .nav-item { padding-left: 40px; }

.content { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.strip { padding: 12px 24px; border-bottom: 1px solid var(--rule); }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #EEF1F4;
  border-radius: 8px;
  padding: 0 14px;
  height: 40px;
  color: var(--ink-faint);
  font-size: 14px;
  max-width: 570px;
  margin: 0;
}
.search input[type=search] {
  flex: 1;
  order: 2;
  height: 100%;
  border: none;
  background: transparent;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.search input[type=search]::placeholder { color: var(--ink-faint); }
.search svg { order: 1; }

.page { padding: 28px 40px 56px; display: flex; flex-direction: column; gap: 32px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-soft); margin: 6px 0 0; }
.head-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.back { display: inline-block; font-size: 13px; margin-bottom: 8px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--rule); margin-top: -12px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: #F8F9FA;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: -1px;
  text-decoration: none;
}
.tab:hover { color: var(--cta); text-decoration: none; }
.tab.on {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
  border-bottom: 1px solid var(--surface);
  font-weight: 600;
}

.hero {
  border-radius: 14px;
  padding: 44px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  background: var(--hero);
  min-height: 300px;
  overflow: hidden;
}
.hero h2 { font-size: 26px; margin-bottom: 12px; }
.hero p { font-size: 16px; color: #2E3E4A; max-width: 520px; text-wrap: pretty; margin: 0; }
.hero-art { display: flex; justify-content: center; }
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

.section { display: flex; flex-direction: column; gap: 18px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.section-head h2 { margin: 0; }
.section-head p { color: var(--ink-soft); margin: 4px 0 0; }
.cards4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.cards4 .card {
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cards4 .card p { color: var(--ink-soft); font-size: 13.5px; text-wrap: pretty; margin: 0; }
.card .foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { display: flex; align-items: center; gap: 10px; }
.card-title h3 { margin: 0; }
.app-tile {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
  overflow: hidden;
  vertical-align: middle;
}
.app-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-tile.xs { border-radius: 4px; }
.app-tile.lg { border-radius: 14px; font-size: 20px; }
.app-tile.txt { font-weight: 700; font-size: 12px; letter-spacing: -0.02em; }
.app-tile.lg.txt { font-size: 20px; }
.app-tile.soft { color: inherit; }

/* ---------- knapper ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--cta); color: #fff; }
.btn.primary:hover { background: var(--cta-hover); color: #fff; }
.btn.outline { background: var(--surface); border-color: var(--field); color: var(--ink); font-weight: 500; }
.btn.outline:hover { border-color: var(--cta); color: var(--cta); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(0.92); }
.btn.ghost { background: none; color: var(--danger); font-weight: 500; padding: 8px 10px; }
.btn.ghost:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.block { width: 100%; border-radius: 8px; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* klassiske knapper (apps + login) */
button.primary {
  width: 100%;
  background: var(--cta);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { background: var(--cta-hover); }
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }

button.small {
  background: var(--surface);
  border: 1px solid var(--field);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
}
button.small:hover { border-color: var(--cta); color: var(--cta); }
button.small.danger { color: var(--danger); border-color: var(--danger-soft); }
button.small.danger:hover { background: var(--danger-soft); }

/* ---------- mærkater, chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: #EEF1F4; color: var(--ink-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EEF1F4;
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 8px 3px 5px;
  font-size: 12.5px;
  white-space: nowrap;
}
.chip .role { color: var(--cta); font-weight: 600; }
.chip form { display: inline-flex; margin: 0; }
.chip .x {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-faint);
  font: inherit;
  font-weight: 700;
  padding: 0 2px;
  line-height: 1;
}
.chip .x:hover { color: var(--danger); }
.chip.add {
  background: var(--surface);
  border: 1px dashed #C9D2DA;
  color: var(--ink-soft);
  padding: 3px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
}
.chip.add:hover { border-color: var(--cta); color: var(--cta); }

.note {
  background: var(--petrol-soft);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.note strong { color: var(--ink); }
.page > .note { margin-bottom: 0; }

.error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.muted { color: var(--ink-faint); font-size: 12.5px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint); font-weight: 600; margin-bottom: 12px; }

/* ---------- tabeller ---------- */

/* overflow: auto, ikke hidden — en bred tabel skal kunne rulles, ikke klippes. */
.table-card { border: 1px solid var(--rule); border-radius: var(--radius); overflow: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  font-weight: 600;
  background: #F8F9FA;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
}
td { text-align: left; padding: 14px 16px; border-bottom: 1px solid #EEF1F4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: 12px; }
.initials {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex: none;
}
.person .email { color: var(--ink-faint); font-size: 12.5px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-faint); }

/* ---------- formularer ---------- */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=file], select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--field);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  margin-bottom: 16px;
}
input[type=file] { padding: 9px 12px; }
select.inline, input.inline { width: auto; margin: 0; height: 36px; }
input:focus, select:focus { outline: 2px solid var(--cta); outline-offset: 1px; border-color: var(--cta); }

.field { display: flex; flex-direction: column; }
.field input, .field select { margin-bottom: 0; }
.help { color: var(--ink-faint); font-size: 12.5px; margin-top: 6px; line-height: 1.45; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
@media (max-width: 1100px) { .form-layout { grid-template-columns: 1fr; } }
.form-col { display: flex; flex-direction: column; gap: 20px; }
.form-card { margin: 0; display: flex; flex-direction: column; gap: 18px; }
.form-card h2 { font-size: 16px; margin: 0; }
.form-card .muted { margin-top: 4px; }
.form-actions { display: flex; gap: 10px; }
.icon-row { display: flex; align-items: center; gap: 16px; }
.icon-help { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; }
.icon-help input[type=file] { margin: 0; width: auto; }
.icon-help label.btn { margin: 0; }

/* Skjult for øjet, ikke for tastatur og skærmlæser — til filfelter bag en knap. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.btn:has(+ .visually-hidden:focus-visible), label.btn:focus-within { outline: 2px solid var(--cta); outline-offset: 2px; }

.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 36px 14px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}
.opt p { color: var(--ink-soft); font-size: 12.5px; margin: 2px 0 0; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.opt:has(input:checked) { border-color: var(--cta); box-shadow: inset 0 0 0 1px var(--cta); background: #F5F9FD; }
.opt .tick {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cta);
  display: none;
  align-items: center;
  justify-content: center;
}
.opt:has(input:checked) .tick { display: flex; }
.opt:has(input:focus-visible) { outline: 2px solid var(--cta); outline-offset: 2px; }

.preview { position: sticky; top: 24px; }
.preview .card { margin: 0; }
.preview .card.inner { box-shadow: none; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.preview .card.inner p { color: var(--ink-soft); font-size: 13.5px; margin: 0; }

dialog {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px;
  width: min(560px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(17, 58, 78, 0.22);
  color: var(--ink);
}
dialog::backdrop { background: rgba(12, 42, 56, 0.45); }
dialog h2 { font-size: 18px; margin-bottom: 4px; }
dialog .muted { margin-bottom: 18px; display: block; }
dialog .form-actions { margin-top: 8px; }

/* ---------- login og kontosider ---------- */

/* Baggrunden lever: ét stort gradientlag og én blød lysplet driver langsomt
   rundt. Kun transform animeres, så det ligger på compositor-tråden og siden
   ikke tegnes om for hver frame. Slået fra for prefers-reduced-motion. */
.login-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
  background: #DDE9F1;
}
.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}
.login-page::before {
  inset: -60%;
  background:
    radial-gradient(40% 40% at 28% 32%, rgba(14, 99, 174, 0.22), rgba(14, 99, 174, 0) 70%),
    radial-gradient(36% 36% at 74% 68%, rgba(47, 111, 79, 0.18), rgba(47, 111, 79, 0) 70%),
    linear-gradient(118deg, #DCEFE7 0%, #D3E6F8 34%, #F7ECD3 66%, #E3EDF8 100%);
  animation: login-sweep 38s ease-in-out infinite alternate;
}
.login-page::after {
  width: 70vmax;
  height: 70vmax;
  left: 50%;
  top: 50%;
  margin: -35vmax 0 0 -35vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(247, 236, 211, 0.85), rgba(247, 236, 211, 0));
  animation: login-drift 26s ease-in-out infinite alternate;
}
@keyframes login-sweep {
  from { transform: translate3d(-9%, -7%, 0) rotate(0deg); }
  to   { transform: translate3d(9%, 7%, 0) rotate(5deg); }
}
@keyframes login-drift {
  from { transform: translate3d(-22vw, -16vh, 0) scale(0.9); }
  to   { transform: translate3d(22vw, 16vh, 0) scale(1.15); }
}

.login-wrap { width: 100%; max-width: 420px; }
.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 40px 32px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 30px 70px -24px rgba(17, 58, 78, 0.35),
    0 8px 24px -12px rgba(17, 58, 78, 0.15);
  animation: login-rise 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes login-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* Kun mærket, centreret — ordmærket er taget ud af loginkortet. */
.login-card .brand { display: flex; justify-content: center; margin-bottom: 20px; }
.login-card .brand .logo {
  width: 52px;
  height: 52px;
  display: block;
  border-radius: 14px;
  box-shadow: 0 12px 24px -10px rgba(17, 58, 78, 0.55);
}
.login-card h1 { font-size: 22px; text-align: center; margin: 0 0 6px; }
.login-card .sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 26px; text-align: center; }
.login-card .sub strong { color: var(--ink); font-weight: 600; }

/* Faner: lys skinne, den valgte løftes som et hvidt kort. */
.login-card .seg {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.login-card .seg button {
  border-radius: 9px;
  padding: 8px 10px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.login-card .seg [aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 32, 42, 0.08), 0 0 0 1px var(--rule);
}
.login-card .seg button:focus-visible { outline: 2px solid var(--cta); outline-offset: 1px; }
.login-card [role="tabpanel"]:not([hidden]) { animation: login-fade 220ms ease both; }
@keyframes login-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Felter: højere, blødere hjørner, fokusring i stedet for outline. */
.login-card label { color: var(--ink-soft); }
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  height: 46px;
  border-radius: 11px;
  padding: 0 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.login-card input::placeholder { color: var(--ink-faint); opacity: 0.8; }
.login-card input:focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 4px rgba(14, 99, 174, 0.14);
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
}
.pw-toggle:hover { background: var(--ground); color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--cta); outline-offset: 1px; }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .eye-off, .pw-toggle.on .eye { display: none; }
.pw-toggle.on .eye-off { display: block; }

.login-card button.primary {
  height: 46px;
  margin-top: 4px;
  border-radius: 11px;
  font-size: 14.5px;
  box-shadow: 0 10px 22px -10px rgba(14, 99, 174, 0.6);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.login-card button.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -10px rgba(14, 99, 174, 0.65); }
.login-card button.primary:active { transform: translateY(0); box-shadow: 0 6px 14px -8px rgba(14, 99, 174, 0.5); }
.login-card button.primary:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }

/* "or" mellem formularen og Microsoft-knappen. */
.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--ink-faint);
  font-size: 12.5px;
}
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.btn.ms {
  width: 100%;
  height: 46px;
  gap: 10px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--field);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}
.btn.ms:hover { background: var(--ground); border-color: var(--rule-strong); color: var(--ink); transform: translateY(-1px); }
.btn.ms:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }
.btn.ms svg { width: 18px; height: 18px; }

.login-card .center { text-align: center; font-size: 13.5px; margin: 18px 0 0; }
.login-foot { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-soft); }

@media (max-width: 480px) {
  .login-page { padding: 16px; }
  .login-card { padding: 28px 22px 24px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-page::before, .login-page::after, .login-card, .login-card [role="tabpanel"] { animation: none; }
}

.hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.5;
}
.hint summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.hint code {
  background: var(--petrol-soft);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.94em;
}

/* ---------- app-kort (apps' egne sider) ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.app-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 58, 78, 0.12);
  border-color: var(--cta);
  color: inherit;
  text-decoration: none;
}
.app-card h3 { margin-bottom: 6px; }
.app-card .desc { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.app-card .meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 11px;
}
.app-card .role { color: var(--cta); font-weight: 600; }

/* ---------- token-panel ---------- */

/* Viser hvad der FAKTISK står i tokenet. Uden det er "firma kommer fra
   tokenet" en påstand, ikke noget man kan se. */
.token-panel {
  background: var(--petrol);
  color: #cfe0ea;
  border-radius: var(--radius);
  padding: 18px 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}
.token-panel h3 {
  font-family: var(--font-sans);
  color: #fff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.token-panel .k { color: #7FB3D5; }
.token-panel .v { color: #fff; }

/* Syntax colours for the samples (components/Code.tsx): comment, string,
   attribute, number. Keywords reuse .k. Muted enough to read as one block. */
.token-panel.code .c { color: #7D95A3; font-style: italic; }
.token-panel.code .s { color: #A9D8A4; }
.token-panel.code .a { color: #E6C07B; }
.token-panel.code .n { color: #F0B27A; }
details.token summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); margin-bottom: 12px; }

/* ---------- sample code (handshake) ---------- */

/* The long part of the handshake card: the verify contract and the
   copy-paste samples with the solution's own addresses filled in. Each is a
   native <details>, collapsed by default, so the card reads as a short table
   and the developer opens only the sample she needs. The flex column lives on
   an inner body, not on <details> itself: browsers still disagree about
   display on details, and a wrong one shows the closed content. */
.samples { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
details.sample { border-bottom: 1px solid var(--rule); }
details.sample > summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0 14px 22px;
  cursor: pointer;
  list-style: none;
}
details.sample > summary::-webkit-details-marker { display: none; }
details.sample > summary::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 20px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
details.sample[open] > summary::before { transform: rotate(45deg); }
details.sample > summary:hover .sample-title { color: var(--cta); }
.sample-title { font-size: 14px; font-weight: 600; color: var(--ink); }
details.sample > summary .muted { margin: 0; font-size: 13px; }
.sample-body { display: flex; flex-direction: column; gap: 12px; padding: 0 0 18px 22px; }
/* The tab row sits inside a card, so the page-level negative margin is undone. */
.tabs.sample-tabs { margin-top: 4px; }
.sample-code { border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.sample-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  background: #F8F9FA;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.sample-code .token-panel { border-radius: 0; margin: 0; }
button.small.copy { min-width: 72px; }

/* ---------- launch (Open) ---------- */

/* The hand-over behind "Open": the app's tile with a running ring, and the
   grant check as a log that appears line by line. The ring stops and turns
   green when the app is open, red when the portal said no. */
.launch { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.launch-tile { position: relative; width: 72px; height: 72px; margin: 6px 0 14px; }
.launch-tile .app-tile { position: relative; z-index: 1; }
.launch-tile::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 21px;
  background: conic-gradient(from 0deg, transparent 0 55%, var(--cta) 100%);
  animation: launch-ring 1.1s linear infinite;
}
.launch-tile::after { content: ''; position: absolute; inset: -4px; border-radius: 18px; background: var(--surface); }
.launch.done .launch-tile::before { animation: none; background: #2E7D5B; }
.launch.failed .launch-tile::before { animation: none; background: #B42318; }
.launch h2 { margin: 0 0 12px; }
.launch-log { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.launch-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #F8F9FA;
  font-size: 13.5px;
  animation: launch-in 0.3s ease-out;
}
.launch-step.wait { opacity: 0.45; }
.launch-mark { flex: 0 0 10px; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--rule-strong); }
.launch-step.run .launch-mark { background: var(--cta); animation: launch-pulse 1s ease-in-out infinite; }
.launch-step.done .launch-mark { background: #2E7D5B; }
.launch-step.fail .launch-mark { background: #B42318; }
.launch-text { display: flex; flex-direction: column; gap: 2px; }
.launch-detail { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; }
.launch .help { margin-top: 10px; }
.launch-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
@keyframes launch-ring { to { transform: rotate(360deg); } }
@keyframes launch-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes launch-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.55; } }

/* ---------- sign-in activity ---------- */

.activity td.nowrap, .activity th.nowrap { white-space: nowrap; }
.activity td.mono { font-family: var(--font-mono); font-size: 12.5px; }
.activity .help { margin-top: 4px; }
.activity .badge + .muted { margin-left: 6px; }

/* ---------- diverse ---------- */

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr); }
  .side { border-right: none; border-bottom: 1px solid var(--rule); }
  .page { padding: 20px 20px 48px; }
  .grid2, .options { grid-template-columns: 1fr; }
}

/* ---------- brugerfelter: definition (2do) og spørgsmål (bruger) ---------- */

/* Editoren: én boks per felt — label og type på én linje, dropdown-valg
   på linjen under. Samme layout på registreringssiden og i den smalle
   redigeringsdialog, så der ikke skal to gitre til. */
.cf-list { display: flex; flex-direction: column; gap: 10px; }
.cf-row {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cf-main { display: grid; grid-template-columns: minmax(0, 1fr) 150px 42px; gap: 10px; align-items: center; }
.cf-main input, .cf-main select, .cf-options input { margin: 0; }
.cf-options { display: flex; flex-direction: column; }
.cf-x {
  width: 42px;
  height: 42px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-faint);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}
.cf-x:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 520px) { .cf-main { grid-template-columns: minmax(0, 1fr) 42px; } .cf-main select { grid-column: 1 / -1; } }

/* Spørgsmålene i "Open"-dialogen. */
.cf-form { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-bottom: 4px; }

/* Oversigten på løsningssiden. */
.cf-summary { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cf-summary code { margin-left: 6px; }

/* ---------- sidebar: foldbare grupper ---------- */

/* Gruppehovedet er en knap, så det kan foldes med tastatur og skærmlæser;
   den arver skriften og ligner den tekstlinje, den var før. */
button.group-head {
  width: 100%;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
button.group-head:hover { background: rgba(17, 58, 78, 0.06); }
button.group-head:focus-visible { outline: 2px solid var(--cta); outline-offset: 1px; }
.group-head .chev svg { transition: transform 0.15s ease; }
.group.closed .group-head .chev svg { transform: rotate(-90deg); }
.group-body { display: flex; flex-direction: column; gap: 2px; }
.group-body[hidden] { display: none; }
