/* ==========================================================================
   FÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶retagsregister ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ designsystem (app.css)
   Ren CSS, inga beroenden. Tokens fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶rst, sedan komponenter.
   ========================================================================== */

:root{
  /* Typografi */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 11px; --fs-sm: 12px; --fs: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 28px;

  /* Ytor */
  --bg: #FFFFFF;
  --bg-subtle: #FBF8F2;
  --bg-muted: #F1ECE3;
  --bg-hover: #FDFBF7;
  --border: #E6DFD2;
  --border-strong: #D6CDBC;

  /* Text */
  --text: #1A1714;
  --text-2: #4A443C;
  --text-3: #6E665B;
  --placeholder: #7A7268;

  /* Palett ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ sex vÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rden:
     TallgrÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶n (huvudfÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rg, bÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤r vit text), Duk (bakgrund), Vit,
     Salvia (pastell, fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥r vara bakgrund), Citron (accent ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ bara smÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ detaljer),
     BlÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤ck (endast text, aldrig stora ytor) */
  --brand: #E0457B;        /* Hallon ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ logga, accenter, diagram */
  --brand-strong: #BF285E; /* Hallon fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶r knappar och ytor med vit text (4,6:1) */
  --brand-dark: #A8264F;   /* LÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤nkar och liten text i hallon */
  --brand-weak: #FCEEF3;
  --navy: #1E2A44;         /* MÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶rkt ankare ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥r vara yta, vit text */
  --mint: #D7EFE6;         /* Pastell ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥r vara yta, mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶rk text */
  --mint-weak: #EEF8F3;
  --ink: #1A1714;          /* Bara text */

  /* ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂldre namn pekar pÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ den nya paletten sÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ att komponenterna inte behÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶ver ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤ndras */
  --pine: var(--brand);
  --pine-hover: var(--brand-dark);
  --sage: var(--mint);
  --sage-weak: var(--mint-weak);
  --citron: var(--mint);
  --signal: var(--mint);
  --cobalt: var(--navy);

  --accent: var(--brand-strong);
  --accent-hover: var(--brand-dark);
  --accent-text: var(--brand-dark);
  --accent-weak: var(--mint-weak);
  --accent-ring: rgba(224, 69, 123, .3);

  /* Semantik */
  --pos: #0F7038;
  --neg: #9A3A1E; /* tegel ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ skiljer sig frÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥n hallon */
  --ok-bg: #E7F4EB;   --ok-fg: #166534;
  --warn-bg: #FEF4E4; --warn-fg: #8A4B06; --warn-border: #F3D9AE;
  --err-bg: #FCECEB;  --err-fg: #9F1F17;
  --info-bg: #EDF0FC; --info-fg: #1E3A9E;

  /* Prospektstatus */
  --st-ny-bg: #EEEAE1;          --st-ny-fg: #4A453D;          --st-ny-dot: #A69E91;
  --st-kontaktad-bg: #D7EFE6;   --st-kontaktad-fg: #1D4A3A;   --st-kontaktad-dot: #4FA383;
  --st-intresserad-bg: #FADCE6; --st-intresserad-fg: #8E1F48; --st-intresserad-dot: #E0457B;
  --st-avbojt-bg: #E9E6E1;      --st-avbojt-fg: #57524A;      --st-avbojt-dot: #A39C92;
  --st-kund-bg: #BF285E;        --st-kund-fg: #FFFFFF;        --st-kund-dot: #FADCE6;

  /* Form */
  --r-sm: 4px; --r: 8px; --r-lg: 12px; --r-xl: 14px;
  --bg-app: #F3EFE7;
  --bg-sheet: #FBF8F2;
  --sh-1: 0 1px 2px rgba(16, 18, 24, .06);
  --sh-card: 0 1px 2px rgba(16, 18, 24, .04), 0 2px 6px rgba(16, 18, 24, .04);
  --sh-sheet: 0 1px 3px rgba(16, 18, 24, .06), 0 8px 24px rgba(16, 18, 24, .04);
  --sh-pop: 0 10px 28px rgba(16, 18, 24, .14), 0 2px 6px rgba(16, 18, 24, .06);

  /* AvstÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥nd (4px-skala) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs); line-height: 1.45;
  color: var(--text); background: var(--bg-subtle);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tnum, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.neg { color: var(--neg); }
.pos { color: var(--pos); }
.na { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* ScrollbehÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥llare mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ste vara positionerade, annars hamnar absolut placerade barn (t.ex. .sr-only) utanfÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶r och ger sidan horisontell scroll */
.table-wrap, .sidebar, .main { position: relative; }
.i { width: 16px; height: 16px; flex: none; }
.i-sm { width: 14px; height: 14px; flex: none; }
.i-xs { width: 12px; height: 12px; flex: none; }
.link { color: var(--accent-text); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.row { display: flex; align-items: center; gap: var(--s-2); }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.spacer { flex: 1 1 auto; }

/* ---------- App-skal ---------- */
.app { display: flex; min-height: 100vh; background: var(--bg-app); }
.sidebar {
  flex: 0 0 236px; width: 236px; display: flex; flex-direction: column; gap: 2px;
  padding: 12px 10px; background: transparent;
}
.main {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  margin: 0; background: var(--bg-sheet);
  border-left: 1px solid #DCDFE5; border-radius: 0; box-shadow: var(--sh-sheet);
}
.topbar {
  min-height: 52px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 28px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs); min-width: 0; }
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs strong { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page { width: 100%; padding: 28px 28px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.page-sub { margin-top: 4px; color: var(--text-3); font-size: var(--fs-md); }
.section-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }

/* Sidomeny */
.sb-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
.sb-logo { width: 28px; height: 28px; border-radius: 7px; background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.sb-product { font-weight: 600; font-size: var(--fs-md); line-height: 1.2; }
.sb-org { font-size: var(--fs-sm); color: var(--text-3); }
.sb-search {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; margin: 0 0 10px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--bg);
  color: var(--text-3); text-decoration: none; font-size: var(--fs);
}
.sb-search:hover { border-color: var(--border-strong); color: var(--text-2); }
.sb-search .sb-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs);
  color: var(--text);
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}
.sb-search .sb-search-input::placeholder { color: var(--placeholder); }
.sb-search:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--accent-ring); }
.sb-head-brand { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-brand-link { display: block; line-height: 0; text-decoration: none; }
.sb-brand-mark { display: block; width: auto; max-width: 100%; height: 26px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r);
  color: var(--text-2); text-decoration: none; font-size: var(--fs); font-weight: 500;
}
.nav-item svg { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.nav-item:hover { background: var(--bg-muted); color: var(--text); }
.nav-item.is-active { background: var(--bg); color: var(--text); box-shadow: var(--sh-1), inset 0 0 0 1px var(--border); }
.nav-item.is-active svg { color: var(--accent); }
.nav-item.is-disabled { color: var(--text-3); cursor: default; }
.nav-item.is-disabled:hover { background: none; color: var(--text-3); }
.nav-count { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); font-weight: 500; }
.nav-soon { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); border: 1px solid var(--border); border-radius: 99px; padding: 0 6px; line-height: 16px; }
.nav-section { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; }
.sb-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--border); }
.sb-user-name { font-size: var(--fs); font-weight: 500; line-height: 1.2; }
.sb-user-role { font-size: var(--fs-sm); color: var(--text-3); }
.sb-demo { font-size: var(--fs-xs); color: var(--text-3); padding: 10px 10px 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-weak); color: var(--accent-text); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.avatar-sm { width: 22px; height: 22px; font-size: 10px; }

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r); border: 1px solid transparent; font: inherit; font-size: var(--fs); font-weight: 500;
  line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-1); }
