/* ═══════════════════════════════════════════
   Regnly - design system 2026
   Light-first, dark-aware, system type, springs
   ═══════════════════════════════════════════ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

  /* Light palette */
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --inset: #F1EFE9;
  --ink: #17201C;
  --ink-2: #55605A;
  --ink-3: #8A948E;
  --line: rgba(23, 32, 28, 0.08);
  --line-strong: rgba(23, 32, 28, 0.14);

  --accent: #0B6B4F;
  --accent-strong: #095C44;
  --accent-soft: #E3F2EC;
  --accent-ink: #0A5540;

  --amber: #B7791F;
  --amber-soft: #FBF0DC;
  --red: #C0392B;
  --red-soft: #FBE7E4;
  --blue: #2563EB;
  --blue-soft: #E5EDFC;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(23,32,28,.05), 0 2px 8px rgba(23,32,28,.04);
  --shadow-md: 0 2px 6px rgba(23,32,28,.06), 0 10px 28px rgba(23,32,28,.08);
  --shadow-lg: 0 6px 16px rgba(23,32,28,.08), 0 24px 60px rgba(23,32,28,.14);

  --spring: cubic-bezier(.32, .72, 0, 1);          /* critically damped feel */
  --spring-pop: cubic-bezier(.34, 1.3, .5, 1);     /* slight overshoot, momentum only */

  --topbar-h: 64px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #101413;
  --surface: #191E1C;
  --surface-2: #1D2321;
  --inset: #222927;
  --ink: #ECEFEA;
  --ink-2: #A9B3AC;
  --ink-3: #6F7A73;
  --line: rgba(236, 239, 234, 0.08);
  --line-strong: rgba(236, 239, 234, 0.16);

  --accent: #3DB389;
  --accent-strong: #4CC79A;
  --accent-soft: rgba(61, 179, 137, 0.14);
  --accent-ink: #7ADBB8;

  --amber: #E0A94E;
  --amber-soft: rgba(224, 169, 78, 0.14);
  --red: #E2695B;
  --red-soft: rgba(226, 105, 91, 0.14);
  --blue: #6D9EF5;
  --blue-soft: rgba(109, 158, 245, 0.14);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25);
  --shadow-md: 0 2px 6px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.35);
  --shadow-lg: 0 6px 16px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { font: 100%/1.55 var(--font); }

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .45s ease, color .45s ease;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.015em; font-weight: 650; }
h2 { font-size: 1.65rem; letter-spacing: -0.022em; }
h3 { font-size: 1.12rem; }
h4 { font-size: .95rem; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.muted { color: var(--ink-2); }
.small { font-size: .82rem; font-weight: 450; letter-spacing: 0; }

/* ── Layout ─────────────────────────── */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }

.main { min-width: 0; display: flex; flex-direction: column; }

.views { flex: 1; padding: 28px clamp(20px, 4vw, 48px) 64px; max-width: 1240px; width: 100%; margin: 0 auto; }

