/* ============================================================
   PLAN-B – Systematisk kontinuitetshantering
   v0.1 – 2026-05-07 – Nicklas Rudolfsson
   Design: Refined authority — mörk topbar, skarp typografi,
   professionell och lättnavigerad
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Primärpalett */
  --b-navy:       #0d1f3c;
  --b-blue:       #1a56a0;
  --b-blue-mid:   #2370c8;
  --b-blue-light: #dbeafe;
  --b-blue-xlight:#f0f6ff;

  /* Accentfärger */
  --b-green:       #166534;
  --b-green-light: #dcfce7;
  --b-amber:       #92400e;
  --b-amber-light: #fef3c7;
  --b-red:         #991b1b;
  --b-red-light:   #fee2e2;
  --b-orange:      #c2410c;
  --b-orange-light:#ffedd5;
  --b-purple:      #5b21b6;
  --b-purple-light:#ede9fe;

  /* Neutraler */
  --b-ink:        #0d1f3c;
  --b-ink-soft:   #374151;
  --b-muted:      #6b7280;
  --b-line:       #e5e7eb;
  --b-line-soft:  #f3f4f6;
  --b-bg:         #f8fafc;
  --b-white:      #ffffff;

  /* Typsnitt */
  --f-display: 'DM Serif Display', Georgia, serif;
  --f-body:    'DM Sans', 'Segoe UI', system-ui, sans-serif;

  /* Radier */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Skuggor */
  --s-sm: 0 1px 3px rgba(13,31,60,0.08);
  --s-md: 0 4px 12px rgba(13,31,60,0.10);
  --s-lg: 0 8px 28px rgba(13,31,60,0.13);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--f-body);
  background: var(--b-bg);
  color: var(--b-ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   VIEWS
   ============================================================ */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ============================================================
   STARTSIDA – PLAN-B HERO
   ============================================================ */
.planb-header {
  background: var(--b-navy);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.planb-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.planb-badge {
  background: var(--b-blue-mid);
  color: white;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.15em;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
}
.planb-tagline {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.planb-version {
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.start-hero {
  background: var(--b-navy);
  padding: 72px 40px 64px;
  position: relative;
  overflow: hidden;
}
.start-hero::before {
  content: 'B';
  position: absolute;
  right: -20px;
  top: -40px;
  font-family: var(--f-display);
  font-size: 320px;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; z-index: 1; }
.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--b-blue-mid);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--f-display);
  font-size: clamp(44px, 6vw, 72px);
  color: white;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-title span {
  color: var(--b-blue-mid);
  font-style: italic;
}
.hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 40px;
  font-weight: 300;
}
.hero-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flow-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 18px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.01em;
}
.flow-pill-num {
  background: var(--b-blue-mid);
  color: white;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flow-sep { color: rgba(255,255,255,0.2); font-size: 18px; }

/* Start main */
.start-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}
.start-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 800px) { .start-grid { grid-template-columns: 1fr; } }