.btn-secondary:hover { background: var(--bg-subtle); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }
.btn-danger { background: var(--bg); color: var(--neg); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--err-bg); border-color: #EBC4C0; }
.btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-sm); }
.btn-lg { height: 40px; padding: 0 16px; font-size: var(--fs-md); }
.btn-icon { width: 32px; padding: 0; }
.btn-sm.btn-icon { width: 28px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---------- FormulÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤r ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.help { font-size: var(--fs-sm); color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--bg); color: var(--text); font: inherit; font-size: var(--fs);
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: #B6BAC2; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input:disabled, .select:disabled { background: var(--bg-muted); color: var(--text-3); border-color: var(--border); cursor: not-allowed; }
/* WebKit/Chrome autofill: tvinga vit (design) bakgrund i stället för ljusblå */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active,
.select:-webkit-autofill,
.textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  transition: background-color 99999s ease-out 0s;
}
.input:autofill,
.select:autofill,
.textarea:autofill {
  box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text);
}
.select-wrap { position: relative; }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer; }
.select-wrap > svg { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-3); pointer-events: none; }
.affix { position: relative; }
.affix .input { padding-right: 40px; }
.affix-suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: var(--fs-sm); color: var(--text-3); pointer-events: none; }
.affix-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.affix-icon + .input { padding-left: 32px; padding-right: 10px; }
.range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.range-sep { color: var(--text-3); font-size: var(--fs-sm); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: var(--fs); color: var(--text); cursor: pointer; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: var(--fs); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 30px; height: 18px; border-radius: 99px; background: #BFC3CB; flex: none; transition: background-color .15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(12px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.tokens { display: flex; flex-wrap: wrap; gap: 4px; min-height: 32px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--bg); }
.tokens:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.tokens input { flex: 1 1 80px; min-width: 80px; border: 0; outline: 0; background: none; font: inherit; font-size: var(--fs); padding: 0 6px; height: 24px; }
.tokens input::placeholder { color: var(--placeholder); }
.token { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 2px 0 8px; border-radius: var(--r-sm); background: var(--bg-muted); font-size: var(--fs-sm); color: var(--text); max-width: 100%; }
.token span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unavailable { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 99px; border: 1px dashed var(--border-strong); color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; }

/* ---------- Kort ---------- */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; box-shadow: var(--sh-card); }
.card .card { box-shadow: none; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-header.plain { border-bottom: 0; padding-bottom: 4px; }
.card-title { font-size: var(--fs-md); font-weight: 600; }
.card-meta { font-size: var(--fs-sm); color: var(--text-3); }
.card-body { padding: 16px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-3); }