.view { animation: viewIn .5s var(--spring) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.view-intro { margin-bottom: 26px; max-width: 620px; }
.view-intro p { color: var(--ink-2); margin-top: 6px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

/* ── Sidebar ────────────────────────── */
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #14B98A, #0A5C44);
  box-shadow: 0 4px 12px rgba(11,107,79,.32);
}
.brand-glyph {
  width: 28px; height: 28px;
  fill: none; stroke: #fff; stroke-width: 11;
  stroke-linecap: round; stroke-linejoin: round;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-tag { font-size: .72rem; color: var(--ink-3); }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 520; font-size: .93rem;
  transition: background .18s ease, color .18s ease, transform .1s ease;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { background: var(--inset); color: var(--ink); }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 620; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--amber); color: #fff;
  font-size: .7rem; font-weight: 700; display: grid; place-items: center;
}
.nav-progress { margin-left: auto; font-size: .72rem; font-weight: 650; color: var(--accent); }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.deadline-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--inset); border-radius: 14px; padding: 12px 14px;
}
.deadline-pill strong { display: block; font-size: 1.05rem; letter-spacing: -0.01em; }
.deadline-pill span:last-child { font-size: .72rem; color: var(--ink-3); }
.deadline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.theme-toggle {
  align-self: flex-start; padding: 9px 11px; border-radius: 12px;
  background: var(--inset); transition: transform .12s ease, background .2s ease;
}
.theme-toggle:hover { background: var(--line); }
.theme-toggle:active { transform: scale(.93); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root:not([data-theme="dark"]) .icon-sun { display: none; }

/* ── Topbar ─────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 clamp(20px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 1.02rem; font-weight: 640; letter-spacing: -0.01em; }
.topbar-right { margin-left: auto; }
.menu-btn { display: none; padding: 8px; border-radius: 10px; }
.menu-btn svg { width: 20px; height: 20px; display: block; }

.company-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.company-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: .82rem;
}
.company-avatar.lg { width: 44px; height: 44px; border-radius: 14px; font-size: 1.05rem; }
.company-meta { display: flex; flex-direction: column; line-height: 1.2; }
.company-meta strong { font-size: .82rem; font-weight: 620; }
.company-meta span { font-size: .68rem; color: var(--ink-3); }

/* ── Cards & panels ─────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-inset { background: var(--inset); border-radius: var(--radius); padding: 20px; }

.panel { padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-cta { margin-top: 16px; }
.panel-cta.gap { display: flex; gap: 10px; flex-wrap: wrap; }
.link-btn { color: var(--accent); font-weight: 600; font-size: .88rem; transition: opacity .15s ease; }
.link-btn:hover { opacity: .75; }

/* ── Hero (dashboard) ───────────────── */
.hero-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: stretch; margin-bottom: 20px; }
.eyebrow { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 8px; }
.hero-title { font-size: clamp(1.8rem, 3.2vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.05; }
.hero-sub { color: var(--ink-2); margin-top: 10px; max-width: 46ch; }
.hero-greeting { display: flex; flex-direction: column; justify-content: center; }

.hero-deadline { display: flex; gap: 20px; align-items: center; padding: 22px 24px; }
.hero-deadline-text h3 { font-size: .95rem; margin-bottom: 2px; }
.hero-deadline-text p { font-size: .9rem; }
.hero-deadline-text .muted { font-size: .78rem; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

.ring-wrap { position: relative; width: 108px; height: 108px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--inset); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.2s var(--spring); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center strong { font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1; }
.ring-center span { font-size: .68rem; color: var(--ink-3); }

.law-ref {
  display: inline-block; padding: 1px 7px; border-radius: 6px;
  background: var(--blue-soft); color: var(--blue);
  font-size: .68rem; font-weight: 650; white-space: nowrap;
}

/* ── Stats ──────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; transition: transform .25s var(--spring), box-shadow .25s ease; }
a.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
a.stat:active { transform: translateY(-1px) scale(.99); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-size: .78rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.45rem; letter-spacing: -0.025em; font-weight: 680; }
.stat-foot { font-size: .78rem; color: var(--ink-2); }

.progress-track { height: 6px; border-radius: 3px; background: var(--inset); overflow: hidden; }
.progress-track.lg { height: 10px; border-radius: 5px; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width .8s var(--spring); }

/* ── Checklist ──────────────────────── */
.checklist { list-style: none; display: flex; flex-direction: column; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .step-state {
  width: 26px; height: 26px; border-radius: 50%; flex: none; margin-top: 1px;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: var(--inset); color: var(--ink-3); border: 1.5px solid var(--line-strong);
}
.checklist li.done .step-state { background: var(--accent); border-color: var(--accent); color: #fff; }
.checklist li.current .step-state { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.checklist li strong { font-size: .92rem; font-weight: 600; display: block; }
.checklist li.done strong { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.checklist li p { font-size: .8rem; color: var(--ink-3); }

/* ── Mini bilag list (dashboard) ────── */
.mini-bilag { list-style: none; }
.mini-bilag li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.mini-bilag li:last-child { border-bottom: 0; }
.mini-bilag .thumb { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 1.05rem; background: var(--inset); }
.mini-bilag .meta { min-width: 0; flex: 1; }
.mini-bilag .meta strong { display: block; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bilag .meta span { font-size: .74rem; color: var(--ink-3); }
.mini-bilag .amount { font-weight: 650; font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Compliance ─────────────────────── */
.compliance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.compliance-item { display: flex; gap: 12px; }
.compliance-item strong { font-size: .9rem; }
.compliance-item p { font-size: .8rem; color: var(--ink-2); margin-top: 2px; }
.check-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 2px; position: relative; }
.check-dot.ok { background: var(--accent-soft); }
.check-dot.ok::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); font-size: .78rem; font-weight: 800; }

/* ── Pills & badges ─────────────────── */
.pill { padding: 4px 12px; border-radius: 999px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.pill-green { background: var(--accent-soft); color: var(--accent-ink); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-neutral { background: var(--inset); color: var(--ink-2); }

/* ── Buttons ────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 13px;
  font-weight: 620; font-size: .92rem; letter-spacing: -0.005em;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(11,107,79,.28); }
.btn-primary:hover { background: var(--accent-strong); }
:root[data-theme="dark"] .btn-primary { color: #0d1512; box-shadow: 0 4px 14px rgba(61,179,137,.25); }
.btn-secondary { background: var(--inset); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--line); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--inset); color: var(--ink); }
.btn-ghost.danger { color: var(--red); }
.btn-ghost.danger:hover { background: var(--red-soft); }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; border-radius: 15px; }
.btn-sm { padding: 7px 14px; font-size: .82rem; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

.btn-mitid { background: #0060E6; color: #fff; box-shadow: 0 4px 14px rgba(0,96,230,.3); }
.btn-mitid:hover { background: #0052C7; }
.mitid-icon { width: 20px; height: 20px; }

.link-inline { color: var(--accent); font-weight: 620; text-decoration: underline; text-underline-offset: 2px; }

/* ── Inputs ─────────────────────────── */
.input {
  width: 100%; padding: 11px 14px;
  border-radius: 12px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: .93rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .2s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.num-input { font-variant-numeric: tabular-nums; text-align: right; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 12px; line-height: 1.5; }

/* ── Dropzone ───────────────────────── */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .25s var(--spring);
  margin-bottom: 22px;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.008); }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dropzone-icon {
  width: 54px; height: 54px; border-radius: 16px; margin-bottom: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.dropzone-icon svg { width: 26px; height: 26px; }
.dropzone-inner strong { font-size: 1.05rem; letter-spacing: -0.01em; }
.dropzone-inner span { font-size: .86rem; color: var(--ink-2); }
.dropzone-note { font-size: .74rem !important; color: var(--ink-3) !important; margin-top: 8px; }

/* ── Bilag list ─────────────────────── */
.bilag-toolbar { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--inset); border-radius: 12px; padding: 3px; }
.seg-btn { padding: 7px 16px; border-radius: 9px; font-size: .84rem; font-weight: 600; color: var(--ink-2); transition: all .2s var(--spring); }
.seg-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.search-input { max-width: 280px; }

.bilag-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bilag-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  animation: itemIn .45s var(--spring) both;
  transition: transform .2s var(--spring), box-shadow .2s ease;
}
.bilag-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
@keyframes itemIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.bilag-thumb {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--inset); overflow: hidden;
}
.bilag-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bilag-main { flex: 1; min-width: 0; }
.bilag-main strong { display: block; font-size: .95rem; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bilag-main span { font-size: .78rem; color: var(--ink-3); }
.bilag-cat { flex: none; }
.bilag-amounts { text-align: right; flex: none; }
.bilag-amounts strong { display: block; font-size: .98rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.bilag-amounts span { font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bilag-status { flex: none; width: 110px; display: flex; justify-content: flex-end; }
.bilag-item.processing .bilag-status .pill { position: relative; overflow: hidden; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--amber-soft); border-top-color: var(--amber);
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -2px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-note { text-align: center; color: var(--ink-3); padding: 30px; }

/* ── Ledger ─────────────────────────── */
.ledger-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.ledger-stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.ledger-stat span { font-size: .78rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.ledger-stat strong { font-size: 1.35rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ledger-stat.accent strong { color: var(--accent); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th {
  text-align: left; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line-strong);
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.neg { color: var(--red); }
.table td.pos { color: var(--accent); }
.konto-chip { font-size: .74rem; background: var(--inset); border-radius: 6px; padding: 2px 8px; color: var(--ink-2); white-space: nowrap; }

/* ── Wizard ─────────────────────────── */
.wizard { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
.wizard > * { min-width: 0; }
.wizard-steps { position: sticky; top: calc(var(--topbar-h) + 20px); }
.wizard-steps-head { margin-bottom: 20px; }
.wizard-steps-head p { font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.wizard-steps ol { list-style: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wizard-steps li {
  display: flex; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 13px; cursor: pointer;
  transition: background .2s ease, opacity .2s ease;
  opacity: .55; white-space: nowrap;
}
.wizard-steps li:hover { background: var(--inset); }
.wizard-steps li.reachable { opacity: 1; }
.wizard-steps li.active { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); opacity: 1; }
.wizard-steps li strong { display: block; font-size: .88rem; font-weight: 620; }
.wizard-steps li span:last-child { font-size: .74rem; color: var(--ink-3); }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700;
  background: var(--inset); color: var(--ink-3); border: 1.5px solid var(--line-strong);
  transition: all .25s var(--spring);
}
.wizard-steps li.active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.wizard-steps li.done .step-num { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
:root[data-theme="dark"] .wizard-steps li.active .step-num { color: #0d1512; }

.wizard-body { padding: 30px; min-height: 480px; display: flex; flex-direction: column; }
.wstep { animation: viewIn .4s var(--spring) both; flex: 1; }
.wstep h3 { font-size: 1.3rem; letter-spacing: -0.02em; }
.wstep-sub { color: var(--ink-2); margin: 8px 0 22px; max-width: 62ch; line-height: 1.55; }

.wizard-nav { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.wizard-nav #wPrev { margin-right: auto; }
.wnav-hint { flex: 1; min-width: 0; font-size: .8rem; color: var(--ink-3); text-align: right; line-height: 1.4; animation: viewIn .3s var(--spring) both; }
.wnav-count { font-size: .78rem; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Step 1 - det automatiske */
.auto-list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.auto-list li { display: flex; gap: 14px; align-items: flex-start; }
.auto-ico {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 1.05rem;
  background: var(--inset);
}
.auto-list strong { display: block; font-size: .9rem; font-weight: 620; }
.auto-list p { font-size: .8rem; color: var(--ink-3); margin-top: 1px; line-height: 1.5; }

/* Hero CTA */
.hero-deadline-cta { margin-top: 12px; }

.cvr-lookup { display: flex; gap: 10px; max-width: 440px; }
.cvr-result { margin-top: 18px; }
.cvr-result-head { display: flex; align-items: center; gap: 14px; }
.cvr-result-head .pill { margin-left: auto; }
.cvr-result-head strong { display: block; font-size: 1.02rem; }

.year-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.year-col { background: var(--inset); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.year-col h4 { margin-bottom: 2px; }
.year-col .input { background: var(--surface); }

.klasse-result { margin-top: 20px; }
.klasse-badge-row { display: flex; align-items: center; gap: 16px; }
.klasse-badge {
  width: 62px; height: 62px; border-radius: 18px; flex: none;
  display: grid; place-items: center; font-size: 1.6rem; font-weight: 750;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: #fff;
  box-shadow: 0 6px 16px rgba(11,107,79,.3);
  letter-spacing: -0.02em;
}
:root[data-theme="dark"] .klasse-badge { color: #0d1512; }
.klasse-badge-row h4 { font-size: 1.05rem; }
.klasse-badge-row p { font-size: .84rem; color: var(--ink-2); margin-top: 2px; }
.klasse-facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.klasse-facts .pill-neutral { background: var(--surface); border: 1px solid var(--line-strong); }

/* ── Revision result ────────────────── */
.verdict {
  border-radius: var(--radius-lg); padding: 24px;
  border: 1.5px solid;
  animation: viewIn .4s var(--spring) both;
}
.verdict.ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.verdict.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 32%, transparent); }
.verdict-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.verdict-emoji { font-size: 1.9rem; }
.verdict-head h4 { font-size: 1.12rem; }
.verdict p { font-size: .9rem; line-height: 1.55; color: var(--ink-2); }
.verdict .criteria { list-style: none; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.verdict .criteria li { display: flex; align-items: center; gap: 10px; font-size: .88rem; background: var(--surface); border-radius: 10px; padding: 9px 14px; }
.verdict .criteria .ok-mark { color: var(--accent); font-weight: 800; }
.verdict .criteria .bad-mark { color: var(--red); font-weight: 800; }
.verdict .criteria .val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: .8rem; }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.choice {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius); padding: 16px 18px;
  transition: border-color .18s ease, transform .15s var(--spring), box-shadow .2s ease;
}
.choice:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.choice:active { transform: scale(.985); }
.choice.selected { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.choice strong { display: block; font-size: .95rem; margin-bottom: 3px; }
.choice span { font-size: .8rem; color: var(--ink-2); line-height: 1.45; display: block; }

.callout { border-radius: var(--radius); padding: 14px 18px; font-size: .85rem; line-height: 1.55; margin-top: 14px; }
.callout.warn { background: var(--amber-soft); color: var(--ink); }
.callout.warn strong { color: var(--amber); }

/* ── Financials ─────────────────────── */
.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fin-col { background: var(--inset); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.fin-col .input { background: var(--surface); }
.fin-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 2px 0; border-top: 1px solid var(--line-strong);
  font-size: .88rem; color: var(--ink-2); font-weight: 600;
}
.fin-total strong { font-variant-numeric: tabular-nums; color: var(--ink); font-size: .98rem; }
.fin-total.sub { border-top: 0; padding-top: 0; font-weight: 500; }
.fin-total.grand strong { color: var(--accent); font-size: 1.15rem; }
.fin-total.error strong { color: var(--red); }

/* ── Påtegning / sign ───────────────── */
.paategning p { font-size: .9rem; line-height: 1.6; color: var(--ink-2); margin-top: 10px; }
.paategning h4 { font-size: 1rem; }
.sign-row { margin-top: 20px; }
.signed-chip {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow-sm);
  animation: popIn .5s var(--spring-pop) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.signed-chip strong { display: block; font-size: .9rem; }
.signed-chip span:last-child { font-size: .76rem; color: var(--ink-3); }
.approve-extra { margin-top: 18px; }
.check-row { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; font-size: .9rem; color: var(--ink); cursor: pointer; line-height: 1.5; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; flex: none; }

/* ── Submit ─────────────────────────── */
.submit-summary { margin-bottom: 22px; }
.summary-rows { display: flex; flex-direction: column; }
.summary-rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.summary-rows > div:last-child { border-bottom: 0; }
.summary-rows span { color: var(--ink-3); }
.summary-rows strong { font-variant-numeric: tabular-nums; text-align: right; }

.submit-zone { text-align: center; padding: 20px 0; }
.submit-zone .hint { margin-top: 12px; }
.submit-progress { padding: 30px 0; text-align: center; }
.submit-progress p { margin-top: 14px; color: var(--ink-2); font-size: .92rem; }
.submit-done { text-align: center; padding: 26px 0 10px; animation: viewIn .5s var(--spring) both; }
.done-burst { font-size: 3.2rem; animation: popIn .6s var(--spring-pop) both; }
.submit-done h3 { margin-top: 10px; font-size: 1.4rem; }
.submit-done p { color: var(--ink-2); margin-top: 8px; max-width: 48ch; margin-inline: auto; }
.done-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

/* ── Timeline (frister) ─────────────── */
.timeline { list-style: none; position: relative; padding-left: 6px; }
.timeline::before { content: ""; position: absolute; left: 16px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); border-radius: 1px; }
.timeline li { display: flex; gap: 18px; padding: 14px 0; position: relative; }
.timeline .t-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none; z-index: 1;
  background: var(--surface); border: 2.5px solid var(--line-strong);
  display: grid; place-items: center;
}
.timeline li.done .t-dot { border-color: var(--accent); background: var(--accent); }
.timeline li.done .t-dot::after { content: "✓"; color: #fff; font-size: .62rem; font-weight: 800; }
.timeline li.next .t-dot { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.timeline .t-body strong { display: block; font-size: .95rem; }
.timeline .t-body span { font-size: .8rem; color: var(--ink-3); }
.timeline .t-date { margin-left: auto; font-size: .82rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline li.next .t-date { color: var(--accent); }

.rule-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.rule-list li { display: flex; align-items: center; gap: 12px; background: var(--inset); border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
.rule-num { font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 86px; }

.rule-cards { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.rule-cards strong { font-size: .92rem; }
.rule-cards p { font-size: .82rem; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }

/* ── Settings ───────────────────────── */
.integration-list, .toggle-list { list-style: none; display: flex; flex-direction: column; }
.integration-list li, .toggle-list li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.integration-list li:last-child, .toggle-list li:last-child { border-bottom: 0; }
.int-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--inset); flex: none; }
.int-meta { flex: 1; }
.int-meta strong { display: block; font-size: .92rem; }
.int-meta span { font-size: .78rem; color: var(--ink-3); }
.toggle-list li > div { flex: 1; }
.toggle-list strong { display: block; font-size: .92rem; }
.toggle-list li > div span { font-size: .78rem; color: var(--ink-3); }

.switch { position: relative; width: 46px; height: 28px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 14px;
  background: var(--line-strong); transition: background .25s var(--spring);
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .25s var(--spring);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ── Toasts ─────────────────────────── */
.toast-stack { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: 14px;
  font-size: .9rem; font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: toastIn .45s var(--spring) both;
  display: flex; align-items: center; gap: 10px;
}
.toast.out { animation: toastOut .35s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ── Scrim (mobile nav) ─────────────── */
.scrim { position: fixed; inset: 0; background: rgba(10,14,12,.4); opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 35; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ── Responsive ─────────────────────── */
@media (max-width: 1080px) {
  .stat-grid, .ledger-summary { grid-template-columns: repeat(2, 1fr); }
  .hero-row { grid-template-columns: 1fr; }
  .wizard { grid-template-columns: 1fr; }
  .wizard-steps { position: static; }
  .wizard-steps ol {
    flex-direction: row; overflow-x: auto; padding-bottom: 6px;
    scrollbar-width: none; scroll-snap-type: x proximity;
    mask-image: linear-gradient(90deg, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  }
  .wizard-steps ol::-webkit-scrollbar { display: none; }
  .wizard-steps li { flex: none; scroll-snap-align: start; }
  .wizard-steps li div span { display: none; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
    transform: translateX(-102%);
    transition: transform .35s var(--spring);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: block; }
  .two-col, .form-grid, .year-grid, .fin-grid, .choice-row { grid-template-columns: 1fr; }
  .company-meta span { display: none; }
  .bilag-cat { display: none; }
  .views { padding: 20px 16px 60px; }
  .hero-deadline { flex-direction: row; }
}

@media (max-width: 520px) {
  .stat-grid, .ledger-summary { grid-template-columns: 1fr; }
  .bilag-status { display: none; }
}

/* ── Accessibility ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