.start-section-title {
  font-family: var(--f-display);
  font-size: 26px;
  color: var(--b-navy);
  margin-bottom: 8px;
}
.start-section-sub {
  font-size: 14px;
  color: var(--b-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Ny workshop-formulär */
.new-form { display: flex; flex-direction: column; gap: 12px; }
.new-form-row { display: flex; gap: 8px; }
.new-form-row input { flex: 1; }
.new-hint { font-size: 13px; color: var(--b-red); min-height: 18px; }

/* Workshop-lista */
.workshop-list { display: flex; flex-direction: column; gap: 10px; }
.workshop-card {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--s-sm);
}
.workshop-card:hover {
  border-color: var(--b-blue-mid);
  box-shadow: var(--s-md);
  transform: translateY(-1px);
}
.wc-left { flex: 1; min-width: 0; }
.wc-name {
  font-family: var(--f-display);
  font-size: 19px;
  color: var(--b-navy);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wc-meta {
  font-size: 12px;
  color: var(--b-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.wc-meta-item { display: flex; align-items: center; gap: 4px; }
.wc-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wc-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.wc-status.workshop        { background: var(--b-blue-light);   color: var(--b-blue); }
.wc-status.handlingsplan   { background: var(--b-amber-light);  color: var(--b-amber); }
.wc-status.kontinuitetsplan{ background: var(--b-purple-light); color: var(--b-purple); }
.wc-status.klar            { background: var(--b-green-light);  color: var(--b-green); }

.wc-delete {
  background: transparent;
  border: 1px solid var(--b-line);
  color: var(--b-muted);
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.wc-delete:hover { background: var(--b-red-light); border-color: var(--b-red); color: var(--b-red); }
.wc-delete svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ============================================================
   TOPBAR – Workshop-vy
   ============================================================ */
.topbar {
  background: var(--b-navy);
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(13,31,60,0.3);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-back {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.75);
  padding: 7px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.topbar-back:hover { background: rgba(255,255,255,0.08); color: white; }
.topbar-back svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5; fill: none; }

.topbar-info { flex: 1; min-width: 0; }
.topbar-title {
  font-family: var(--f-display);
  font-size: 18px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.save-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  flex-shrink: 0;
}
.save-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s;
}
.save-indicator.saving .save-dot  { background: #fbbf24; }
.save-indicator.saved  .save-dot  { background: #4ade80; }
.save-indicator.error  .save-dot  { background: #f87171; }
.save-indicator.saving .save-text { color: #fbbf24; }
.save-indicator.saved  .save-text { color: #4ade80; }
.save-indicator.error  .save-text { color: #f87171; }

/* ============================================================
   STEG-NAVIGATION
   ============================================================ */
.step-nav {
  background: var(--b-white);
  border-bottom: 1px solid var(--b-line);
  position: sticky;
  top: 56px;
  z-index: 190;
  overflow-x: auto;
}
.step-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
}
.step-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 13px 18px 10px;
  cursor: pointer;
  font-family: var(--f-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s;
  white-space: nowrap;
  min-width: 88px;
}
.step-btn:hover:not(.active) { background: var(--b-bg); }
.step-btn.active { border-bottom-color: var(--b-blue-mid); }
.step-n {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--b-muted);
  text-transform: uppercase;
}
.step-btn.active .step-n { color: var(--b-blue-mid); }
.step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--b-ink-soft);
}
.step-btn.active .step-label { color: var(--b-navy); }
.step-btn.done .step-n::after { content: ' ✓'; color: var(--b-green); }
.step-btn--out .step-n { color: var(--b-orange); }
.step-btn--out.active { border-bottom-color: var(--b-orange); }
.step-btn--out.active .step-n { color: var(--b-orange); }
.step-sep { width: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.step-sep::after { content: '›'; color: var(--b-line); font-size: 18px; }
.step-sep--gap::after { content: '···'; color: var(--b-line); font-size: 12px; letter-spacing: 3px; }

/* ============================================================
   WORKSHOP MAIN
   ============================================================ */
.workshop-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeUp 0.22s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Panel header */
.panel-header { margin-bottom: 36px; }
.panel-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--b-blue-mid);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.panel-header h2 {
  font-family: var(--f-display);
  font-size: 36px;
  color: var(--b-navy);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.1;
}
.panel-desc {
  font-size: 15px;
  color: var(--b-muted);
  max-width: 600px;
  line-height: 1.65;
}

/* ============================================================
   FORMULÄRELEMENT
   ============================================================ */
.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--b-ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field-hint { font-size: 12px; color: var(--b-muted); margin-bottom: 6px; line-height: 1.4; }

input[type="text"], input[type="tel"], input[type="email"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--b-line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--b-ink);
  background: var(--b-white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--b-blue-mid);
  box-shadow: 0 0 0 3px rgba(35,112,200,0.12);
}
textarea { resize: vertical; min-height: 80px; }
input::placeholder, textarea::placeholder { color: #c4c9d4; }

/* ============================================================
   KNAPPAR
   ============================================================ */
.btn-primary {
  background: var(--b-blue-mid);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { background: var(--b-blue); transform: translateY(-1px); }
.btn-secondary {
  background: var(--b-white);
  color: var(--b-blue-mid);
  border: 1px solid var(--b-blue-mid);
  padding: 9px 20px;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary:hover { background: var(--b-blue-xlight); }
.btn-ghost {
  background: transparent;
  border: 1px dashed var(--b-line);
  color: var(--b-muted);
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--b-blue-mid); color: var(--b-blue-mid); background: var(--b-blue-xlight); }
.btn-danger-sm {
  background: transparent;
  border: none;
  color: var(--b-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: all 0.15s;
  display: flex;
  align-items: center;
}
.btn-danger-sm:hover { color: var(--b-red); background: var(--b-red-light); }
.btn-danger-sm svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

.btn-export {
  background: var(--b-navy);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-export:hover { background: var(--b-blue); }
.btn-export svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  box-shadow: var(--s-sm);
  transition: box-shadow 0.15s;
}
.card:focus-within { box-shadow: var(--s-md); }

/* ============================================================
   STEG 1 – AKTIVITETER
   ============================================================ */
.akt-row {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-left: 3px solid var(--b-blue-mid);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-left-color 0.15s;
}
.akt-row:focus-within { border-left-color: var(--b-navy); }
.akt-row.over-limit { border-left-color: var(--b-amber); }
.akt-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--b-blue-mid);
  letter-spacing: 0.1em;
  min-width: 28px;
  text-align: center;
}
.akt-num.over { color: var(--b-amber); }
.akt-row input {
  flex: 1;
  border: none;
  box-shadow: none;
  padding: 4px 0;
  font-family: var(--f-display);
  font-size: 17px;
  color: var(--b-ink);
  background: transparent;
}
.akt-row input:focus { border: none; box-shadow: none; outline: none; }
.limit-notice {
  background: var(--b-amber-light);
  border: 1px solid rgba(146,64,14,0.25);
  border-radius: var(--r-sm);
  padding: 11px 16px;
  font-size: 13px;
  color: var(--b-amber);
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}
.limit-notice.show { display: block; }

/* ============================================================
   STEG 2 – KONSEKVENSER
   ============================================================ */
.kons-block {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--s-sm);
}
.kons-head {
  background: var(--b-navy);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kons-head-title {
  font-family: var(--f-display);
  font-size: 19px;
  color: white;
}
.kons-head-num { font-size: 11px; color: rgba(255,255,255,0.45); letter-spacing: 0.12em; }
.kons-body { padding: 22px; }

.bed-row { display: flex; gap: 6px; }
.bed-btn {
  flex: 1;
  padding: 10px 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b-line);
  background: var(--b-white);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 700;
  transition: all 0.12s;
  color: var(--b-muted);
}
.bed-btn:hover { border-color: var(--b-blue-mid); color: var(--b-blue-mid); }
.bed-btn.s1 { background: #dcfce7; border-color: #166534; color: #166534; }
.bed-btn.s2 { background: #d1fae5; border-color: #065f46; color: #065f46; }
.bed-btn.s3 { background: var(--b-amber-light); border-color: #d97706; color: #d97706; }
.bed-btn.s4 { background: var(--b-orange-light); border-color: var(--b-orange); color: var(--b-orange); }
.bed-btn.s5 { background: var(--b-red-light); border-color: var(--b-red); color: var(--b-red); }

/* ============================================================
   STEG 3 – BEROENDEN
   ============================================================ */
.ber-block {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--s-sm);
}
.ber-head {
  background: var(--b-navy);
  padding: 14px 22px;
}
.ber-head-title { font-family: var(--f-display); font-size: 19px; color: white; }
.ber-body { padding: 18px 22px; }
.ber-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding: 12px;
  background: var(--b-bg);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: border-color 0.15s;
}
.ber-item:focus-within { border-color: var(--b-blue-mid); background: var(--b-blue-xlight); }
.ber-kat { flex: 0 0 150px; }
.ber-kat select { font-size: 13px; }
.ber-text { flex: 1; }
.yn-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.yn-label { font-size: 12px; font-weight: 600; color: var(--b-muted); }
.yn-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--b-line);
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.12s;
  color: var(--b-muted);
}
.yn-btn:hover { border-color: var(--b-blue-mid); }
.yn-btn.yes.sel { background: var(--b-green-light); border-color: var(--b-green); color: var(--b-green); }
.yn-btn.no.sel  { background: var(--b-red-light);   border-color: var(--b-red);   color: var(--b-red); }

/* Kategori-accentfärger */
.kat-it_system     { border-left: 3px solid var(--b-blue-mid) !important; }
.kat-personal      { border-left: 3px solid var(--b-green) !important; }
.kat-lokaler       { border-left: 3px solid var(--b-orange) !important; }
.kat-el_kraft      { border-left: 3px solid #d97706 !important; }
.kat-kommunikation { border-left: 3px solid var(--b-purple) !important; }
.kat-externa       { border-left: 3px solid var(--b-red) !important; }
.kat-ovrigt        { border-left: 3px solid var(--b-muted) !important; }

/* ============================================================
   STEG 4 – ÅTGÄRDER
   ============================================================ */
.tva-kol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 860px) { .tva-kol { grid-template-columns: 1fr; } }
.kol-title {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--b-navy);
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--b-blue-xlight);
}
.atg-item, .res-item {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--s-sm);
}
.atg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.status-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}
.sp-ej_paborjad { background: var(--b-line-soft); color: var(--b-muted); }
.sp-pagaende    { background: var(--b-amber-light); color: var(--b-amber); }
.sp-klar        { background: var(--b-green-light); color: var(--b-green); }

