:root {
  --bg: #f5f7fb;
  --muted: #6b7280;
  --accent: #0f172a;
  --accent-2: #1e293b;
  --card: #ffffff;
  --success: #10b981;
  --danger: #ef4444;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html,body { height: 100%; }
body { margin: 0; line-height: 1.6; color: #0f172a; background: var(--bg); }
.container { width: min(1100px, 100% - 32px); margin: 0 auto; padding: 28px 16px; }
.page-header { background: var(--accent-2); color: white; }
.page-header .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: white; font-weight: 700; text-decoration: none; font-size: 1.25rem; }
.site-nav a { color: #e6eefc; text-decoration: none; margin-left: 18px; font-weight: 600; }
.site-nav a:hover { text-decoration: underline; }
.main-title { margin-top: 0; font-size: 1.4rem; }
.card { background: var(--card); border-radius: 12px; box-shadow: 0 6px 20px rgba(2,6,23,0.06); padding: 22px; margin-bottom: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], textarea, select { width: 100%; padding: 12px 14px; border: 1px solid #e6eef6; border-radius: 10px; background: #fff; font-size: 0.98rem; }
textarea { min-height: 160px; resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; border: 0; border-radius: 10px; background: var(--accent); color: white; cursor: pointer; text-decoration: none; font-weight: 700; }
button:hover, .button:hover { background: var(--accent-2); }
.button.secondary { background: transparent; color: var(--accent); border: 1px solid #e6eef6; }
.alerts { margin-bottom: 18px; }
.alert { background: #fff4f4; color: var(--danger); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid rgba(239,68,68,0.08); }
.help { color: var(--muted); font-size: 0.95rem; margin-top: 6px; }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); border: 1px dashed #e6eef6; border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4)); }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid #eef2f7; }
th { background: #fbfdff; color: var(--muted); font-size: 0.95rem; }
.status-pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 0.9rem; }
.status-pill.unread { background: #fef3c7; color: #92400e; }
.status-pill.read { background: #dcfce7; color: #166534; }
.note { color: var(--muted); font-size: 0.95rem; }
.site-footer { padding: 18px 0; background: #f1f5f9; color: #334155; font-size: 0.95rem; }

/* Mobile improvements */
@media (max-width: 768px) {
  .container { padding: 16px; }
  .site-nav { width: 100%; display: flex; flex-wrap: wrap; gap: 12px; }
  .site-nav a { margin-left: 0; }
  .card { padding: 16px; }
  button, .button { width: 100%; display: block; }
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.step-item {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}
.step-item.active {
  border-color: var(--accent);
  background: #eff6ff;
}
.step-item .step-number {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e2e8f0;
  margin-bottom: 8px;
  font-weight: 700;
}
.step-item.active .step-number {
  background: var(--accent);
  color: white;
}
.step-pane {
  display: none;
}
.step-pane.active {
  display: block;
}
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}
.form-actions button {
  min-width: 160px;
}
.form-actions .button.secondary {
  min-width: 140px;
}
.status-timeline {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}
.timeline-step {
  display: grid;
  grid-template-columns: 26px auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.timeline-step.active {
  border-color: var(--accent);
  background: #eff6ff;
}
.timeline-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  margin-top: 4px;
}
.timeline-step.active .timeline-marker {
  background: var(--accent);
}
.status-pill.status-new { background: #fef3c7; color: #92400e; }
.status-pill.status-under_review { background: #dbeafe; color: #1d4ed8; }
.status-pill.status-action_required { background: #fee2e2; color: #b91c1c; }
.status-pill.status-closed { background: #d1fae5; color: #166534; }

/* Mappar i VD-dashboarden */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.main-col { min-width: 0; }
.sidebar h2 { margin-top: 0; font-size: 18px; }
.folder-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.folder-link { font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--accent); text-decoration: none; font-weight: 600; }
.folder-link:hover { background: #f1f5f9; }
.folder-link.active { background: #eef6ff; box-shadow: inset 3px 0 0 var(--accent); }
.folder-link .count { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; }
.table-wrapper td { vertical-align: middle; }
.folder-company { margin: 12px 12px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.folder-row { padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.folder-row details { margin-top: 6px; }
.folder-row form { margin: 10px 0; }
.current-folder { margin: 0 0 12px; color: var(--muted); }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }


/* Replaces inline presentation styles so CSP can block style attributes. */
.break-anywhere { word-break: break-all; }
.snippet-code { width: 100%; font-family: monospace; }
.inline-form { display: inline; }
.inline-form-spaced { margin-left: 8px; }
.onboarding-step { margin-bottom: 12px; }
.folder-depth-1 { padding-left: 12px; }
.folder-depth-2 { padding-left: 30px; }
.folder-depth-3 { padding-left: 48px; }
.folder-depth-4 { padding-left: 66px; }
.folder-row-depth-1 { margin-left: 0; }
.folder-row-depth-2 { margin-left: 24px; }
.folder-row-depth-3 { margin-left: 48px; }
.folder-row-depth-4 { margin-left: 72px; }