/* KPI */
.kpi { padding: 16px; }
.kpi-label { font-size: var(--fs-sm); color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-value { margin-top: 6px; font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value.sm { font-size: var(--fs-xl); }
.kpi-unit { font-size: var(--fs-md); font-weight: 500; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-3); }
.year { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; background: var(--bg-muted); color: var(--text-2); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.st-ny { background: var(--st-ny-bg); color: var(--st-ny-fg); } .st-ny .dot { background: var(--st-ny-dot); }
.st-kontaktad { background: var(--st-kontaktad-bg); color: var(--st-kontaktad-fg); } .st-kontaktad .dot { background: var(--st-kontaktad-dot); }
.st-intresserad { background: var(--st-intresserad-bg); color: var(--st-intresserad-fg); } .st-intresserad .dot { background: var(--st-intresserad-dot); }
.st-avbojt { background: var(--st-avbojt-bg); color: var(--st-avbojt-fg); } .st-avbojt .dot { background: var(--st-avbojt-dot); }
.st-kund { background: var(--st-kund-bg); color: var(--st-kund-fg); } .st-kund .dot { background: var(--st-kund-dot); }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-err { background: var(--err-bg); color: var(--err-fg); }
.badge-info { background: var(--info-bg); color: var(--info-fg); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.tag { border-radius: var(--r-sm); height: 20px; padding: 0 6px; font-size: var(--fs-xs); }

/* ---------- Tabeller ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--sh-card); }
.card .table-wrap { box-shadow: none; }
.table-wrap.flush { border: 0; border-radius: 0; box-shadow: none; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs); }
.table th { text-align: left; font-weight: 500; font-size: var(--fs-sm); color: var(--text-3); background: var(--bg-subtle); height: 36px; padding: 0 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table.compact td { height: 36px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table tbody tr.is-selected td { background: var(--accent-weak); }
.table tbody tr.is-current td { background: var(--bg-subtle); }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-check { width: 40px; padding-right: 0; }
.table .col-actions { width: 44px; text-align: right; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.sort-btn:hover { color: var(--text); }
.sort-btn svg { width: 12px; height: 12px; opacity: .45; }
.sort-btn.is-sorted { color: var(--text); }
.sort-btn.is-sorted svg { opacity: 1; }
th.num .sort-btn { flex-direction: row-reverse; }
.co-name { color: var(--text); font-weight: 500; text-decoration: none; }
.co-name:hover { color: var(--accent-text); text-decoration: underline; }
.cell-sub { display: block; font-size: var(--fs-sm); color: var(--text-3); }
.truncate { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.sk { display: block; height: 10px; border-radius: 4px; background: linear-gradient(90deg, #ECEDF0 0%, #F6F7F8 50%, #ECEDF0 100%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Filterchips, verktygsrad, bulk ---------- */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 3px 0 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border-strong); font-size: var(--fs-sm); color: var(--text-3); }
.chip strong { color: var(--text); font-weight: 500; }
.chip-x { width: 20px; height: 20px; border: 0; padding: 0; border-radius: 50%; background: none; display: grid; place-items: center; color: var(--text-3); cursor: pointer; }
.chip-x:hover { background: var(--bg-muted); color: var(--text); }
.chip-x svg { width: 12px; height: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 6px 6px 14px; border-radius: var(--r-lg); background: var(--text); color: #fff; font-size: var(--fs); }
.bulkbar .btn-ghost { color: #E4E6EA; }
.bulkbar .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.bulkbar .btn-primary { background: #fff; color: var(--text); }
.bulkbar .btn-primary:hover { background: #E9EAED; }
.result-count { font-size: var(--fs); color: var(--text-3); }
.result-count strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Paginering */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); color: var(--text-3); }
.pages { display: flex; align-items: center; gap: 2px; }
.page-btn { min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--r); border: 1px solid transparent; background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.page-btn:hover { background: var(--bg-muted); }
.page-btn[aria-current="page"] { background: var(--bg); border-color: var(--border-strong); color: var(--text); font-weight: 600; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; }

/* Flikar och segment */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 8px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: var(--fs); font-weight: 500; color: var(--text-3); cursor: pointer; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.tab-count { font-size: var(--fs-xs); color: var(--text-2); background: var(--bg-muted); border-radius: 99px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-muted); border-radius: var(--r); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: var(--sh-1); }

/* ---------- Dialog, popover, toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 96px 16px 16px; background: rgba(15, 17, 22, .38); }
.dialog { width: 100%; max-width: 480px; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-pop); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.dialog-title { font-size: var(--fs-lg); font-weight: 600; }
.dialog-desc { margin-top: 4px; color: var(--text-3); font-size: var(--fs); }
.dialog-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.options { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; font-size: var(--fs); }
.option:hover { background: var(--bg-subtle); }
.option.is-checked { border-color: var(--accent); background: var(--accent-weak); }
.option-meta { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; }
.pop-anchor { position: relative; }
.popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 320px; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-pop); }
.menu-label { padding: 8px 8px 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--r); background: none; font: inherit; font-size: var(--fs); color: var(--text); text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--bg-muted); }
.menu-item .option-meta { margin-left: auto; }
.menu-sep { height: 1px; margin: 4px 0; background: var(--border); }
.toast { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); padding: 10px 10px 10px 14px; border-radius: var(--r-lg); background: var(--text); color: #fff; box-shadow: var(--sh-pop); font-size: var(--fs); }
.toast svg { color: #7EE2A8; }
.toast a { color: #fff; font-weight: 600; }

/* ---------- Tomt lÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤ge, notiser ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; }
.empty-icon { width: 40px; height: 40px; border-radius: var(--r-lg); background: var(--bg-muted); color: var(--text-3); display: grid; place-items: center; }
.empty-title { margin-top: 4px; font-size: var(--fs-md); font-weight: 600; }
.empty-text { max-width: 380px; color: var(--text-3); }
.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text-2); font-size: var(--fs); }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--text-3); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-fg); }
.notice-warn svg { color: var(--warn-fg); }

/* ---------- Listor, flÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶den, definitionslistor ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-muted); color: var(--text-3); display: grid; place-items: center; flex: none; }
.feed-icon svg { width: 12px; height: 12px; }
.feed-text { color: var(--text-2); }
.feed-text strong { color: var(--text); font-weight: 500; }
.feed-time { font-size: var(--fs-sm); color: var(--text-3); }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: var(--fs); }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; color: var(--text); min-width: 0; }
.statbar { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: var(--bg-muted); }
.statbar span { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs); color: var(--text-2); }
.legend-row .num { margin-left: auto; color: var(--text); font-weight: 500; }
.sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.listlink { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.listlink:last-child { border-bottom: 0; }
.listlink:hover { background: var(--bg-hover); }

/* ---------- RutnÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤t ---------- */
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }

/* ---------- SÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶k: filterpanel ---------- */
.search-layout { display: flex; gap: 20px; align-items: flex-start; }
.filters { flex: 0 0 288px; width: 288px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-card); }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); }
.fgroup { border-bottom: 1px solid var(--border); }
.fgroup:last-child { border-bottom: 0; }
.fgroup > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: var(--fs); }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary > svg { margin-left: auto; width: 14px; height: 14px; color: var(--text-3); transition: transform .15s; }
.fgroup[open] > summary > svg { transform: rotate(180deg); }
.fgroup-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: var(--fs-xs); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.fgroup-body { padding: 0 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.filters-toggle { display: none; }
.results { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Prospektlistor ---------- */
.ws { display: flex; gap: 20px; align-items: flex-start; }
.ws-lists { flex: 0 0 248px; width: 248px; }
.ws-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ws-panel { flex: 0 0 340px; width: 340px; }
.list-nav { display: flex; flex-direction: column; gap: 1px; }
.list-nav button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: var(--r); background: none; font: inherit; font-size: var(--fs); color: var(--text-2); text-align: left; cursor: pointer; }
.list-nav button:hover { background: var(--bg-muted); color: var(--text); }
.list-nav button[aria-current="true"] { background: var(--bg-muted); color: var(--text); font-weight: 600; }
.list-nav .option-meta { font-weight: 400; }
.status-select { height: 26px; padding: 0 26px 0 8px; border-radius: 99px; border: 1px solid transparent; font: inherit; font-size: var(--fs-sm); font-weight: 500; appearance: none; -webkit-appearance: none; cursor: pointer; }
.status-select:hover { border-color: var(--border-strong); }
.status-wrap { position: relative; display: inline-block; }
.status-wrap > svg { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; pointer-events: none; opacity: .7; }

/* ---------- FÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶retagsdetaljer ---------- */
.co-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.co-mark { width: 44px; height: 44px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg-subtle); display: grid; place-items: center; font-weight: 600; color: var(--text-2); font-size: var(--fs-lg); flex: none; }
.co-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; color: var(--text-3); font-size: var(--fs); }
.co-meta span { display: inline-flex; align-items: center; gap: 6px; }
.fin-table th:first-child, .fin-table td:first-child { position: sticky; left: 0; background: var(--bg); z-index: 1; }
.fin-table th:first-child { background: var(--bg-subtle); }
.fin-table tr.grp td { background: var(--bg-subtle); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; height: 30px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-sm); color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ratio { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); min-width: 0; }
.ratio-label { font-size: var(--fs-sm); color: var(--text-3); }
.ratio-value { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.ratio-foot { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- Responsivt ---------- */
@media (max-width: 1180px) {
  .g-main-side { grid-template-columns: minmax(0, 1fr); }
  .ws { flex-wrap: wrap; }
  .ws-panel { flex: 1 1 100%; width: auto; }
}
/* Sök sidopanel & mobilnav — se duplicerat block längre ned (undvik äldre horisontell sidomeny). */
@media (max-width: 640px) {
  .btn, .input, .select { height: 40px; }
  .page-title { font-size: var(--fs-xl); }
  .kpi-value { font-size: var(--fs-2xl); }
  .backdrop { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  * { transition: none !important; }
}

/* ==========================================================================
   Tema C4: varm bas, grafisk typografi och fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rgblock fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶r de viktigaste siffrorna
   ========================================================================== */
.main { border-left: 1px solid var(--border); box-shadow: none; }
.topbar { background: var(--bg-sheet); }
.card, .table-wrap, .filters { box-shadow: none; }
.page-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
.card-title, .dialog-title, .section-title, .empty-title { font-family: var(--font-display); letter-spacing: -.01em; }
.kpi-label { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.kpi-value { font-family: var(--font-display); font-weight: 700; letter-spacing: -.04em; }
.table td.num { font-family: var(--font-mono); font-size: 12.5px; }
.year, .nav-count, .tab-count { font-family: var(--font-mono); }
.year { font-size: var(--fs-xs); }
.nav-section, .menu-label { font-family: var(--font-mono); font-weight: 500; letter-spacing: .05em; }

/* Sidomeny: numrerade val, svart platta fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶r aktiv sida */
.sb-head { padding: 6px 10px 20px; }
/* First Move-symbolen "Kurvan": tre staplar, den sista i huvudfÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rg, en kurva som skÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤r igenom.
   Kurvan ritas i bakgrundsfÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rgen sÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ att den ser ut som ett snitt. */
.sb-logo { display: block; width: 24px; height: 24px; flex: none; background: none; }
.sb-logo .bar { fill: var(--ink); }
.sb-logo .bar-top { fill: var(--brand); }
.sb-logo .cut { fill: none; stroke: var(--bg-app); stroke-width: 2.6; stroke-linecap: round; }
.sb-logo .cut-head { fill: var(--bg-app); }
.sb-product { letter-spacing: -.05em; }
.sb-product span { color: var(--pine); }
.sb-product { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.sb-search { border-color: var(--border-strong); }
.nav { counter-reset: nav; }
.nav-item { height: 36px; gap: 12px; }
.nav-item svg { display: none; }
.nav-item::before { width: 16px; flex: none; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); }
a.nav-item { counter-increment: nav; }
a.nav-item::before { content: counter(nav, decimal-leading-zero); }
span.nav-item.is-disabled::before { content: none; }
.nav-item:hover { background: #EAE4D8; }
.nav-item.is-active { background: var(--navy); color: #FFFFFF; box-shadow: none; }
.nav-item.is-active::before { color: #F48FB1; }
.nav-item.is-active .nav-count { color: #C9D3EA; }
.sb-foot .avatar { background: var(--mint); color: #1D4A3A; border-radius: 6px; }

/* Komponentjusteringar */
.btn-primary { color: #FFFFFF; }
.badge { border-radius: 6px; }
.chip { border-radius: var(--r); height: 30px; }
.fgroup-n { background: var(--brand-strong); color: #FFFFFF; }
.bulkbar { background: var(--navy); }
.bulkbar .btn-primary { background: var(--brand-strong); color: #FFFFFF; }
.bulkbar .btn-primary:hover { background: var(--brand-dark); }
.bulkbar .btn-ghost { color: #D9DFEC; }
.toast { background: var(--navy); }
.toast svg { color: var(--mint); }
.link:hover, .co-name:hover { color: var(--pine-hover); }

/* FÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rgblock ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ stora siffror ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶verst pÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ en sida */
.g-blocks { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; }
.block { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 172px; padding: 20px 22px; border-radius: var(--r-xl); background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.block > .card-body { padding: 0; }
.block .kpi-value { margin-top: 0; font-size: 46px; line-height: .9; }
.block .kpi-foot { margin-top: 8px; font-size: var(--fs); }
.block-hero .kpi-value { font-size: 76px; }
/* Salvia (pastell) ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ den viktigaste siffran pÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ sidan */
.block-signal { background: var(--sage); border-color: var(--sage); }
.block-signal .kpi-label, .block-signal .kpi-foot, .block-signal .muted { color: #1D4A3A; }
.block-signal .statbar { background: rgba(29, 74, 58, .14); }
.block-signal .legend-row { color: #1D3A30; }
.block-signal .legend-row .num { color: var(--ink); }
/* TallgrÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶n ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ en andra nyckelsiffra, vit text */
.block-cobalt { background: var(--pine); border-color: var(--pine); color: #FFFFFF; }
.block-cobalt .kpi-label, .block-cobalt .kpi-foot { color: #C9D3EA; }
/* "Ink"-blocket ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤r vitt: blÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤ck anvÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤nds bara till text, aldrig som stor yta */
.block-ink { background: var(--bg); border-color: var(--border); color: var(--text); }
.block-ink .kpi-label, .block-ink .muted { color: var(--text-3); }
.block-ink .kpi-foot { color: var(--pine); }
@media (max-width: 1080px) { .g-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); } .block-hero { grid-column: 1 / -1; } }
@media (max-width: 640px) { .g-blocks { grid-template-columns: minmax(0, 1fr); } .block-hero .kpi-value { font-size: 56px; } }

/* ==========================================================================
   Tema D: sval grÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ bas, vita kort med mjuk skugga, mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤ttade hallonblock
   LÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤ggs sist och skriver ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶ver tidigare teman.
   ========================================================================== */
:root{
  --brand-block: #D6336C;  /* Hallon fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶r stora ytor med vit text (4,6:1) */
  --brand-weak: #FCE4EC;   /* Ljus hallon ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ tonade kort */
  --mint-strong: #1F8A66;  /* MintgrÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶n fÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶r ikoner pÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ ljus yta */
  --navy: #16161D;         /* Marin utgÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥r ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶rka ytor (ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥tgÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rdsfÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤lt, notiser) ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤r nu blÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤ck */

  --bg-app: #F4F4F6;
  --bg-sheet: #F4F4F6;
  --bg-subtle: #F8F8FA;
  --bg-muted: #EEEEF2;
  --bg-hover: #FAFAFC;
  --border: #E6E6EC;
  --border-strong: #D3D3DC;
  --text: #16161D;
  --text-2: #3C3C48;
  --text-3: #5E5E6B;
  --placeholder: #74747F;
  --ink: #16161D;

  --r-tile: 16px;
  --sh-card: 0 1px 2px rgba(20, 20, 40, .05), 0 6px 18px rgba(20, 20, 40, .06);
  --sb-bg: #FFFFFF;
}

/* Skal: vit sidomeny, grÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥ arbetsyta. Ytan ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤r rak och kant i kant. */
.app { background: var(--bg-app); }
.sidebar { background: var(--sb-bg); border-right: 1px solid var(--border); padding: 18px 12px; }
.main { background: var(--bg-app); border-left: 0; box-shadow: none; border-radius: 0; }
.topbar { background: transparent; border-bottom: 1px solid var(--border); }
.page { padding: 28px 32px 48px; gap: 22px; }

.sb-logo .cut { stroke: var(--sb-bg); }
.sb-logo .cut-head { fill: var(--sb-bg); }
.sb-search { background: var(--bg-subtle); border-color: var(--border); }
.nav-item:hover { background: var(--bg-muted); }
.nav-item.is-active { background: var(--brand-weak); color: var(--brand-dark); font-weight: 600; }
.nav-item.is-active::before { color: var(--brand-block); }
.nav-item.is-active .nav-count { color: var(--brand-dark); }
.sb-foot { border-top-color: var(--border); }
.sb-foot .avatar { background: var(--mint); color: #1D4A3A; }

/* Kort och tabeller: vita, ingen kantlinje, mjuk skugga */
.card, .table-wrap, .filters { border-color: transparent; border-radius: var(--r-tile); box-shadow: var(--sh-card); }
.card .card, .card .table-wrap { box-shadow: none; border-radius: 0; }
.table-wrap.flush { border-radius: 0 0 var(--r-tile) var(--r-tile); }

/* FÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¤rgblock (FÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶retagssÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶k m.fl.) */
.block { border: 0; border-radius: var(--r-tile); box-shadow: var(--sh-card); }
.block-signal, .block-cobalt { box-shadow: none; }
.block-cobalt { background: var(--brand-block); color: #FFFFFF; }
.block-cobalt .kpi-label, .block-cobalt .kpi-foot { color: rgba(255, 255, 255, .92); }
.block-ink .kpi-foot { color: var(--brand-dark); }

/* ---------- Siffrorutor (tiles) ----------
   <div class="tiles">
     <div class="tile tile-lg tile-brand">
       <svg class="tile-icon" ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¦></svg>
       <div class="tile-value">1 832 417</div>
       <div class="tile-label">FÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¶retag i registret</div>
     </div>
   </div>
   Varianter: tile-brand (hallon, vit text), tile-rose (ljus hallon), tile-mint, standard = vit.
   tile-lg spanar 2 kolumner och 2 rader pa desktop. */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(132px, auto); gap: 16px; }
.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile {
  position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px 18px; border-radius: var(--r-tile); background: var(--bg); color: var(--text);
  box-shadow: var(--sh-card); text-decoration: none;
}
a.tile:hover { box-shadow: 0 2px 4px rgba(20, 20, 40, .06), 0 10px 24px rgba(20, 20, 40, .09); }
.tile-icon {
  position: absolute; top: 14px; right: 16px; width: 40px; height: 40px;
  fill: none; stroke: var(--brand-block); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tile-value { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-label { margin-top: 6px; font-size: var(--fs-md); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-foot { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-3); }
.tile .statbar { margin-top: 10px; }
.tile-lg { grid-column: span 2; grid-row: span 2; padding: 22px 24px; }
.tile-lg .tile-icon { top: 20px; right: 22px; width: 88px; height: 88px; stroke-width: 1.5; }
.tile-lg .tile-value { font-size: 60px; }
.tile-lg .tile-label { font-size: 15px; }
.tile-brand { background: var(--brand-block); color: #FFFFFF; box-shadow: none; }
.tile-brand .tile-icon { stroke: #FFFFFF; }
.tile-brand .tile-label, .tile-brand .tile-foot { color: rgba(255, 255, 255, .92); }
.tile-rose { background: var(--brand-weak); box-shadow: none; }
.tile-mint { background: var(--mint); box-shadow: none; }
.tile-mint .tile-icon, .tile .tile-icon.is-mint { stroke: var(--mint-strong); }
.tile-mint .tile-label, .tile-mint .tile-foot { color: #2C4A3F; }
@media (max-width: 1180px) {
  .tiles, .tiles-5, .tiles-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tiles, .tiles-5, .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile-lg { grid-row: span 1; }
  .tile-lg .tile-value { font-size: 40px; }
  .tile-lg .tile-icon { width: 48px; height: 48px; }
  .tile-value { font-size: 28px; }
}

/* ==========================================================================
   App-tillÃÂÃÂÃÂÃÂ¤gg (SNI/lÃÂÃÂÃÂÃÂ¤n-vÃÂÃÂÃÂÃÂ¤ljare, mobil navigation, exportprogress)
   ========================================================================== */

.sni-picker { display: flex; flex-direction: column; gap: 10px; }
.sni-picker-panel { margin-top: 4px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); max-height: 280px; overflow: auto; box-shadow: var(--sh-card); }
.sni-picker-list { list-style: none; margin: 0; padding: 4px 6px; }
.sni-picker-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 8px;
  border: 0;
  border-radius: calc(var(--r) - 2px);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.sni-picker-item + .sni-picker-item,
.sni-picker-children .sni-picker-item { margin-top: 2px; }
.sni-picker-item:hover,
.sni-picker-item.is-active { background: var(--bg-muted); }
.sni-picker-item.is-selected { background: var(--bg); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sni-picker-item input { margin-top: 4px; flex-shrink: 0; width: 15px; height: 15px; accent-color: var(--brand-strong); }
.sni-picker-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sni-picker-item-title { font-weight: 500; color: var(--text); font-size: var(--fs-sm); line-height: 1.35; }
.sni-picker-item-code { font-size: var(--fs-xs); color: var(--text-3); }
.sni-picker-browse { padding: 6px 6px 8px; }
.sni-picker-browse-label { margin: 0 0 6px 8px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.sni-picker-roots { display: flex; flex-direction: column; gap: 2px; }
.sni-picker-children { margin: 2px 0 4px 26px; padding-left: 8px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.sni-picker-empty { padding: 10px 12px; font-size: var(--fs-sm); list-style: none; }
.sni-picker-selected.chips { align-items: flex-start; gap: 8px; }
.chip.sni-chip {
  height: auto;
  min-height: 2.25rem;
  max-width: 100%;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 6px 7px 11px;
  border-radius: var(--r);
  line-height: 1.35;
}
.sni-chip-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sni-chip-title {
  color: var(--text);
  font-weight: 500;
  font-size: var(--fs-sm);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sni-chip-code {
  font-size: var(--fs-xs);
  color: var(--text-3);
  letter-spacing: 0.01em;
}
.chip.sni-chip .chip-x {
  flex-shrink: 0;
  align-self: center;
  margin-top: 0;
}
.sni-clear { align-self: flex-start; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.selection-expand { margin: 0 0 10px; padding: 10px 14px; border-radius: var(--r); background: var(--bg-muted); font-size: var(--fs-sm); }
.selection-expand-action { margin-left: 4px; padding: 0; font-weight: 600; }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 6px 6px 14px; border-radius: var(--r-lg); background: var(--text); color: #fff; font-size: var(--fs); }
.bulkbar .btn-ghost { color: #E4E6EA; }
.bulkbar .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.bulkbar .btn-primary { background: #fff; color: var(--text); }
.bulkbar .btn-primary:hover { background: #E9EAED; }
.result-count { font-size: var(--fs); color: var(--text-3); }
.result-count strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Paginering */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); color: var(--text-3); }
.pages { display: flex; align-items: center; gap: 2px; }
.page-btn { min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--r); border: 1px solid transparent; background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.page-btn:hover { background: var(--bg-muted); }
.page-btn[aria-current="page"] { background: var(--bg); border-color: var(--border-strong); color: var(--text); font-weight: 600; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; }

/* Flikar och segment */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 8px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: var(--fs); font-weight: 500; color: var(--text-3); cursor: pointer; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.tab-count { font-size: var(--fs-xs); color: var(--text-2); background: var(--bg-muted); border-radius: 99px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-muted); border-radius: var(--r); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: var(--sh-1); }

/* ---------- Dialog, popover, toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 96px 16px 16px; background: rgba(15, 17, 22, .38); }
dialog.dialog { padding: 0; border: none; max-width: min(480px, calc(100% - 32px)); }
dialog.dialog::backdrop { background: rgba(15, 17, 22, .38); }
.dialog { width: 100%; max-width: 480px; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-pop); }
.support-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 28px; background: var(--navy); color: #fff; font-size: var(--fs);
}
.support-bar .btn { background: #fff; color: var(--navy); border-color: transparent; }
.support-bar .btn:hover { background: var(--bg-subtle); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.dialog-title { font-size: var(--fs-lg); font-weight: 600; }
.dialog-desc { margin-top: 4px; color: var(--text-3); font-size: var(--fs); }
.dialog-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.options { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; font-size: var(--fs); }
.option:hover { background: var(--bg-subtle); }
.option.is-checked { border-color: var(--accent); background: var(--accent-weak); }
.option-meta { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; }
.pop-anchor { position: relative; }
.popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 320px; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-pop); }
.menu-label { padding: 8px 8px 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--r); background: none; font: inherit; font-size: var(--fs); color: var(--text); text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--bg-muted); }
.menu-item .option-meta { margin-left: auto; }
.menu-sep { height: 1px; margin: 4px 0; background: var(--border); }
.toast { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); padding: 10px 10px 10px 14px; border-radius: var(--r-lg); background: var(--text); color: #fff; box-shadow: var(--sh-pop); font-size: var(--fs); }
.toast svg { color: #7EE2A8; }
.toast a { color: #fff; font-weight: 600; }

/* ---------- Tomt l+ÃÂÃÂÃÂÃÂ±ge, notiser ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; }
.empty-icon { width: 40px; height: 40px; border-radius: var(--r-lg); background: var(--bg-muted); color: var(--text-3); display: grid; place-items: center; }
.empty-title { margin-top: 4px; font-size: var(--fs-md); font-weight: 600; }
.empty-text { max-width: 380px; color: var(--text-3); }
.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text-2); font-size: var(--fs); }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--text-3); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-fg); }
.notice-warn svg { color: var(--warn-fg); }

/* ---------- Listor, fl+ÃÂÃÂÃÂÃÂ¦den, definitionslistor ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-muted); color: var(--text-3); display: grid; place-items: center; flex: none; }
.feed-icon svg { width: 12px; height: 12px; }
.feed-text { color: var(--text-2); }
.feed-text strong { color: var(--text); font-weight: 500; }
.feed-time { font-size: var(--fs-sm); color: var(--text-3); }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: var(--fs); }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; color: var(--text); min-width: 0; }
.statbar { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: var(--bg-muted); }
.statbar span { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs); color: var(--text-2); }
.legend-row .num { margin-left: auto; color: var(--text); font-weight: 500; }
.sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.listlink { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.listlink:last-child { border-bottom: 0; }
.listlink:hover { background: var(--bg-hover); }

/* ---------- Rutn+ÃÂÃÂÃÂÃÂ±t ---------- */
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }

/* ---------- S+ÃÂÃÂÃÂÃÂ¦k: filterpanel ---------- */
.search-layout { display: flex; gap: 20px; align-items: flex-start; }
.filters { flex: 0 0 288px; width: 288px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-card); }
.filters-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex: none; }
.filters-head h2 { margin: 0; font-size: var(--fs-lg); line-height: 1.25; min-width: 0; }
.filters-saved { flex: none; padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.filters-saved .label { margin: 0; }
.saved-searches { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.saved-searches-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.saved-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.saved-search-link {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--accent-text);
  text-decoration: none;
  font-size: var(--fs);
}
.saved-search-link:hover { text-decoration: underline; }
.saved-search-rename { grid-column: 2; grid-row: 1; min-width: 0; }
.saved-search-rename > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  width: 28px;
  padding: 0;
  justify-content: center;
}
.saved-search-rename > summary::-webkit-details-marker { display: none; }
.saved-search-rename[open] > summary { background: var(--bg-muted); border-radius: var(--r); }
.saved-search-rename[open] {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}
.saved-search-rename-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.saved-search-delete {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.saved-search-delete .btn { width: 28px; padding: 0; justify-content: center; }
.save-search-form .save-search-submit { align-self: flex-start; }
.filters-actions { flex: none; padding: 16px; border-top: 1px solid var(--border); background: var(--bg); }
.filters-actions .btn { width: 100%; justify-content: center; }
.filters { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.fgroup { border-bottom: 1px solid var(--border); }
.fgroup:last-child { border-bottom: 0; }
.fgroup > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: var(--fs); }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary > svg { margin-left: auto; width: 14px; height: 14px; color: var(--text-3); transition: transform .15s; }
.fgroup[open] > summary > svg { transform: rotate(180deg); }
.fgroup-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: var(--fs-xs); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.fgroup-body { padding: 0 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.filters-toggle { display: none; }
.results { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Prospektlistor ---------- */
.ws { display: flex; gap: 20px; align-items: flex-start; }
.ws-lists { flex: 0 0 248px; width: 248px; }
.ws-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ws-panel { flex: 0 0 340px; width: 340px; }
.list-nav { display: flex; flex-direction: column; gap: 1px; }
.list-nav button,
.list-nav a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: var(--r); background: none; font: inherit; font-size: var(--fs); color: var(--text-2); text-align: left; cursor: pointer; }
.list-nav button:hover,
.list-nav a:hover { background: var(--bg-muted); color: var(--text); }
.list-nav button[aria-current="true"],
.list-nav a[aria-current="true"] { background: var(--brand-weak); color: var(--brand-dark); font-weight: 600; }
.list-nav .option-meta { font-weight: 400; }
.status-select { height: 26px; padding: 0 26px 0 8px; border-radius: 99px; border: 1px solid transparent; font: inherit; font-size: var(--fs-sm); font-weight: 500; appearance: none; -webkit-appearance: none; cursor: pointer; }
.status-select:hover { border-color: var(--border-strong); }
.status-select.st-ny { background: var(--st-ny-bg); color: var(--st-ny-fg); }
.status-select.st-kontaktad { background: var(--st-kontaktad-bg); color: var(--st-kontaktad-fg); }
.status-select.st-intresserad { background: var(--st-intresserad-bg); color: var(--st-intresserad-fg); }
.status-select.st-avbojt { background: var(--st-avbojt-bg); color: var(--st-avbojt-fg); }
.status-select.st-kund { background: var(--st-kund-bg); color: var(--st-kund-fg); }
.status-wrap { position: relative; display: inline-block; }
.status-wrap > svg { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; pointer-events: none; opacity: .7; }

/* Prospektlista & automatiska leads */
.table th a.sort-btn { color: var(--text-3); text-decoration: none; font-weight: 500; }
.table th .sort-btn.is-sorted { color: var(--text); }
.table .col-actions { width: 48px; text-align: right; }
.status-strip { display: flex; flex-direction: column; gap: 10px; }
.status-strip .statbar { height: 6px; }
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1 1 320px; min-width: 0; }
.per-page { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-3); }
.per-page .select-wrap { width: 76px; }
.run-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.run-strip > div { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.run-strip > div + div { border-left: 1px solid var(--border); }
.run-strip .kpi-label { color: var(--text-3); }
.run-strip strong { font-size: var(--fs-md); font-weight: 600; }
.runs { display: flex; flex-direction: column; }
.run { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
.run:first-child { border-top: 0; }
.run .cell-sub { grid-column: 1 / -1; }
.table tr.is-selected td { background: var(--brand-weak); }
.pop-anchor .popover { top: calc(100% + 4px); }
@media (max-width: 760px) {
  .run-strip { grid-template-columns: minmax(0, 1fr); }
  .run-strip > div + div { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 900px) {
  .ws { flex-direction: column; align-items: stretch; }
  .ws > * { min-width: 0; max-width: 100%; }
  .ws-lists, .ws-main { flex: none; width: 100%; }
  .page-header .row { flex-wrap: wrap; }
}

/* ---------- F+ÃÂÃÂÃÂÃÂ¦retagsdetaljer ---------- */
.co-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.co-mark { width: 44px; height: 44px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg-subtle); display: grid; place-items: center; font-weight: 600; color: var(--text-2); font-size: var(--fs-lg); flex: none; }
.co-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; color: var(--text-3); font-size: var(--fs); }
.co-meta span { display: inline-flex; align-items: center; gap: 6px; }
.fin-table th:first-child, .fin-table td:first-child { position: sticky; left: 0; background: var(--bg); z-index: 1; }
.fin-table th:first-child { background: var(--bg-subtle); }
.fin-table tr.grp td { background: var(--bg-subtle); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; height: 30px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-sm); color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ratio { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); min-width: 0; }
.ratio-label { font-size: var(--fs-sm); color: var(--text-3); }
.ratio-value { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.ratio-foot { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- Mobil verktygsf+ÃÂÃÂÃÂÃÂ±lt & navigation ---------- */
.nav-backdrop { display: none; }
.mobile-bar { display: none; }
.sidebar-close,
.filters-close { display: none; }
body.is-scroll-locked { overflow: hidden; }

/* ---------- Responsivt ---------- */
@media (max-width: 1180px) {
  .g-main-side { grid-template-columns: minmax(0, 1fr); }
  .ws { flex-wrap: wrap; }
  .ws-panel { flex: 1 1 100%; width: auto; }
}
@media (max-width: 1080px) {
  .search-layout { flex-direction: column; align-items: stretch; }
  .filters { display: none; width: auto; flex: none; max-width: none; }
  .filters.is-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 180;
    width: auto;
    max-height: none;
    border-radius: 0;
    border: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .filters-toggle { display: inline-flex; }
  .filters-close { display: inline-flex; }
  body.is-filters-open { overflow: hidden; }
  body.is-filters-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 170;
    background: rgba(15, 17, 22, .42);
  }
}
@media (max-width: 900px) {
  .app { flex-direction: column; min-height: 100dvh; min-height: 100vh; }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(15, 17, 22, .42);
  }
  .app.is-nav-open .nav-backdrop { display: block; }
  .nav-backdrop[hidden] { display: none !important; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 160;
    flex: none;
    width: min(292px, 88vw);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 10px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: var(--bg-app);
    border-right: 1px solid var(--border);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-108%);
    transition: transform .22s ease;
    box-shadow: var(--sh-pop);
  }
  .app.is-nav-open .sidebar { transform: translateX(0); }

  .sb-org,
  .sb-search,
  .nav-section,
  .sb-foot,
  .sb-demo,
  .nav-item.is-disabled {
    display: revert;
  }

  .sb-head { padding: 6px 8px 12px; align-items: flex-start; }
  .sidebar-close { display: inline-flex; margin-left: auto; flex: none; }
  .nav { flex-direction: column; }
  .nav-item { white-space: normal; min-height: 40px; height: auto; padding-top: 8px; padding-bottom: 8px; }
  .nav-count { margin-left: auto; }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    background: var(--bg-sheet);
    position: sticky;
    top: 0;
    z-index: 120;
  }
  .mobile-menu-btn { flex: none; width: 44px; height: 44px; padding: 0; }
  .mobile-bar-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: var(--fs-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .main { margin: 0; border: 0; border-radius: 0; box-shadow: none; flex: 1 1 auto; width: 100%; min-width: 0; }
  .topbar { display: none; }
  .page { padding: 16px 16px max(32px, env(safe-area-inset-bottom)); }
  .support-bar { padding: 10px 16px; font-size: var(--fs-sm); }

  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > .row,
  .page-header .filters-toggle { width: 100%; justify-content: center; }

  .ws { flex-direction: column; align-items: stretch; }
  .ws-lists, .ws-panel { width: auto; flex: none; }

  .table-wrap { -webkit-overflow-scrolling: touch; }
  .bulkbar {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 90;
    margin-top: 8px;
  }
}
@media (max-width: 640px) {
  .btn, .input, .select { height: 44px; min-height: 44px; }
  .btn-sm { height: 36px; min-height: 36px; }
  .page-title { font-size: 24px !important; line-height: 1.15; }
  .page-sub { font-size: var(--fs); }
  .block-hero .kpi-value { font-size: 48px; }
  .block .kpi-value { font-size: 36px; }
  .kpi-value { font-size: var(--fs-2xl); }
  .backdrop { padding-top: 24px; align-items: flex-end; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  dialog.dialog { max-width: calc(100% - 16px); margin: auto 8px; }
  .dialog-footer .btn { flex: 1 1 auto; min-width: calc(50% - 4px); }
  .co-head .row { width: 100%; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .table th, .table td { padding: 10px 8px; font-size: var(--fs-sm); }
  .truncate { max-width: 140px; }
  .exports-table .table { min-width: 720px; }
}
@media (min-width: 901px) {
  .sidebar-close,
  .nav-backdrop,
  .mobile-bar { display: none !important; }
  .sidebar { transform: none !important; }
}

.filters-head-actions { gap: 4px; flex-wrap: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  * { transition: none !important; }
  .sidebar { transition: none; }
}

/* Mina exporter */
a.tab { text-decoration: none; color: inherit; }
.exp-empty { padding: 48px 32px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.exp-empty-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--brand-weak); color: var(--brand-block); display: grid; place-items: center; margin-bottom: 6px; }
.exp-empty-icon svg { width: 36px; height: 36px; }
.exp-empty h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.exp-empty p { max-width: 460px; color: var(--text-3); font-size: var(--fs-md); }
.exp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); }
.exp-step { padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.exp-step + .exp-step { border-left: 1px solid var(--border); }
.exp-step-n { width: 26px; height: 26px; border-radius: 8px; background: var(--mint); color: #1D4A3A; display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 500; margin-bottom: 6px; }
.exp-step strong { font-size: var(--fs-md); font-weight: 600; }
.exp-step span { color: var(--text-3); font-size: var(--fs); }
.exp-progress { display: block; width: 96px; height: 4px; margin-top: 6px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; }
.exp-progress > span { display: block; height: 100%; background: var(--brand-block); transition: width .4s ease; }
.exp-export-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.exp-export-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--mint-weak); color: var(--mint-strong, #1D4A3A); display: grid; place-items: center; flex: none; }
.exp-export-title { display: block; font-weight: 600; }
@media (max-width: 760px) {
  .exp-steps { grid-template-columns: minmax(0, 1fr); }
  .exp-step + .exp-step { border-left: 0; border-top: 1px solid var(--border); }
  .exp-empty { padding: 36px 20px 24px; }
}

.export-progress { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 4px 0; }
.export-progress-bar { height: 100%; background: var(--pine); border-radius: 999px; transition: width .4s ease; }
.export-progress-indeterminate .export-progress-bar { width: 35%; animation: export-indeterminate 1.2s ease-in-out infinite; }
@keyframes export-indeterminate {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(120%); }
  100% { transform: translateX(250%); }
}
.filters-row .field { margin: 0; }

/* Inställningar › Mitt konto */
.settings { display: flex; flex-direction: column; }
.settings-row {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 760px);
  gap: 16px 40px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.settings-row:first-child { border-top: 0; padding-top: 8px; }
.settings-intro h2 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -.01em;
}
.settings-intro p {
  margin-top: 4px;
  color: var(--text-3);
  font-size: var(--fs);
  max-width: 280px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand-weak);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  flex: none;
}
.settings .pw-field { position: relative; }
.settings .pw-field .input { padding-right: 44px; }
.settings .pw-field .btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}
.rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.rules li { display: inline-flex; align-items: center; gap: 6px; }
.rules li svg { color: var(--border-strong); }
.rules li.ok { color: var(--ok-fg); }
.rules li.ok svg { color: var(--ok-fg); }
.inline-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 20px;
}
.inline-empty .empty-icon {
  background: var(--mint-weak);
  color: var(--mint-strong, #1f8a66);
}
.settings .field .field-validation-error,
.settings .field .help.neg {
  font-size: var(--fs-sm);
  color: var(--neg);
}
@media (max-width: 900px) {
  .settings-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}
@media (max-width: 760px) {
  .settings .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Startsida / dashboard – färgrutor och sökfält */
.dash-kpi { margin-bottom: 14px; }
.dash-status { margin-bottom: 18px; }
.dash-status-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.dash-status-compact .tile { min-height: 112px; }
.dash-search {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  padding: 6px;
  border-radius: var(--r-tile);
  background: var(--bg);
  box-shadow: var(--sh-card);
}
.dash-search .affix { flex: 1 1 240px; }
.dash-search .affix .input {
  height: 48px;
  border: 0;
  box-shadow: none;
  background: transparent;
  border-radius: calc(var(--r-tile) - 4px) 0 0 calc(var(--r-tile) - 4px);
}
.dash-search .btn {
  align-self: stretch;
  min-height: 48px;
  padding-left: 28px;
  padding-right: 28px;
  border-radius: calc(var(--r-tile) - 4px);
}
.dash-side-mint { min-height: 200px; }
.dash-side-mint .tile-value { font-size: 52px; }
.tile-status.tile-brand .tile-value { color: #FFFFFF; }
a.tile.tile-status:hover { transform: translateY(-1px); transition: transform .15s ease; }
.tile-sub { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-3); max-width: 28ch; line-height: 1.35; }
.tile-brand .tile-sub { color: rgba(255,255,255,.85); }