/* ============================================================
   STEG 5 – SAMMANFATTNING
   ============================================================ */
.sum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.sum-card {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--s-sm);
}
.sum-card-head {
  padding: 12px 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sum-card-head.navy   { background: var(--b-navy);   color: white; }
.sum-card-head.blue   { background: var(--b-blue-mid); color: white; }
.sum-card-head.orange { background: var(--b-orange);  color: white; }
.sum-card-head.green  { background: var(--b-green);   color: white; }
.sum-card-body { padding: 16px 18px; font-size: 14px; }

.topp5-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.topp5-tbl th {
  background: var(--b-bg);
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--b-muted);
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--b-line);
}
.topp5-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--b-line-soft); }
.topp5-tbl tr:last-child td { border-bottom: none; }
.rank-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--b-navy);
  color: white;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   HANDLINGSPLAN & KONTINUITETSPLAN – OUTPUT
   ============================================================ */
.output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  padding: 16px 20px;
  background: var(--b-navy);
  border-radius: var(--r-md);
}
.output-toolbar-left { font-size: 13px; color: rgba(255,255,255,0.65); }
.output-toolbar-left strong { color: white; display: block; font-size: 15px; margin-bottom: 2px; }
.output-toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; }

.plan-section {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--s-sm);
}
.plan-sec-head {
  background: var(--b-bg);
  border-bottom: 2px solid var(--b-blue-mid);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.plan-sec-letter {
  background: var(--b-navy);
  color: white;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.plan-sec-title {
  font-family: var(--f-display);
  font-size: 18px;
  color: var(--b-navy);
}
.plan-sec-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--b-green-light);
  color: var(--b-green);
  padding: 3px 9px;
  border-radius: 20px;
}
.plan-sec-body { padding: 20px; }

