/* === Base === */
:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #fafbfa;
  --border: #e5e8e6;
  --border-strong: #d1d6d2;
  --text: #0f201c;
  --text-muted: #5b6a66;
  --text-soft: #8a948f;
  --primary: #1f6f5c;
  --primary-600: #195a4a;
  --primary-700: #134539;
  --primary-50: #e8f2ee;
  --primary-100: #d4e7df;
  --accent: #2563eb;
  --green: #16a34a;
  --green-bg: #e6f6ec;
  --yellow: #ca8a04;
  --yellow-bg: #fdf3d7;
  --red: #dc2626;
  --red-bg: #fdecec;
  --blue: #2563eb;
  --blue-bg: #e6efff;
  --gray-bg: #eef0ee;
  --shadow-sm: 0 1px 2px rgba(15,32,28,.05);
  --shadow: 0 1px 3px rgba(15,32,28,.06), 0 4px 14px rgba(15,32,28,.05);
  --shadow-lg: 0 10px 30px rgba(15,32,28,.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
p { margin: 0; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--primary);
  color: white;
  font-weight: 500;
  font-size: 14px;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-600); }
.btn:active { background: var(--primary-700); }
.btn.secondary {
  background: white;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn.secondary:hover { background: var(--surface-2); border-color: var(--text-soft); }
.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn.ghost:hover { background: var(--gray-bg); color: var(--text); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b91c1c; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* === Forms === */
.field { margin-bottom: 16px; }
.field label, .label {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 16px; }
.row > .field { flex: 1; }

/* === Layout: public === */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.brand .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.public-nav .nav-links { display: flex; gap: 28px; }
.public-nav .nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}
.public-nav .nav-links a:hover { color: var(--text); text-decoration: none; }

/* === Hero === */
.hero {
  padding: 90px 48px 70px;
  background: linear-gradient(180deg, #ffffff 0%, #eef4f1 100%);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero h1 {
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero h1 em {
  color: var(--primary);
  font-style: normal;
  background: linear-gradient(120deg, var(--primary) 0%, #2d8c75 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 540px;
}
.hero-cta { display: flex; gap: 12px; align-items: center; }
.hero-meta {
  margin-top: 36px;
  display: flex;
  gap: 32px;
  color: var(--text-muted);
  font-size: 13px;
}
.hero-meta div { display: flex; align-items: center; gap: 8px; }
.hero-meta svg { color: var(--primary); }

.hero-art {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.hero-art .art-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.hero-art .art-head .dots { display: flex; gap: 6px; }
.hero-art .art-head .dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--border-strong);
}
.hero-art .art-title { font-weight: 600; font-size: 13px; color: var(--text-muted); }

/* Process flow visual */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-top: 18px;
}
.flow-step {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-700);
  position: relative;
}
.flow-step .num {
  display: inline-block;
  background: var(--primary);
  color: white;
  width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 50%;
  font-size: 11px;
  margin-bottom: 8px;
  font-weight: 600;
}
.flow-arrow { color: var(--primary); align-self: center; text-align: center; font-size: 18px; }

/* === Sections === */
.section { padding: 80px 48px; }
.section.alt { background: white; }
.section-inner { max-width: 1180px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}
.section-header h2 {
  font-size: 34px;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.section-header p { color: var(--text-muted); font-size: 16px; max-width: 640px; margin: 0 auto; }

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.problem-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.problem-card .icon {
  width: 36px; height: 36px;
  background: var(--red-bg);
  color: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 18px;
}
.problem-card h3 { margin-bottom: 6px; font-size: 15px; }
.problem-card p { color: var(--text-muted); font-size: 13.5px; }

.steps-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.step-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: left;
}
.step-card .step-num {
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
  margin-bottom: 10px;
}
.step-card h4 { margin-bottom: 6px; }
.step-card p { color: var(--text-muted); font-size: 13px; }

.process-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* === Pedagogical "hur" section === */
.subsection-title {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin: 70px 0 12px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.subsection-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 14.5px;
}

.swimlane-wrap { overflow-x: auto; }
.swimlane {
  display: grid;
  grid-template-columns: 140px repeat(5, minmax(150px, 1fr));
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 880px;
}
.swimlane-corner { background: transparent; }
.swimlane-phase {
  background: var(--primary);
  color: white;
  padding: 10px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.swimlane-phase .phase-num {
  background: rgba(255,255,255,.22);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10.5px;
}
.swimlane-role {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 13px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}
.swimlane-role.role-leverantor { border-left-color: var(--blue); }
.swimlane-role.role-revisor { border-left-color: var(--yellow); }
.swimlane-cell {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 12px 10px;
  font-size: 12px;
  color: var(--text-soft);
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.45;
}
.swimlane-cell.energi-active {
  background: var(--primary-50);
  color: var(--primary-700);
  border: 1px solid var(--primary-100);
  font-weight: 500;
}
.swimlane-cell.lev-active {
  background: var(--blue-bg);
  color: #1d3a7a;
  border: 1px solid #cfddff;
  font-weight: 500;
}
.swimlane-cell.rev-active {
  background: var(--yellow-bg);
  color: #7a5119;
  border: 1px solid #f5dfb3;
  font-weight: 500;
}

.role-journeys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 30px;
}
.role-journey {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.role-journey-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.role-journey-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.role-journey.energi .role-journey-icon { background: var(--primary-50); color: var(--primary); }
.role-journey.leverantor .role-journey-icon { background: var(--blue-bg); color: var(--blue); }
.role-journey.revisor .role-journey-icon { background: var(--yellow-bg); color: var(--yellow); }
.role-journey h3 { font-size: 16px; margin-bottom: 2px; }
.role-journey-tagline { font-size: 12.5px; color: var(--text-muted); }
.role-journey-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.role-journey-step {
  display: flex;
  gap: 12px;
  position: relative;
}
.role-journey-step .step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  z-index: 1;
}
.role-journey.energi .step-num { background: var(--primary); }
.role-journey.leverantor .step-num { background: var(--blue); }
.role-journey.revisor .step-num { background: var(--yellow); }
.role-journey-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: -16px;
  width: 1px;
  background: var(--border);
  z-index: 0;
}
.role-journey-step .step-content { flex: 1; padding-top: 1px; }
.role-journey-step .step-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.role-journey-step .step-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.role-journey-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-journey-foot strong { color: var(--text); font-family: 'SF Mono', Menlo, monospace; }
.role-journey-foot svg { color: var(--primary); }
@media (max-width: 1100px) {
  .role-journeys { grid-template-columns: 1fr; }
}
.process-map .pm-step {
  background: white;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 18px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.process-map .pm-step .pm-num {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 11px;
  width: 20px; height: 20px; line-height: 20px;
  border-radius: 50%;
  text-align: center;
  margin-right: 8px;
  font-weight: 600;
}
.process-map .pm-arrow { color: var(--primary); font-size: 18px; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.role-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: white;
  transition: transform .15s, box-shadow .15s;
}
.role-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.role-card .role-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--primary-50);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.role-card h3 { margin-bottom: 8px; }
.role-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.role-card ul { list-style: none; padding: 0; margin: 0; }
.role-card ul li {
  padding: 6px 0;
  color: var(--text);
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 8px;
}
.role-card ul li::before {
  content: "✓";
  color: var(--primary);
  font-weight: 700;
}