.plan-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan-tbl th {
  background: var(--b-bg);
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--b-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--b-line);
}
.plan-tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--b-line-soft);
  vertical-align: top;
}
.plan-tbl tr:last-child td { border-bottom: none; }
.plan-tbl td input, .plan-tbl td select, .plan-tbl td textarea {
  font-size: 13px;
  padding: 7px 10px;
}

/* Lägga-till-rad-knappar i tabeller */
.tbl-add-row {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--b-line);
  color: var(--b-muted);
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--f-body);
  margin-top: 4px;
  border-radius: var(--r-sm);
}
.tbl-add-row:hover { border-color: var(--b-blue-mid); color: var(--b-blue-mid); background: var(--b-blue-xlight); }

/* Info-ruta för låsta avsnitt */
.locked-notice {
  background: var(--b-green-light);
  border: 1px solid rgba(22,101,52,0.2);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--b-green);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ============================================================
   PANEL NAVIGATION FOOTER
   ============================================================ */
.panel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--b-line);
  flex-wrap: wrap;
  gap: 12px;
}
.panel-nav-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.chip-blue   { background: var(--b-blue-light); color: var(--b-blue); }
.chip-green  { background: var(--b-green-light); color: var(--b-green); }
.chip-red    { background: var(--b-red-light); color: var(--b-red); }
.chip-amber  { background: var(--b-amber-light); color: var(--b-amber); }
.chip-grey   { background: var(--b-line-soft); color: var(--b-muted); }