.trust-band {
  background: var(--primary);
  color: white;
  padding: 60px 48px;
  text-align: center;
}
.trust-band h2 { color: white; margin-bottom: 14px; font-size: 28px; }
.trust-band p { color: rgba(255,255,255,.85); max-width: 720px; margin: 0 auto 24px; font-size: 15px; }

.cta-band {
  padding: 80px 48px;
  text-align: center;
  background: linear-gradient(180deg, #f5f7f6 0%, #eef4f1 100%);
}
.cta-band h2 { font-size: 32px; margin-bottom: 12px; }
.cta-band p { color: var(--text-muted); font-size: 16px; margin-bottom: 24px; }

footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 30px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* === Login === */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  padding: 60px;
  background: linear-gradient(160deg, #1f6f5c 0%, #134539 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-left .brand { color: white; font-size: 18px; }
.auth-left .brand .brand-mark { background: rgba(255,255,255,.15); }
.auth-left h1 { color: white; font-size: 36px; line-height: 1.15; max-width: 420px; margin: auto 0; }
.auth-left .auth-quote {
  font-size: 14px;
  color: rgba(255,255,255,.75);
  border-left: 3px solid rgba(255,255,255,.3);
  padding-left: 14px;
  max-width: 380px;
}
.auth-right {
  background: white;
  padding: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-card h2 { font-size: 24px; margin-bottom: 8px; }
.auth-card .auth-sub { color: var(--text-muted); margin-bottom: 28px; }
.role-quick {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.role-quick .label { margin-bottom: 12px; color: var(--text-soft); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.role-quick-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-quick-buttons .btn { font-size: 13px; padding: 10px 12px; }

.demo-creds {
  margin-top: 18px;
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--primary-700);
}
.demo-creds code { background: rgba(255,255,255,.5); padding: 1px 6px; border-radius: 3px; font-size: 12px; }

/* === App layout === */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar .sb-brand {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar .role-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-50);
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 8px;
  display: inline-block;
}
.sidebar nav {
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.sidebar nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--primary-50);
  color: var(--primary-700);
}
.sidebar nav a .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar nav a .badge-mini {
  margin-left: auto;
  background: var(--red);
  color: white;
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 7px;
  font-weight: 600;
}
.sidebar .sb-foot {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .sb-foot .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.sidebar .sb-foot .who { font-size: 12.5px; }
.sidebar .sb-foot .who .name { font-weight: 600; color: var(--text); }
.sidebar .sb-foot .who .email { color: var(--text-soft); font-size: 11.5px; }
.sidebar .sb-foot button {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  cursor: pointer;
}
.sidebar .sb-foot button:hover { color: var(--text); }

.section-title {
  padding: 4px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  color: var(--text-soft);
  margin: 14px 0 6px;
}

.main {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
}
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}
.crumbs .sep { color: var(--text-soft); }
.crumbs .current { color: var(--text); font-weight: 500; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search {
  position: relative;
  width: 280px;
}
.search input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.search svg {
  position: absolute;
  left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--text-soft);
}

.content { padding: 28px; flex: 1; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header .ph-meta { color: var(--text-muted); margin-top: 4px; font-size: 14px; }
.page-header .ph-actions { display: flex; gap: 8px; }

/* === Cards / metrics === */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card.flat { box-shadow: none; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h3 { font-size: 15px; }
.card-head .actions { display: flex; gap: 6px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px;
}
.metric .metric-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.metric .metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.metric .metric-value .unit { font-size: 14px; color: var(--text-soft); font-weight: 500; margin-left: 4px; }
.metric .metric-foot {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
}
.metric .delta-up { color: var(--green); font-weight: 600; }
.metric .delta-down { color: var(--red); font-weight: 600; }

.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.split-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

/* === Status badges === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--gray-bg);
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.4;
}
.badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  opacity: .8;
}
.badge.green, .badge.komplett, .badge.godkand, .badge.last { background: var(--green-bg); color: var(--green); }
.badge.yellow, .badge.saknar, .badge.under-komplettering, .badge.behover, .badge.medel { background: var(--yellow-bg); color: var(--yellow); }
.badge.red, .badge.avvikelse, .badge.ej-godkand, .badge.hog { background: var(--red-bg); color: var(--red); }
.badge.blue, .badge.granskning, .badge.under-granskning { background: var(--blue-bg); color: var(--blue); }
.badge.gray { background: var(--gray-bg); color: var(--text-muted); }
.badge.solid {
  background: var(--primary);
  color: white;
}
.badge.solid::before { background: white; }

.priority-1 { color: var(--red); font-weight: 600; }
.priority-2 { color: var(--yellow); font-weight: 600; }
.priority-3 { color: var(--text-muted); font-weight: 500; }

/* === Table === */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 13.5px;
}
.table th {
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr.row-clickable { cursor: pointer; }
.table tr.row-clickable:hover { background: var(--surface-2); }
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--text); font-weight: 500; }
.table a.row-link:hover { color: var(--primary); text-decoration: none; }

/* === Filters === */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all .12s;
}
.chip:hover { border-color: var(--text-soft); }
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === Progress === */
.progress {
  width: 100%;
  height: 6px;
  background: var(--gray-bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .3s;
}
.progress.thick { height: 10px; }
.progress.green .bar { background: var(--green); }
.progress.yellow .bar { background: var(--yellow); }
.progress.red .bar { background: var(--red); }

.kv-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--text-muted); }
.kv-row .v { color: var(--text); font-weight: 500; text-align: right; }