.notice {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid;
}
.notice-info   { background: var(--b-blue-xlight); border-color: rgba(35,112,200,0.25); color: var(--b-blue); }
.notice-warn   { background: var(--b-amber-light);  border-color: rgba(146,64,14,0.25);  color: var(--b-amber); }
.notice-ok     { background: var(--b-green-light);  border-color: rgba(22,101,52,0.25);  color: var(--b-green); }
.notice-error  { background: var(--b-red-light);    border-color: rgba(153,27,27,0.25);  color: var(--b-red); }

.loading-state { color: var(--b-muted); font-style: italic; padding: 20px 0; font-size: 14px; }
.empty-state   { text-align: center; padding: 40px 20px; color: var(--b-muted); font-size: 14px; }

hr.divider { border: none; border-top: 1px solid var(--b-line); margin: 20px 0; }

/* PLAN-B footer */
.planb-footer {
  text-align: center;
  padding: 32px;
  color: var(--b-muted);
  font-size: 12px;
  border-top: 1px solid var(--b-line);
  margin-top: 60px;
}
.planb-footer strong { color: var(--b-navy); }

/* Print-optimering för export */
@media print {
  .topbar, .step-nav, .panel-nav, .output-toolbar { display: none !important; }
  .workshop-main { padding: 0; }
  .plan-section { box-shadow: none; break-inside: avoid; }
}

/* ============================================================
   INLOGGNING
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--b-navy);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: 'B';
  position: absolute;
  right: -60px; bottom: -80px;
  font-family: var(--f-display);
  font-size: 500px;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  pointer-events: none;
}
.login-box {
  background: var(--b-white);
  border-radius: var(--r-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--s-lg);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.3s ease;
}
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-badge {
  display: inline-block;
  background: var(--b-navy);
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2em;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.login-title {
  font-family: var(--f-display);
  font-size: 26px;
  color: var(--b-navy);
  margin-bottom: 4px;
}
.login-sub { font-size: 13px; color: var(--b-muted); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error {
  background: var(--b-red-light);
  border: 1px solid rgba(153,27,27,0.25);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--b-red);
  font-weight: 600;
  display: none;
}
.login-error.show { display: block; }
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--b-muted);
}

/* Tvingat lösenordsbyte */
.pw-change-box {
  background: var(--b-amber-light);
  border: 1px solid rgba(146,64,14,0.25);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 24px;
}
.pw-change-box strong { color: var(--b-amber); display: block; margin-bottom: 6px; }
.pw-change-box p { font-size: 13px; color: var(--b-amber); }

/* Inloggad användare i topbar */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-user-name {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
.topbar-user-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  padding: 3px 8px;
  border-radius: 20px;
}
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.65);
  padding: 5px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.08); color: white; }

/* Admin-panel */
.admin-panel {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--s-sm);
}
.admin-panel-head {
  background: var(--b-navy);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-panel-title { font-family: var(--f-display); font-size: 18px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  background: var(--b-bg);
  padding: 8px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--b-muted);
  border-bottom: 1px solid var(--b-line);
}
.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--b-line-soft); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.roll-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
}
.rb-admin       { background: var(--b-navy); color: white; }
.rb-handlaggare { background: var(--b-blue-light); color: var(--b-blue); }
.rb-ansvarig    { background: var(--b-purple-light); color: var(--b-purple); }
.rb-anvandare   { background: var(--b-line-soft); color: var(--b-muted); }

/* Ny-användare-formulär */
.ny-anvandare-form {
  padding: 20px;
  background: var(--b-bg);
  border-top: 1px solid var(--b-line);
}
.ny-anvandare-form h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--b-navy);
  margin-bottom: 14px;
}

/* ============================================================
   REVISIONSLOGG
   ============================================================ */
.logg-wrap {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--b-line);
}
.logg-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--b-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.logg-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--b-line-soft);
  font-size: 13px;
}
.logg-item:last-child { border-bottom: none; }
.logg-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--b-blue-mid);
  flex-shrink: 0;
  margin-top: 5px;
}
.logg-content { flex: 1; }
.logg-handelse { font-weight: 600; color: var(--b-ink); }
.logg-detalj   { color: var(--b-muted); font-size: 12px; }
.logg-meta     { font-size: 11px; color: var(--b-muted); margin-top: 2px; }

/* ============================================================
   AGENT-BANNER
   ============================================================ */
.agent-banner {
  background: linear-gradient(135deg, var(--b-navy) 0%, var(--b-blue) 100%);
  border-radius: var(--r-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.agent-banner-left { display: flex; align-items: center; gap: 14px; }
.agent-icon {
  background: rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.agent-text strong { display: block; color: white; font-size: 15px; margin-bottom: 2px; }
.agent-text span   { color: rgba(255,255,255,0.65); font-size: 13px; }
.agent-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.agent-btn:hover { background: rgba(255,255,255,0.25); }

/* ============================================================
   INSTÄLLNINGAR (admin)
   ============================================================ */
.settings-panel {
  background: var(--b-white);
  border: 1px solid var(--b-line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--s-sm);
}
.settings-head {
  background: var(--b-bg);
  border-bottom: 1px solid var(--b-line);
  padding: 14px 20px;
  font-weight: 700;
  color: var(--b-navy);
  font-size: 15px;
}
.settings-body { padding: 20px; }

/* ============================================================
   LÄSLÄGE (anvandare-roll)
   ============================================================ */
.readonly-banner {
  background: var(--b-amber-light);
  border: 1px solid rgba(146,64,14,0.2);
  border-radius: var(--r-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--b-amber);
  font-weight: 600;
  margin-bottom: 20px;
}

/* ============================================================
   FEEDBACK / KONTAKT
   ============================================================ */
.feedback-bar {
  background: var(--b-white);
  border-top: 1px solid var(--b-line);
  padding: 12px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--b-muted);
  width: 100%;
  clear: both;
}
.feedback-bar a { color: var(--b-blue-mid); text-decoration: none; font-weight: 600; }
.feedback-bar a:hover { text-decoration: underline; }

/* ============================================================
   MOBILANPASSNING
   ============================================================ */
@media (max-width: 640px) {
  .planb-header    { padding: 0 16px; }
  .start-hero      { padding: 40px 16px 36px; }
  .start-body      { padding: 24px 16px 48px; }
  .hero-title      { font-size: 36px; }
  .hero-flow       { gap: 6px; }
  .flow-pill       { font-size: 12px; padding: 7px 12px; }
  .step-nav-inner  { padding: 0 8px; }
  .step-btn        { min-width: 68px; padding: 10px 10px 8px; }
  .step-label      { font-size: 11px; }
  .workshop-main   { padding: 20px 14px 48px; }
  .panel-header h2 { font-size: 26px; }
  .tva-kol         { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .output-toolbar  { flex-direction: column; align-items: flex-start; }
  .topbar-inner    { padding: 0 12px; gap: 10px; }
  .topbar-user-name{ display: none; }
  .admin-panel     { overflow-x: auto; }
  .admin-table     { min-width: 600px; }
  .start-grid      { grid-template-columns: 1fr; gap: 32px; }
  .atg-grid        { grid-template-columns: 1fr; }
  .kons-body       { padding: 14px; }
  .plan-sec-body   { padding: 14px; }
  .sum-grid        { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .login-box  { padding: 32px 20px; }
  .hero-title { font-size: 30px; }
  .flow-sep   { display: none; }
}

/* ============================================================
   HEADER – höger sida
   ============================================================ */
.planb-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   AGENT-BANNER – full bredd under hero
   ============================================================ */
#agent-banner-wrap {
  background: var(--b-navy);
}
#agent-banner-wrap .agent-banner {
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 0;
  padding: 16px 40px;
  background: transparent;
}

/* ============================================================
   FLIKAR – Startsida
   ============================================================ */
.start-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--b-line);
}
.start-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 12px 22px 10px;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--b-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.start-tab:hover {
  color: var(--b-navy);
  background: var(--b-line-soft);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.start-tab.active {
  color: var(--b-navy);
  border-bottom-color: var(--b-blue-mid);
}

.start-tab-content { display: none; animation: fadeUp 0.2s ease; }
.start-tab-content.active { display: block; }

.tab-section-head { margin-bottom: 24px; }
.tab-section-head h2 {
  font-family: var(--f-display);
  font-size: 26px;
  color: var(--b-navy);
  margin-bottom: 6px;
}
.tab-section-head p {
  font-size: 14px;
  color: var(--b-muted);
  max-width: 680px;
  line-height: 1.6;
}

/* ============================================================
   MOBIL – tillägg
   ============================================================ */
@media (max-width: 640px) {
  .start-tabs    { overflow-x: auto; padding-bottom: 2px; }
  .start-tab     { padding: 10px 14px; font-size: 12px; }
  .planb-header-right { gap: 4px; }
  .topbar-user-name { display: none; }
  #agent-banner-wrap .agent-banner { padding: 14px 16px; }
}

/* ============================================================
   ORGANISATIONSTRÄD
   ============================================================ */
.trad-wrap { padding: 8px 0; }

.nod-item {
  margin-left: calc(var(--djup, 0) * 24px);
  border-left: 2px solid var(--b-line);
  margin-left: calc(var(--djup, 0) * 0px);
}
.nod-item[style*="--djup:0"] { border-left: none; }

.nod-item-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--b-line-soft);
  transition: background 0.12s;
}
.nod-item-inner:hover { background: var(--b-bg); }