/* === Wizard === */
.wizard-stepper {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 22px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
}
.wizard-step .ws-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-bg);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.wizard-step.active .ws-num {
  background: var(--primary);
  color: white;
}
.wizard-step.done .ws-num {
  background: var(--green);
  color: white;
}
.wizard-step .ws-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.wizard-step.active .ws-label, .wizard-step.done .ws-label { color: var(--text); }
.wizard-step .ws-line {
  flex: 1;
  height: 2px;
  background: var(--border-strong);
  margin: 0 12px;
}
.wizard-step.done .ws-line { background: var(--green); }
.wizard-step:last-child { flex: 0; }

.wizard-body {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}
.wizard-body h2 { margin-bottom: 6px; }
.wizard-body .step-desc { color: var(--text-muted); margin-bottom: 24px; }
.wizard-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

/* === Modal === */
#modal-root .backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 32, 28, .35);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#modal-root .modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
#modal-root .modal.lg { max-width: 760px; }
#modal-root .modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#modal-root .modal-head h2 { font-size: 18px; }
#modal-root .modal-head .close {
  background: transparent; border: 0;
  color: var(--text-soft); cursor: pointer;
  font-size: 22px; line-height: 1;
}
#modal-root .modal-body { padding: 22px 24px; }
#modal-root .modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* === Toast === */
#toast-root {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .25s ease;
  min-width: 240px;
  max-width: 360px;
}
.toast.success { background: var(--primary-700); }
.toast.error { background: var(--red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }

/* === Empty / disclaimer === */
.disclaimer {
  background: var(--blue-bg);
  border: 1px solid #cfddff;
  color: #1d3a7a;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex; gap: 12px;
  align-items: flex-start;
}
.disclaimer.warning {
  background: #fff7e6;
  border-color: #f5dfb3;
  color: #7a5119;
}
.disclaimer .ico {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 1px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: .6;
}

/* === Detail page === */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.tab {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .12s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* === Timeline === */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 18px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary);
}
.timeline-item .ti-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.timeline-item .ti-title { font-size: 13.5px; font-weight: 500; }
.timeline-item .ti-body { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* === Comments === */
.comment {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.comment .c-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}
.comment .c-author { font-weight: 600; color: var(--text); }
.comment .c-time { color: var(--text-soft); }
.comment .c-body { color: var(--text); font-size: 13.5px; }
.comment.from-revisor { background: #fffaf0; border-color: #f5dfb3; }
.comment.from-leverantor { background: #f0f6ff; border-color: #cfddff; }

/* === Checklist === */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.check-item .ci-status {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.check-item.godkand .ci-status { background: var(--green-bg); color: var(--green); }
.check-item.behover .ci-status { background: var(--yellow-bg); color: var(--yellow); }
.check-item.ej .ci-status { background: var(--gray-bg); color: var(--text-muted); }
.check-item .ci-text { flex: 1; font-size: 13.5px; }
.check-item .ci-actions { display: flex; gap: 4px; }
.check-item .ci-actions button {
  padding: 4px 8px;
  font-size: 11.5px;
  border: 1px solid var(--border-strong);
  background: white;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
}
.check-item .ci-actions button:hover { background: var(--surface-2); }
.check-item .ci-actions button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* === Mass balance visual === */
.mb-flow {
  display: grid;
  grid-template-columns: 1fr 60px 1fr 60px 1fr;
  align-items: center;
  gap: 0;
  padding: 30px 10px;
}
.mb-block {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.mb-block .mb-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-700);
}
.mb-block .mb-label {
  font-size: 12.5px;
  color: var(--primary-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 6px;
}
.mb-block .mb-foot {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.mb-arrow {
  text-align: center;
  color: var(--primary);
  font-size: 22px;
  font-weight: 300;
}

/* === Misc === */
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.mt-12 { margin-top: 12px; }
.mt-18 { margin-top: 18px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-18 { margin-bottom: 18px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.no-shrink { flex-shrink: 0; }

/* Responsive */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .steps-list { grid-template-columns: 1fr 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .split, .split-3, .detail-grid { grid-template-columns: 1fr; }
  .mb-flow { grid-template-columns: 1fr; gap: 12px; }
  .mb-arrow { transform: rotate(90deg); }
}
@media (max-width: 760px) {
  .public-nav, .hero, .section, .trust-band, .cta-band, footer { padding-left: 22px; padding-right: 22px; }
  .hero h1 { font-size: 32px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px; }
  .flow-steps, .steps-list { grid-template-columns: 1fr; }
}