.nod-children {
  border-left: 2px solid var(--b-blue-light);
  margin-left: 32px;
}

.nod-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nod-niva-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.nod-namn {
  font-weight: 700;
  font-size: 15px;
  color: var(--b-navy);
}
.nod-beskr {
  font-size: 12px;
  color: var(--b-muted);
}
.nod-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.trad-form {
  border-top: 2px solid var(--b-line);
  padding: 20px 20px 24px;
  background: var(--b-bg);
}
.trad-form-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--b-navy);
  margin-bottom: 16px;
}

/* ============================================================
   INSTÄLLNINGAR
   ============================================================ */
.settings-section {
  padding: 20px 20px 0;
}
.settings-section + .settings-section {
  padding-top: 20px;
  border-top: 1px solid var(--b-line);
}
.settings-section-title {
  font-family: var(--f-display);
  font-size: 18px;
  color: var(--b-navy);
  margin-bottom: 8px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,31,60,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: white;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(13,31,60,0.3);
  animation: fadeUp 0.2s ease;
}
.modal-head {
  background: var(--b-navy);
  padding: 20px 24px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: sticky;
  top: 0;
}
.modal-title {
  font-family: var(--f-display);
  font-size: 20px;
  color: white;
}
.modal-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: white; }
.modal-body { padding: 20px 24px; }
.modal-add-section {
  border-top: 1px solid var(--b-line);
  margin-top: 20px;
  padding-top: 20px;
}
.modal-anv-rad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--b-line-soft);
}
.modal-anv-rad:last-child { border-bottom: none; }

/* ============================================================
   TOAST
   ============================================================ */
.planb-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 99999;
  animation: toastIn 0.25s ease;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.planb-toast.ok  { background: var(--b-green); color: white; }
.planb-toast.err { background: var(--b-red);   color: white; }

/* ============================================================
   EXTRA MOBIL
   ============================================================ */
@media (max-width: 640px) {
  .nod-children { margin-left: 16px; }
  .nod-item-inner { padding: 10px 14px; }
  .modal-box { max-height: 92vh; }
}
