/**
 * =============================================================================
 * Laconic - Huvudstilmall
 * =============================================================================
 * Modern, ljus design med fokus på läsbarhet och tillgänglighet.
 * Byggd utan externa bibliotek - ren CSS med custom properties.
 * 
 * STRUKTUR:
 * 1. CSS Custom Properties (designvariabler)
 * 2. Reset & bas
 * 3. Typografi
 * 4. Layout & Grid
 * 5. Komponenter (knappar, kort, formulär, etc.)
 * 6. Navigation
 * 7. Flash messages
 * 8. Cookie banner
 * 9. Frontend-specifikt
 * 10. Admin/Kundpanel
 * 11. Responsivitet
 * 12. Animationer
 * =============================================================================
 */

/* Logotypens typsnitt – själv-hostat (variabel woff2, täcker vikt 700–800) */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700 800;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
}

/* =============================================================================
   1. CSS CUSTOM PROPERTIES (DESIGNVARIABLER)
   Centrala variabler som styr hela designen.
   Ändra här för att uppdatera hela systemets utseende.
   ============================================================================= */

.brand-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    max-width: 100%;
    vertical-align: baseline;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    white-space: nowrap;
    --brand-topp-color: var(--color-primary);
}
.brand-symbol { width: 1.4em; height: 1.4em; object-fit: contain; flex-shrink: 0; }
.brand-topp { color: var(--brand-topp-color); }
.brand-dok { color: var(--color-cta); }
.sidebar-brand .brand-wordmark,
.footer-brand .brand-wordmark,
.navbar-overlay:not(.is-solid) .brand-wordmark,
.hero .brand-wordmark,
.section-alt .brand-wordmark { --brand-topp-color: #fff; }
.brand-symbol-light { display: none; }
.sidebar-brand .brand-symbol-light,
.footer-brand .brand-symbol-light,
.navbar-overlay:not(.is-solid) .brand-symbol-light,
.hero .brand-symbol-light,
.section-alt .brand-symbol-light { display: block; }
.sidebar-brand .brand-symbol-dark,
.footer-brand .brand-symbol-dark,
.navbar-overlay:not(.is-solid) .brand-symbol-dark,
.hero .brand-symbol-dark,
.section-alt .brand-symbol-dark { display: none; }
.business-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.business-card { display: flex; flex-direction: column; gap: 16px; border-radius: 8px; color: var(--color-text); }
.business-card h3 { font-size: 1.25rem; margin: 0; }
.business-card p { color: var(--color-text-muted); margin: 0; }
.business-card-link { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-weight: 600; }
.business-card .feature-list { margin: 0; }
.home-reviews { text-align: center; }
body.frontend .home-reviews { padding: 104px 0; }
.home-reviews-note { color: var(--color-text-muted); margin: 24px auto 64px; max-width: 720px; font-size: 0.875rem; }
.home-review-slides { display: grid; align-items: center; max-width: 960px; margin: 0 auto; overflow: hidden; text-align: center; }
.home-review { grid-area: 1 / 1; min-width: 0; margin: 0; padding: 24px 16px; opacity: 0; visibility: hidden; transform: translateX(-36px); transition: opacity 550ms ease, transform 700ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 700ms; }
.home-review.is-active { opacity: 1; visibility: visible; transform: translateX(0); transition-delay: 0s; }
.home-review blockquote { margin: 0; padding: 24px 0; font-size: 3.5rem; line-height: 1.5; }
.home-review blockquote p::before,
.home-review blockquote p::after { display: inline; font-family: Georgia, serif; font-size: 2em; line-height: 0; vertical-align: -0.15em; pointer-events: none; }
.home-review blockquote p::before { content: '\201C\00A0'; color: var(--color-primary); }
.home-review blockquote p::after { content: '\00A0\201D'; color: var(--color-cta); }
.home-review blockquote p { margin: 0; font-size: inherit; line-height: inherit; overflow-wrap: anywhere; }
.home-review figcaption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.home-review-dots { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin-top: 40px; }
.home-review-dot { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.home-review-dot::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--color-text-muted); opacity: 0.4; }
.home-review-dot-label { display: none; }
.home-review-dot.btn[aria-pressed="true"] { width: auto; height: auto; min-height: var(--control-height-lg); max-width: 100%; padding: 12px 2rem; border: 1.5px solid var(--color-bg-alt); border-radius: var(--radius-full); background: transparent; color: var(--color-bg-alt); font-family: var(--font-family); font-size: var(--font-size-base); font-weight: 700; line-height: 1.4; white-space: normal; }
.home-review-dot.btn[aria-pressed="true"]:hover { background: var(--color-primary-50); border-color: var(--color-bg-alt-hover); color: var(--color-bg-alt-hover); }
.home-review-dot[aria-pressed="true"]::before { display: none; }
.home-review-dot[aria-pressed="true"] .home-review-dot-label { display: inline; overflow-wrap: anywhere; }
.home-review-dot:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -4px; border-radius: 50%; }
@media (max-width: 700px) {
    body.frontend section.home-reviews { padding: 64px 0; }
    .home-review { padding: 16px 8px; }
    .home-review blockquote { padding: 0; font-size: 2rem; line-height: 1.35; }
    .home-review blockquote p { overflow-wrap: break-word; }
    .home-review figcaption { position: static; width: auto; height: auto; margin-top: 16px; overflow: visible; clip-path: none; white-space: normal; color: var(--color-text-muted); font-weight: 600; }
    .home-review-dot.btn[aria-pressed="true"],
    .home-review-dot.btn[aria-pressed="true"]:hover { width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; background: transparent; }
    .home-review-dot[aria-pressed="true"] .home-review-dot-label { display: none; }
    .home-review-dot[aria-pressed="true"]::before { display: block; background: var(--color-primary); opacity: 1; }
    .home-reviews-note { margin-bottom: 40px; }
}
.getting-started-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 32px 0; padding: 0; list-style: none; }
.getting-started-steps li { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.getting-started-number { flex-shrink: 0; font-size: 1.25rem; font-weight: 700; line-height: var(--line-height-tight); color: var(--color-primary); }
.getting-started-steps h3 { font-size: 1.25rem; margin: 0; }
.getting-started-steps p { color: var(--color-text-muted); margin: 0; }
body.frontend .home-faq { padding: 160px 0 80px; text-align: center; }
.home-faq-list { max-width: 800px; margin: 40px auto 0; text-align: left; }
.home-faq-item { padding: 20px 0; }
.home-faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; cursor: pointer; list-style: none; font-size: 1.125rem; font-weight: 600; }
.home-faq-item summary::-webkit-details-marker { display: none; }
.home-faq-item summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 6px; }
.home-faq-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; font-size: 1.5rem; line-height: 1; }
.home-faq-toggle::before { content: '+'; }
.home-faq-item[data-expanded="true"] .home-faq-toggle::before,
.home-faq-item[open]:not([data-expanded]) .home-faq-toggle::before { content: '\2212'; }
.home-faq-answer { padding-top: 16px; color: var(--color-text-muted); line-height: 1.7; }
.home-faq-answer p { margin: 0; }
body.frontend .getting-started { padding: 104px 0 96px; background: var(--color-text); color: var(--color-text-inverse); text-align: center; }
body.frontend .getting-started h2 { max-width: 900px; margin: 0 auto; color: inherit; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 3.5rem; line-height: 1.15; }
body.frontend .home-faq h2::after,
body.frontend .getting-started h2::after { margin-left: auto; margin-right: auto; left: 50%; transform: translateX(-50%); }
.getting-started .getting-started-steps { margin: 56px 0; gap: 32px; }
.getting-started .getting-started-steps li { justify-content: center; }
.getting-started .getting-started-number,
.getting-started .getting-started-steps h3 { font-size: 1.5rem; line-height: 1.3; }
.getting-started .getting-started-number { color: var(--color-cta); }
.getting-started .getting-started-steps h3 { color: inherit; }
body.frontend .getting-started .hero-actions { justify-content: center; gap: 16px; }
body.frontend .getting-started .btn-outline { color: #fff; border-color: #fff; }
body.frontend .getting-started .btn-outline:hover { background: #fff; color: var(--color-text); }
@media (max-width: 768px) {
    body.frontend section.home-faq { padding: 96px 0 48px; }
    .home-faq-list { margin-top: 24px; }
    body.frontend .getting-started { padding: 64px 0; }
    body.frontend .getting-started h2 { font-size: 2.25rem; }
    .getting-started .getting-started-steps { margin: 36px 0; gap: 24px; }
    .getting-started .getting-started-number,
    .getting-started .getting-started-steps h3 { font-size: 1.25rem; }
}
@media (max-width: 700px) {
    .getting-started-steps { grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 24px 0; }
}
.savings-section { background: var(--color-surface-raised); }
.savings-intro { font-size: 1.25rem; margin-top: 16px; }
.savings-disclaimer { max-width: 760px; color: var(--color-text-muted); margin: 12px 0 32px; }
.savings-bars { display: flex; align-items: flex-end; gap: 0; height: 750px; overflow-x: auto; padding: 0; }
.savings-bar { position: relative; display: flex; flex-direction: column; flex: 1 1 0; min-width: 150px; height: calc(var(--saving-percent) * 10px); padding: 24px; border: 0; border-radius: 8px 8px 0 0; background: #0A3766; color: #fff; cursor: pointer; overflow: hidden; clip-path: inset(calc((1 - var(--rise, 1)) * 100%) 0 0 0 round 8px 8px 0 0); }
.savings-bar > * { translate: 0 var(--rise-offset, 0px); }
.savings-bar-billing { background: #F89A5C; color: #021A3B; }
.savings-bar-followup { background: #0F766E; color: #fff; }
.savings-bar-quality { background: #E2F0FD; color: #021A3B; }
.savings-bar-placements { background: #475569; color: #fff; }
.savings-bar.is-active { flex-grow: 5; min-width: 560px; }
.savings-bar-label { font-size: 1rem !important; }
.savings-bar.is-active .savings-bar-label { font-size: 2.5rem !important; }
@media (max-width: 900px) {
    .savings-bar-label,
    .savings-bar.is-active .savings-bar-label { font-size: clamp(1.5rem, 8vw, 2rem) !important; }
}
.savings-bar-heading { margin: 0; font-size: 1rem; color: inherit; flex: 1; min-height: 0; }
.savings-bar-toggle { display: flex; flex-direction: column; align-items: flex-start; position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.savings-bar-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
.savings-bar-category { font-weight: 700; }
.savings-bar-percent { position: absolute; top: 48px; left: 0; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2.5rem; font-weight: 800; line-height: 1.2; white-space: nowrap; transition: top 1500ms cubic-bezier(0.4, 0, 0.2, 1), font-size 1500ms cubic-bezier(0.4, 0, 0.2, 1); }
.savings-bar.is-active .savings-bar-percent { top: calc(100% - 112px); font-size: 3.5rem; }
.savings-bar-caption { position: absolute; bottom: 0; left: 0; right: 0; font-size: 0.875rem; }
.savings-bar-body { position: absolute; top: 56px; bottom: 144px; left: 24px; right: calc(50% + 24px); min-height: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; opacity: 0; transform: translateX(12px); visibility: hidden; transition: opacity 600ms ease, transform 800ms ease, visibility 0s linear 600ms; }
.savings-bar.is-active .savings-bar-toggle { width: calc(50% - 24px); }
/* Samma diagonala söm som hero-sektionen */
.savings-bar-image { position: absolute; top: 0; right: 0; bottom: 0; width: 50%; height: 100%; object-fit: cover; object-position: center 30%; mask-image: var(--wave-image-mask); mask-size: 100% 100%; mask-repeat: no-repeat; opacity: 0; visibility: hidden; transition: opacity 600ms ease, visibility 0s linear 600ms; }
.savings-bar.is-active .savings-bar-image { opacity: 1; visibility: visible; transition: opacity 1000ms ease 600ms, visibility 0s linear; }
.savings-bar-body::-webkit-scrollbar { display: none; }
.savings-bar.is-active .savings-bar-body { opacity: 1; transform: translateX(0); visibility: visible; transition: opacity 800ms ease 650ms, transform 900ms cubic-bezier(0.2, 0.65, 0.3, 1) 650ms, visibility 0s linear; }
.savings-bar-body h4 { color: inherit; font-size: 1.25rem; margin: 0 0 12px; }
.savings-bar-body p { color: inherit; margin: 0 0 16px; }
@media (min-width: 1100px) {
    .savings-explanation p { font-size: 0.9375rem; line-height: 1.5; max-width: 46ch; }
}
@media (max-width: 900px) {
    .savings-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 85%; gap: 16px; align-items: stretch; height: auto; overflow: hidden; touch-action: pan-y; }
    .savings-bar,
    .savings-bar.is-active { min-width: 0; width: 100%; height: auto; padding: 24px; border-radius: 8px 8px 0 0; clip-path: none; transform: translateX(var(--mobile-offset, 0px)); transition: transform 900ms cubic-bezier(0.4, 0, 0.2, 1); cursor: default; }
    .savings-bar { margin-top: calc((75 - var(--saving-percent)) * 4px); }
    .savings-bar:last-child { width: calc(100% / 0.85); }
    .savings-bar > * { translate: none; }
    .savings-bar-heading { flex: 0 0 auto; }
    .savings-bar-toggle,
    .savings-bar.is-active .savings-bar-toggle { width: 100%; height: auto; gap: 8px; cursor: default; }
    .savings-bar-percent,
    .savings-bar.is-active .savings-bar-percent { position: static; font-size: 3rem; transition: none; }
    .savings-bar-caption { position: static; }
    .savings-bar-body,
    .savings-bar.is-active .savings-bar-body { position: static; overflow: visible; opacity: 1; visibility: visible; transform: none; transition: none; margin-top: 24px; }
    .savings-bar-image,
    .savings-bar.is-active .savings-bar-image { position: static; display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; mask-image: none; clip-path: none; border-radius: 8px; opacity: 1; visibility: visible; transition: none; margin-top: auto; }
}
@media (max-width: 1024px) { .business-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .business-cards { grid-template-columns: minmax(0, 1fr); } }

:root {
    --wave-panel-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'%3E%3Cpath fill='white' d='M0 0H1000C980 180 910 260 930 440S950 760 880 1000H0Z'/%3E%3C/svg%3E");
    --wave-image-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'%3E%3Cpath fill='white' d='M200 0C180 180 90 260 110 440S130 760 40 1000H1000V0Z'/%3E%3C/svg%3E");
    /* --- Primärfärger (Indigo) — interaktiv/text-färg --- */
    --color-primary: #0A3766;
    --color-primary-dark: #0A4985;
    --color-primary-light: #C7D2FE;
    --color-primary-50: #EEF2FF;
    /* Solid fyllnadsfärg för knappar/badges (vit text ovanpå) */
    --color-primary-fill: #4F46E5;
    --color-primary-fill-hover: #4338CA;

    /* --- Sekundärfärger (Slate) --- */
    --color-secondary: #475569;
    --color-secondary-dark: #334155;
    --color-secondary-light: #E2E8F0;

    /* --- Accentfärg (Teal) --- */
    --color-accent: #0F766E;
    --color-accent-dark: #115E59;
    --color-accent-light: #CCFBF1;

    /* --- Frontend-accent (orange) — bryter av det blå på marknadssidorna.
       OBS: orange kräver MÖRK text (navy) för läsbar kontrast, aldrig vit. --- */
    --color-cta: rgb(248, 154, 92);
    --color-cta-hover: rgb(233, 128, 60);

    /* --- Bakgrunder --- */
    --color-bg: #F8FAFC;
    --color-bg-alt: #0A3766;
    --color-bg-alt-hover: #0A4985;
    --color-surface: #f5f7fd;
    --color-surface-raised: #FFFFFF;

    /* --- Text --- */
    --color-text: #021A3B;
    --color-text-secondary: #E2F0FD;
    --color-text-muted: #3C5871;
    --color-text-inverse: #FFFFFF;

    /* --- Ramar --- */
    --color-border: #f2f6f8;
    --color-border-strong: #d7dde4;
    --color-border-focus: #180b00;
    /* Kompatibilitetsalias – äldre inline-stilar använder detta namn */
    --border-color: var(--color-border);

    /* --- Statusfärger (WCAG AA-verifierade) --- */
    --color-success: #166534;
    --color-success-bg: #F0FDF4;
    --color-success-border: #86EFAC;
    --color-error: #B91C1C;
    --color-error-bg: #FEF2F2;
    --color-error-border: #FCA5A5;
    --color-warning: #92400E;
    --color-warning-bg: #FFFBEB;
    --color-warning-border: #FCD34D;
    --color-orange: #9A3412;
    --color-orange-bg: #FFF7ED;
    --color-orange-border: #FDBA74;
    --color-info: #3730A3;
    --color-info-bg: #EEF2FF;
    --color-info-border: #A5B4FC;
    --topbar-color: #F8FAFC;

    /* --- Typografi (systemtypsnitt för skarp, tillförlitlig rendering) --- */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    --font-family-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', 'Cascadia Code', 'Courier New', monospace;
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */
    --line-height: 1.6;
    --line-height-tight: 1.25;

    /* --- Spacing --- */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* --- Kontrollhöjd (knappar + inputs) --- */
    --control-height-sm: 2rem;
    --control-height: 2.5rem;
    --control-height-lg: 3rem;

    /* --- Radie (stramare, mindre "bubblig") --- */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.375rem;  /* 6px */
    --radius-lg: 0.5rem;    /* 8px – knappar */
    --radius-xl: 0.75rem;   /* 12px – kort */
    --radius-2xl: 1rem;     /* 16px */
    --radius-full: 9999px;  /* cirkel – badges/avatar */

    /* --- Skuggor --- */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 20px -4px rgba(0, 0, 0, 0.07), 0 4px 8px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 24px 32px -8px rgba(0, 0, 0, 0.09), 0 8px 12px -6px rgba(0, 0, 0, 0.04);

    /* --- Övergångar (skarpare) --- */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 260ms cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Layout --- */
    --container-max: 1200px;
    --container-narrow: 800px;
    --sidebar-width: 230px;
    --header-height: 48px;
}

/* =============================================================================
   2. RESET & BAS
   ============================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-y: scroll;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-bg-alt);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-bg-alt-hover);
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

ul, ol {
    list-style: none;
}

/* =============================================================================
   3. TYPOGRAFI
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-tight);
    color: var(--color-text);
    font-weight: 700;
}

h1 {
    font-family: var(--font-family-heading);
    font-weight: 700;
}

h1 { font-size: 24px; margin-bottom: 20px; letter-spacing: -0.02em; }
h2 { font-size: 32px; margin-bottom: 20px; letter-spacing: -0.01em; }
h3 { font-size: var(--font-size-2xl); margin-bottom: 20px; }
h4 { font-size: var(--font-size-xl); margin-bottom: 20px; }
h5 { font-size: var(--font-size-lg); margin-bottom: 20px; }
h6 { font-size: var(--font-size-base); margin-bottom: 20px; }

p {
    margin-bottom: 20px;
    color: var(--color-text);
    font-size: 18px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: var(--font-size-sm); }
.text-large { font-size: var(--font-size-lg); }

/* =============================================================================
   4. LAYOUT & GRID
   ============================================================================= */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.section {
    padding: 128px 0;
}

.section-alt {
    background-color: var(--color-text-inverse);
}

/* Flexbox-hjälpklasser */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.flex-1 { flex: 1; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* CSS Grid */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* =============================================================================
   5. KOMPONENTER
   ============================================================================= */

/* --- Knappar --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: var(--control-height-sm);
    padding: 0 1.25rem;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1;
    border: 1.5px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn:hover {
    box-shadow: var(--shadow-md);
}

.btn:active {
    box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-bg-alt);
    color: var(--color-text-inverse);
}

.btn-primary:hover {
    background-color: var(--color-bg-alt-hover);
    color: var(--color-text-inverse);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-inverse);
}

.btn-secondary:hover {
    background-color: #1a7a9e;
    color: var(--color-text-inverse);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-bg-alt);
    color: var(--color-bg-alt);
}

.btn-outline:hover {
    background-color: var(--color-primary-50);
    border-color: var(--color-bg-alt-hover);
    color: var(--color-bg-alt-hover);
}
.btn-dropdown {
    background-color: transparent;
    color: var(--color-text-muted);
}
.btn-dropdown:hover {
    background-color: transparent !important;
    box-shadow:none;
}
.btn-ghost {
    background-color: transparent;
    color: var(--color-text-muted);
}

.btn-ghost:hover {
    background-color: var(--color-primary-50);
    color: var(--color-primary);
}

.btn-ghost.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.btn-danger {
    background-color: var(--color-error);
    color: var(--color-text-inverse);
}

.btn-danger:hover {
    background-color: #b42c2c;
    color: var(--color-text-inverse);
}

.btn-danger-outline {
    background-color: #fff;
    border-color: var(--color-error);
    color: var(--color-error);
}

.btn-danger-outline:hover {
    background-color: var(--color-error);
    border-color: var(--color-error);
    color: var(--color-text-inverse);
}

/* Sorterbara tabellrubriker */
.table-sort {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}
.table-sort:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Klickbar sortering direkt på kolumnrubriken (Laconic.initTableSort) */
.table th.is-sortable {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.btn-sm {
    height: var(--control-height-sm);
    padding: 0 0.875rem;
    font-size: var(--font-size-xs);
}

.btn-lg {
    height: var(--control-height-lg);
    padding: 0 2rem;
    font-size: var(--font-size-base);
}

/* --- CTA hover-effekt (frontend, enbart primary) --- */
body.frontend .btn-primary.btn-lg,
body.frontend .navbar-nav .btn-primary {
    position: relative;
    background-color: var(--color-cta);
    color: #061D37;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: box-shadow 0.18s ease, padding-right 0.1s ease, background-color 0.18s ease;
}

body.frontend .btn-primary.btn-lg::after,
body.frontend .navbar-nav .btn-primary::after {
    content: "";
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.4em;
    height: 1.4em;
    opacity: 0;
    transition: opacity 0.05s ease;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 12H18M18 12L13 7M18 12L13 17' stroke='%23061D37' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

body.frontend .btn-primary.btn-lg:hover,
body.frontend .navbar-nav .btn-primary:hover {
    padding-right: 2.8rem;
    background-color: var(--color-cta-hover);
    color: #061D37;
    transition: box-shadow 0.18s ease, padding-right 0.18s ease, background-color 0.18s ease;
}

body.frontend .btn-primary.btn-lg:hover::after,
body.frontend .navbar-nav .btn-primary:hover::after {
    opacity: 1;
    transition: opacity 0.18s ease;
}

/* Navbar-CTA: egen balanserad storlek (fyller inte hela 48px-baren) */
body.frontend .navbar-nav .btn-primary {
    height: var(--control-height);
    padding: 0 1.5rem;
    font-size: var(--font-size-sm);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Kort --- */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.card-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}
/* Alla kortrubriker i panelen: ikon + text vänsterställt på en rad */
.app-layout .card-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* --- Statistik-/KPI-kort --- */
.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    color: var(--color-bg-alt-hover);
    flex-shrink: 0;
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Disable transitions during initial page load */
.card-no-transition .card-toggle,
.card-no-transition .card-collapsible-body,
.card-no-transition .card-toggle-btn,
.card-no-transition .card-toggle-chevron {
    transition: none !important;
}

/* Collapsible cards */
.card-title.card-toggle,
.card-header.card-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-sm);
    user-select: none;
    -webkit-user-select: none;
    transition: margin-bottom 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                padding-bottom 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-title.card-toggle {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.card.card-collapsed .card-toggle {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
}

.card-toggle .card-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    background: var(--color-bg);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    transition: background 0.5s ease, color 0.5s ease;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 1;
    white-space: nowrap;
}

.card-toggle .card-toggle-btn .card-toggle-chevron {
    font-size: 1.1rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.card-toggle:hover .card-toggle-btn {
    background: var(--color-border);
    color: var(--color-text);
}

.card.card-collapsed .card-toggle-btn .card-toggle-chevron {
    transform: rotate(-90deg);
}

.card-collapsible-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.card.card-collapsed .card-collapsible-body {
    grid-template-rows: 0fr;
    opacity: 0;
}

.card-collapsible-body > .card-collapsible-inner {
    overflow: hidden;
}

/* Allow dropdowns to overflow once the expand animation finishes */
.card:not(.card-collapsed) > .card-collapsible-body > .card-collapsible-inner {
    overflow: visible;
}

/* When card-header is the toggle, keep the title inline */
.card-header.card-toggle .card-title {
    margin-bottom: 0;
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.card-body {
    margin-bottom: var(--space-lg);
}

.card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: 1;
}
/* --- Listinställningar (settings panel) --- */
.list-settings-panel {
    padding: var(--space-lg);
    margin: 0 calc(-1 * var(--space-xl)) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* --- List toolbar (filter + actions i card-header) --- */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.list-toolbar-actions {
    display: flex;
    align-items: stretch;
    gap: var(--space-sm);
}

.list-toolbar-actions .btn {
    white-space: nowrap;
}

.list-toolbar-actions .btn,
.list-toolbar-actions .form-input {
    height: var(--control-height-sm);
    padding: 0 0.625rem;
    font-size: var(--font-size-sm);
}

.form-input-sm {
    height: var(--control-height-sm);
    padding: 0 0.625rem;
    font-size: var(--font-size-sm);
}

.list-settings-checkbox {
    display: flex;
    align-items: center;
    padding: var(--space-xs) 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.list-settings-checkbox input[type="checkbox"] {
    cursor: pointer;
}

/* --- Formulär --- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
}

.form-label .required {
    color: var(--color-error);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: var(--control-height-sm);
    padding: 0 1rem;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: 1.5px solid var(--color-bg-alt);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-fast);
    appearance: none;
    box-sizing: border-box;
}

.form-textarea,
textarea.form-input {
    height: auto;
    min-height: 7rem;
    padding: 0.5rem 0.75rem;
    line-height: var(--line-height);
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    background-color: #fafafa;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-error);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

/* Sökbar Select (Combobox) */
.searchable-select {
    position: relative;
}

.searchable-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 14rem;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border-focus);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}

.searchable-select-item {
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
    cursor: pointer;
    color: var(--color-text);
}

.searchable-select-item:hover,
.searchable-select-item.highlighted {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.searchable-select-item.selected {
    font-weight: 600;
}

.searchable-select-empty {
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-style: italic;
}

.form-hint {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.form-error {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-error);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    accent-color: var(--color-primary);
}

.contact-section .form-checkbox input[type="checkbox"],
.quote-contact .form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    border-color: var(--color-primary);
    border-radius: 50%;
}

/* --- Custom checkbox styling --- */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    border: 1.5px solid var(--color-bg-alt);
    border-radius: 50%;
    background: var(--color-surface);
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    margin: 0;
    margin-right: 0.4rem;
    vertical-align: middle;
}
input[type="checkbox"]:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(10, 95, 130, 0.1);
}
input[type="checkbox"]:checked {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    box-shadow: 0 1px 3px rgba(10, 95, 130, 0.3);
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 0.1rem;
    left: 0.25rem;
    width: 0.3rem;
    height: 0.55rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(42deg);
}
input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 95, 130, 0.25);
}

/* --- Tabeller --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    background-color: var(--color-bg-alt);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.table tbody tr:nth-child(even) {
    background-color: #ededf3;
}

.table tbody tr:hover {
    background-color: var(--color-primary-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-clickable tbody tr {
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

/* Färgkodade tabellrader */
.table tbody tr.row-paused {
    background-color: var(--color-info-bg, #e9ecfb);
}
.table tbody tr.row-paused:hover {
    background-color: var(--color-primary-50);
}

/* Utskrivning-cell: text färgas efter status istället för hela raden */
.cell-utskrivning {
    font-variant-numeric: tabular-nums;
}
.cell-utskrivning.is-overdue {
    color: var(--color-error);
    font-weight: 700;
}
.cell-utskrivning.is-expiring {
    color: var(--color-orange);
    font-weight: 500;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --- Badges / Etiketter ---
   Fasta färger (mörk text på ljus tint) så kontrasten alltid uppfyller WCAG AA. */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: 700;
    border-radius: var(--radius-full);
    line-height: 1.5;
    background-color: #E2E8F0;
    color: #334155;
    border: 1px solid #CBD5E1;
}

.badge-success {
    background-color: #47E199;
    color: #062D1A;
}

a.badge,
a.badge:hover,
a.badge:focus {
    color: #062D1A;
    text-decoration: none;
}

.badge-error {
    background-color: #AB2121;
    color: #FFFFFF;
}

.badge-warning {
    background-color: #FFEE38;
    color: #473F00;
}

.badge-info {
    background-color: #38BDFF;
    color: #00273D;
}

.badge-danger {
    background-color: #AB2121;
    color: #FFFFFF;
}

.badge-orange {
    background-color: #f89a5c;
    color: #341804;
}

/* --- Client Auto-suggest Dropdown --- */
.client-suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 4px;
}
.client-suggest-item {
    padding: 8px 14px;
    cursor: default;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}
.client-suggest-item:last-child {
    border-bottom: none;
}
.client-suggest-item:hover {
    background: var(--color-primary-50);
}
.client-suggest-name {
    font-weight: 600;
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: var(--color-surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-appear 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
}

.modal-header .modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    font-size: var(--font-size-xl);
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.modal-header .modal-close:hover {
    color: var(--color-text);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--color-border);
}

/* --- Diagram (Chart.js) --- */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.chart-container-bar {
    height: 280px;
}

.chart-container-doughnut {
    height: 260px;
    max-width: 360px;
    margin: 0 auto;
}

.chart-details {
    margin-top: var(--space-md);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-sm);
}

.chart-details summary {
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    padding: var(--space-xs) 0;
    user-select: none;
    transition: color var(--transition-fast);
}

.chart-details summary:hover {
    color: var(--color-primary);
}

.chart-details[open] summary {
    margin-bottom: var(--space-xs);
}

.chart-tooltip {
    position: absolute;
    display: none;
    background: rgba(30, 41, 59, 0.92);
    color: #fff;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =============================================================================
   6. NAVIGATION
   ============================================================================= */

/* --- Toppmeny (Frontend) --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

/* Flytande topp-gap även på undersidor (solid meny, mörk text).
   ::before maskar gapet med sidbakgrunden så innehåll inte tittar fram ovanför. */
.navbar:not(.navbar-overlay) {
    box-shadow: var(--shadow-sm);
}

.navbar:not(.navbar-overlay)::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 16px;
    background: var(--color-bg);
}

/* Transparent överliggande meny på startsidan (ligger över hero-bilden) */
.navbar-overlay {
    position: fixed;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom-color: transparent;
    transition: background var(--transition-normal),
                border-color var(--transition-normal),
                box-shadow var(--transition-normal),
                top var(--transition-normal);
}

.navbar-overlay .navbar-brand,
.navbar-overlay .navbar-link,
.navbar-overlay .navbar-mega-toggle {
    color: #fff;
}

.navbar-overlay .navbar-link:hover,
.navbar-overlay .navbar-mega-toggle:hover {
    color: rgba(255, 255, 255, 0.78);
}

.navbar-overlay .navbar-toggle span {
    background-color: #fff;
}

/* När sidan scrollats förbi hero-bilden → solid meny med mörk text igen */
.navbar-overlay.is-solid {
    top: 0;
    background: var(--color-surface);
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.navbar-overlay.is-solid .navbar-brand {
    color: var(--color-primary-dark);
}

.navbar-overlay.is-solid .navbar-link,
.navbar-overlay.is-solid .navbar-mega-toggle {
    color: var(--color-text);
}

.navbar-overlay.is-solid .navbar-toggle span {
    background-color: var(--color-text);
}

.navbar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 0 auto;
    padding: 0 var(--space-lg);
    gap: 100px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: 'Plus Jakarta Sans', var(--font-family);
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-primary-dark);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
}

.navbar-nav .btn {
    margin-left: auto;
}

.navbar-link {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s ease;
}

.navbar-link:hover {
    color: var(--color-bg-alt);
}

.navbar-link.active {
    color: var(--color-primary);
}

/* Amber understrykning på nav-länkar vid hover/aktiv (frontend) */
body.frontend .navbar-link {
    position: relative;
}

body.frontend .navbar-link::after {
    content: "";
    position: absolute;
    left: var(--space-md);
    right: var(--space-md);
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-cta);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

body.frontend .navbar-link:hover::after,
body.frontend .navbar-link.active::after {
    transform: scaleX(1);
}

/* Aktiva länkar förblir vita i overlay-läget (syns mot mörk hero); blå när menyn blivit solid */
.navbar-overlay .navbar-link.active,
.navbar-overlay .navbar-mega-toggle.active {
    color: #fff;
}

.navbar-overlay.is-solid .navbar-link.active,
.navbar-overlay.is-solid .navbar-mega-toggle.active {
    color: var(--color-primary);
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-sm);
    border: none;
    background: none;
    cursor: pointer;
}

.navbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

/* --- Sidopanel (Admin/Kund) --- */
.app-layout {
    position: fixed;
    inset: 0;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-bg-alt);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-lg);
    height: var(--header-height);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: var(--font-size-lg);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text-inverse);
}
.sidebar-brand:hover {
    color: var(--color-text-secondary);
}

.sidebar-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    background-color: var(--color-primary-fill);
    color: var(--color-text-inverse);
    border-radius: var(--radius-full);
}

.sidebar-nav {
    flex: 1 1 auto;
    padding-left: var(--space-sm);
    padding-top: var(--space-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-category-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    margin: 1px 0;
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    list-style: none;
}
.sidebar-category-label { flex: 1; min-width: 0; }
.sidebar-category-title::-webkit-details-marker { display: none; }
.sidebar-category-title:focus-visible { outline: 2px solid var(--color-cta); outline-offset: -2px; }
.sidebar-category-toggle { position: relative; flex-shrink: 0; width: 12px; height: 12px; }
.sidebar-category-toggle::before,
.sidebar-category-toggle::after { content: ''; position: absolute; top: 5px; left: 0; width: 12px; height: 2px; border-radius: 1px; background: currentColor; transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-category-toggle::after { transform: rotate(90deg); }
.sidebar-category[data-expanded="true"] .sidebar-category-toggle::after,
.sidebar-category[open]:not([data-expanded]) .sidebar-category-toggle::after { transform: rotate(0deg); }
.sidebar-subheading { display: block; padding: 10px 12px 4px 1.625rem; font-size: 0.75rem; font-weight: 600; color: var(--color-text-secondary); }
details.sidebar-category > .sidebar-link { padding-left: 1.625rem; }
.sidebar-category.sidebar-section { margin-bottom: 4px; }


.sidebar-section-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: rgba(226, 240, 253, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--space-sm) var(--space-sm) var(--space-xs);
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    margin: 1px 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text-secondary);
    border-radius: var(--radius-lg);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-link:hover {
    color: var(--color-text-inverse);
}

.sidebar-link.active {
    background-color: var(--color-primary-50);
    color: var(--color-bg-alt);
    font-weight: 600;
}

.sidebar-link-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.sidebar-link-icon svg {
    width: 100%;
    height: 100%;
}

.sidebar-link:hover .sidebar-link-icon {
    color: var(--color-text-secondary);
}

.sidebar-link.active .sidebar-link-icon {
    color: var(--color-bg-alt);
}

/* Generell inline-ikon (SVG) */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: var(--space-sm);
}

/* Kompakt användarinfo nere i sidopanelen */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
}

.sidebar-user-avatar svg {
    width: 1rem;
    height: 1rem;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.sidebar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-inverse);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-org {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Huvudinnehåll med sidopanel */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--color-bg-alt);
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-xl);
    background-color: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 40;
}

/* =============================================================================
   TOPBAR-NOTISER (DRY: en enda mekanism för spara/fel/varning/info/påminnelser)
   - Gradient-sweep i bakgrunden (topbar-sweep)
   - Färgad titel
   - Färgad inline-text i topbar-raden
   Skillnad mellan typerna = bara färg.
   ============================================================================= */

@keyframes topbar-sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

.app-topbar-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

/* Gemensam gradient-bas för alla topbar-notistyper */
.topbar-has-flash::before,
.topbar-has-reminders::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    pointer-events: none;
    z-index: -1;
    animation: topbar-sweep 0.5s ease-out forwards;
}

/* Typspecifika färger */
.topbar-flash-state-success::before {
    background: linear-gradient(90deg, transparent, var(--color-success-bg) 30%, #47E199 70%, transparent);
}
.topbar-flash-state-error::before {
    background: linear-gradient(90deg, transparent, var(--color-error-bg) 30%, #AB2121 70%, transparent);
}
.topbar-flash-state-warning::before,
.topbar-has-reminders::before {
    background: linear-gradient(90deg, transparent, var(--color-warning-bg) 30%, #FFEE38 70%, transparent);
}
.topbar-flash-state-info::before {
    background: linear-gradient(90deg, transparent, var(--color-info-bg) 30%, #38BDFF 70%, transparent);
}

/* Titelfärg matchar notistyp */
.topbar-flash-state-success .app-topbar-title { color: var(--color-success); }
.topbar-flash-state-error   .app-topbar-title { color: var(--color-error); }
.topbar-flash-state-warning .app-topbar-title { color: var(--color-warning); }
.topbar-flash-state-info    .app-topbar-title { color: var(--color-info); }


.topbar-reminder-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar-reminder-bell {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15em;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: background 0.15s;
    font-family: inherit;
}

.topbar-reminder-bell:hover {
    background: rgba(255, 193, 7, 0.15);
}

.topbar-reminder-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.topbar-reminder-count {
    background: var(--color-warning);
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.topbar-reminder-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    min-width: 320px;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.topbar-reminder-wrapper.open .topbar-reminder-dropdown {
    display: block;
    animation: reminderDropIn 0.2s ease-out;
}

@keyframes reminderDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.topbar-reminder-header {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    font-size: var(--font-size-sm);
}

.topbar-reminder-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--color-border-light, var(--color-border));
}

.topbar-reminder-item:last-of-type {
    border-bottom: none;
}

.topbar-reminder-link {
    flex: 1;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    line-height: 1.4;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    width: 100%;
    transition: background 0.15s;
}

.topbar-reminder-link:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.topbar-reminder-more {
    display: block;
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.topbar-reminder-more:hover {
    background: var(--color-primary-light);
}

.app-topbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Ikon-knappar i topbarens övre högra hörn (hjälp, logga ut) */
.topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-height-sm);
    height: var(--control-height-sm);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.topbar-icon-btn svg {
    width: 1.15rem;
    height: 1.15rem;
}
.topbar-icon-btn:hover {
    background-color: var(--color-primary-50);
    color: var(--color-bg-alt);
}
.topbar-icon-btn.active {
    background-color: var(--color-primary-50);
    color: var(--color-bg-alt);
}

/* Verksamhetsväxlare i toppbar */
.facility-switcher {
    display: flex;
    align-items: center;
}
.facility-switcher-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: 4px 28px 4px 12px;
    font-size: var(--font-size-xs);
    color: var(--color-text);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all var(--transition-normal);
}
.facility-switcher-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 44, 163, 0.12);
}

.app-content {
    flex: 1;
    min-height: 0;
    /* Boxen scrollas inte av användaren själv – fönstrets scrollbar styr den
       via JS (Laconic.initAppScroll). overflow:hidden gör fönstret till den
       ENDA användar-scrollytan så att scrollen inte "fastnar". */
    overflow: hidden;
    padding: 0;
    margin: 0 var(--space-xl) var(--space-xl);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    /* Den inre scrollbaren döljs – fönstrets egen scrollbar (längst till
       höger) styr scrollen via JS (Laconic.initAppScroll). */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.app-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* --- Kompakt dashboard: vita, rundade lådor på den blå bakgrunden --- */
.app-content.app-dashboard {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* Behåll marginaler/gap på dashboarden (backend-layouten nollar dem annars) */
.app-content.app-dashboard .mb-lg {
    margin-bottom: var(--space-lg);
}

.app-content.app-dashboard .grid {
    gap: var(--space-lg);
}

/* Dashboard-lådorna ska vara rundade kort (backend-layouten gör kort platta) */
.app-layout .card.dashboard-box {
    display: flex;
    flex-direction: column;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
}

.dashboard-box .card-title {
    margin-bottom: var(--space-md);
}

.dashboard-box .table {
    margin-bottom: 0;
}

.dashboard-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: start;
}

@media (max-width: 768px) {
    .dashboard-tables {
        grid-template-columns: 1fr;
    }
}

.dashboard-subhead {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.dashboard-box-footer {
    margin-top: auto;
    padding-top: var(--space-md);
}

/* Osynlig höjd-spacer som ger själva fönstret en naturlig scrollbar.
   Höjden sätts av JS så att fönstrets scrollintervall = boxens. */
.app-scroll-spacer {
    width: 1px;
    visibility: hidden;
    pointer-events: none;
}

/* Vid utskrift: låt allt flyta normalt (fast positionering bryter print) */
@media print {
    .app-layout { position: static; overflow: visible; }
    .app-main { height: auto; overflow: visible; }
    .app-content { overflow: visible; }
    .app-scroll-spacer { display: none !important; }
    .isms-toolbar, .isms-pager, .isms-versions { display: none !important; }
    body:has(.isms-doc) .sidebar,
    body:has(.isms-doc) .app-topbar-wrapper { display: none !important; }
}

/* --- Ledningssystem (ISO 27001) --- */
.isms-toolbar,
.isms-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); }
.isms-doc { max-width: 1100px; line-height: 1.65; }
.isms-doc h1 { font-size: 1.75rem; margin: 0 0 var(--space-md); }
.isms-doc h2 { font-size: 1.3rem; margin: var(--space-xl) 0 var(--space-sm); padding-bottom: 6px; border-bottom: 1px solid var(--color-border); }
.isms-doc h3 { font-size: 1.1rem; margin: var(--space-lg) 0 var(--space-sm); }
.isms-doc h4 { font-size: 1rem; margin: var(--space-md) 0 var(--space-xs); }
.isms-doc p { margin: 0 0 var(--space-sm); }
.isms-doc ul, .isms-doc ol { margin: 0 0 var(--space-md); padding-left: 1.4rem; }
.isms-doc li { margin-bottom: 4px; }
.isms-doc li.isms-check { list-style: none; margin-left: -1.2rem; }
.isms-doc code { padding: 1px 5px; border-radius: 4px; background: var(--color-surface); font-size: 0.875em; overflow-wrap: anywhere; }
.isms-doc .isms-code { padding: var(--space-md); border-radius: 8px; background: var(--color-text); color: #fff; overflow-x: auto; }
.isms-doc .isms-code code { padding: 0; background: none; color: inherit; }
.isms-doc .isms-note { margin: 0 0 var(--space-md); padding: var(--space-sm) var(--space-md); border-left: 4px solid var(--color-cta); background: var(--color-surface); }
.isms-doc .isms-table { font-size: 0.875rem; margin-bottom: var(--space-md); }
.isms-doc .isms-table th, .isms-doc .isms-table td { vertical-align: top; }
.isms-meta { margin-top: var(--space-lg); }
.isms-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875rem; line-height: 1.5; }
.isms-versions ul { margin: 0; padding-left: 1.2rem; }

/* --- Kompakt backend-layout: paneler istället för flytande kort --- */
.app-layout .card {
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-lg);
}

.app-layout .card:hover {
    box-shadow: none;
    transform: none;
}

.app-layout .card .card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.app-layout .mb-lg,
.app-layout .mb-xl,
.app-layout .mb-md {
    margin-bottom: 0;
}

.app-layout .mb-0 {
    margin-bottom: 0 !important;
}

.app-layout .grid {
    gap: var(--space-md);
}

.app-layout .card-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
}

.app-layout .card-header.card-toggle {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
}

.app-layout .card-title.card-toggle {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
}

.app-layout .card.card-collapsed .card-toggle {
    margin-bottom: 0;
    padding-bottom: 0;
}

.app-layout .card-toggle .card-toggle-btn {
    background: var(--color-border-light, #f1f5f9);
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-sm);
}

.app-layout .card-toggle:hover .card-toggle-btn {
    background: var(--color-border);
}

.app-layout .card-body {
    margin-bottom: var(--space-md);
}

.app-layout .card-footer {
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
}

.app-layout .form-group {
    margin-bottom: var(--space-md);
}

.app-layout .list-settings-panel {
    margin-left: calc(-1 * var(--space-lg));
    margin-right: calc(-1 * var(--space-lg));
    padding: var(--space-lg) var(--space-xl);
    border-radius: 0;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   7. FLASH MESSAGES
   ============================================================================= */

/* Wrapper: håller topbar som EN fast header-enhet ovanför scrollytan */
.app-topbar-wrapper {
    flex-shrink: 0;
    position: relative;
    z-index: 40;
    background-color: var(--color-bg-alt);
    padding-bottom: var(--space-lg);
}

.app-topbar-wrapper .app-topbar {
    position: relative;
    background-color: transparent;
}

.app-topbar-left {
    min-width: 0;
    flex: 1;
}

/* Flash messages – inline i topbar-raden (bredvid menyknapp) */
.topbar-flash-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    min-width: 0;
}

.topbar-flash {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: var(--font-size-sm);
    font-weight: 600;
    max-width: 100%;
}

.topbar-flash-success { color: var(--topbar-color); background: transparent; }
.topbar-flash-error   { color: var(--topbar-color);   background: transparent; }
.topbar-flash-warning { color: var(--topbar-color); background: transparent; }
.topbar-flash-info    { color: var(--topbar-color);    background: transparent; }

.topbar-flash-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Statisk inline-notisruta (samma färgsystem som topbar-flash men som blockelement).
   Används av t.ex. install/login-sidor och inline-varningar i sidinnehållet. */
.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
}
.flash-success { background-color: var(--color-success-bg); color: var(--color-success); border: 1px solid #BBF7D0; }
.flash-error   { background-color: var(--color-error-bg);   color: var(--color-error);   border: 1px solid #FECACA; }
.flash-warning { background-color: var(--color-warning-bg); color: var(--color-warning); border: 1px solid #FDE68A; }
.flash-info    { background-color: var(--color-info-bg);    color: var(--color-info);    border: 1px solid #b9c1f4; }

/* =============================================================================
   8. COOKIE BANNER
   ============================================================================= */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: var(--space-lg) var(--space-xl);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.cookie-banner-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    flex: 1;
}

.cookie-banner-text a {
    font-weight: 600;
}

.cookie-banner-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* =============================================================================
   9. FRONTEND-SPECIFIKT
   ============================================================================= */

/* --- Frontend: Större & luftigare typografi och spacing --- */
body.frontend {
    --container-max: 1320px;
    --font-size-xs: 0.8rem;
    --font-size-sm: 0.9375rem;
    --font-size-base: 1.0625rem;
    --font-size-lg: 1.1875rem;
    --font-size-xl: 1.375rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2.25rem;
    --font-size-4xl: 2.75rem;
    --font-size-5xl: 3.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 2.75rem;
    --space-2xl: 4rem;
    --space-3xl: 5.5rem;
    --space-4xl: 8rem;
}

/* --- Hero-sektion --- */
.hero {
    padding: 128px 0;
    background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-surface) 50%, var(--color-secondary-light) 100%);
}

/* --- Startsidans hero med bakgrundsbild bakom menyn --- */
.hero-image {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: max(70vh, 480px);
    margin-top: calc(-1 * var(--header-height));
    padding: calc(var(--header-height) + 80px) 0 96px;
    background: none;
}

/* Bildband som fyller hero-boxen. Mörk scrim från vänster (bakom texten)
   tonar ut åt höger så bilden syns kvar; mjuk bottenuttoning mot sidbakgrunden. */
.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background:
        linear-gradient(180deg,
            transparent 55%,
            rgba(248, 250, 252, 0) 62%,
            var(--color-bg) 100%),
        linear-gradient(95deg,
            rgba(2, 26, 59, 0.88) 0%,
            rgba(2, 26, 59, 0.74) 26%,
            rgba(2, 26, 59, 0.45) 48%,
            rgba(2, 26, 59, 0.12) 68%,
            transparent 82%),
        url('../img/hero-image.jpg') center 30% / cover no-repeat;
}

.hero-image-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-image-content {
    max-width: 720px;
    text-align: left;
    color: #fff;
    text-shadow: 0 1px 14px rgba(2, 26, 59, 0.45);
}

.hero-image-content .hero-title {
    font-size: 36px;
    color: var(--color-cta);
    margin-bottom: 12px;
}

.hero-image-content .hero-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 32px;
}

.hero-image-content .hero-actions {
    justify-content: flex-start;
}

/* Sekundär hero-knapp (outline) måste synas mot den mörka bilden */
.hero-image-content .hero-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.hero-image-content .hero-actions .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: #fff;
    color: #fff;
}

/* Startsidans hero-rubrik ligger över bilden */
.hero-title {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--color-text);
    line-height: 1.15;
}

.hero-image-content h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.94);
    margin-bottom: 20px;
}

/* Utbrett: frontend går kant till kant (ingen centrerad maxbredd) */
body.frontend .container {
    max-width: none;
    padding-left: clamp(24px, 5vw, 120px);
    padding-right: clamp(24px, 5vw, 120px);
}

.contact-methods { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.contact-phone h2 { font-size: 1.5rem; margin-bottom: 16px; }
.contact-phone-link { display: inline-flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 600; }
.contact-phone-link span { white-space: nowrap; }
@media (min-width: 1025px) {
    body.frontend .contact-section > .container > * {
        width: 50%;
        max-width: 720px;
        margin-left: 0;
        margin-right: 0;
    }
    body.frontend .contact-section > .container > .contact-methods {
        width: 100%;
        max-width: none;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .contact-methods > .card { width: 100%; max-width: 720px; }
}

body.frontend .navbar-inner {
    max-width: none;
    padding-left: clamp(24px, 5vw, 120px);
    padding-right: clamp(24px, 5vw, 120px);
}

body.frontend .navbar-mega-inner {
    max-width: none;
    padding-left: clamp(24px, 5vw, 120px);
    padding-right: clamp(24px, 5vw, 120px);
}

/* === Split-screen hero (prototyp): navy textpanel + foto med diagonal söm === */
.hero-split {
    position: relative;
    min-height: max(52vh, 440px);
    margin-top: calc(-1 * var(--header-height));
    overflow: hidden;
    padding: 0;
    background: none;
}

/* Mjuk topp-toning bakom menyn så den förblir läsbar utan hård blå kant på bilden */
.hero-split::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + 72px);
    z-index: 1;
    pointer-events: none;
}

.hero-split-media {
    position: absolute;
    inset: 0 0 0 45%;
    background: url('../img/hero-image.jpg') center 30% / cover no-repeat;
}

.hero-split-text {
    position: relative;
    z-index: 2;
    width: 58%;
    min-height: inherit;
    display: flex;
    align-items: flex-end;
    /* Vänsterkant i linje med full-breddskanten; texten förankras ~80px från botten */
    padding: calc(var(--header-height) + 56px) clamp(24px, 5vw, 72px)
             80px clamp(24px, 5vw, 120px);
    background: linear-gradient(135deg, #062647 0%, #051f3a 55%, #04182d 100%);
    mask-image: var(--wave-panel-mask);
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
}

.hero-split-inner {
    max-width: 560px;
    color: #fff;
}

.hero-split-text .hero-title {
    font-size: clamp(32px, 4vw, 44px);
    color: var(--color-cta);
    margin-bottom: 14px;
}

.hero-split-text h2 {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.94);
    margin-bottom: 20px;
}

.hero-split-text .hero-subtitle {
    font-size: 18px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 32px;
}

.hero-split-text .hero-actions {
    justify-content: flex-start;
}

.hero-split-text .hero-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.hero-split-text .hero-actions .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: #fff;
    color: #fff;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--color-text);
    margin: 0 0 48px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
}

.hero-actions .cta-slot {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

/* --- Feature-kort --- */
.feature-card {
    text-align: center;
    padding: 64px 44px;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    color: var(--color-primary);
}

.feature-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-description {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    line-height: var(--line-height);
}

/* --- Screenshots/Media --- */
.media-showcase {
    margin: 64px auto;
    max-width: 900px;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
}

.media-showcase img {
    width: 100%;
    display: block;
}

/* --- Hero (smaller variant for subpages) --- */
.hero-sm {
    padding: 128px 0 88px;
}

/* Undersidornas hero får samma split-design som startsidan: navy text-panel
   till vänster (diagonal söm) + foto till höger. Enbart CSS – ingen markup-ändring. */
body.frontend .hero-sm {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    min-height: max(52vh, 440px);
    margin-top: calc(-1 * var(--header-height));
    padding: calc(var(--header-height) + 56px) 0 80px;
    background: none;
}

/* Foto – höger halva (samma placering som startsidan) */
body.frontend .hero-sm::before {
    content: '';
    position: absolute;
    inset: 0 0 0 45%;
    background: url('../img/hero-image.jpg') center 30% / cover no-repeat;
    z-index: -2;
}

/* Navy-panel – vänster, med diagonal söm (identisk med .hero-split) */
body.frontend .hero-sm::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 58%;
    background: linear-gradient(135deg, #062647 0%, #051f3a 55%, #04182d 100%);
    mask-image: var(--wave-panel-mask);
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    z-index: -1;
}

/* Innehåll – vänster, vit text på navy */
body.frontend .hero-sm .container {
    position: relative;
    z-index: 1;
}

body.frontend .hero-sm .container > * {
    max-width: min(48%, 560px);
}

body.frontend .hero-sm .hero-title {
    color: var(--color-cta);
    font-size: clamp(32px, 4vw, 44px);
}

body.frontend .hero-sm .hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

body.frontend .hero-sm .hero-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

body.frontend .hero-sm .hero-actions .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: #fff;
    color: #fff;
}

/* Mobil/surfplatta: full-bredds navy utan diagonal/foto */
@media (max-width: 1024px) {
    body.frontend .hero-sm {
        min-height: 0;
    }

    body.frontend .hero-sm::before {
        display: none;
    }

    body.frontend .hero-sm::after {
        width: 100%;
        mask-image: none;
        clip-path: none;
    }

    body.frontend .hero-sm .container > * {
        max-width: 640px;
    }
}

/* --- Navbar Dropdown (Legacy) --- */
.navbar-dropdown {
    position: relative;
}

.navbar-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-arrow {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
    position: relative;
    top: -1px;
    margin-left: 2px;
}

.navbar-mega.open .dropdown-arrow {
    transform: rotate(-135deg);
    top: 1px;
}

.navbar-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-sm);
    z-index: 100;
    margin-top: var(--space-xs);
}

.navbar-dropdown.open .navbar-dropdown-menu {
    display: block;
}

.navbar-dropdown-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.navbar-dropdown-item:hover,
.navbar-dropdown-item.active {
    background: var(--color-primary-50);
    color: var(--color-primary);
}

/* --- Navbar Mega Menu --- */
.navbar-mega {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar-mega-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
}

.navbar-mega-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    z-index: 200;
    padding: var(--space-lg) 0;
}

.navbar-mega.open .navbar-mega-panel {
    display: block;
}

.navbar-mega.open .dropdown-arrow {
    transform: rotate(-135deg);
    top: 1px;
}

.navbar-mega-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    gap: var(--space-3xl);
    padding: 0 var(--space-lg);
}

.navbar-mega-inner--compact {
    gap: 0;
}

.navbar-mega-col {
    min-width: 180px;
}

.navbar-mega-heading {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.navbar-mega-link {
    display: block;
    padding: 6px 0;
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-bg-alt);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.navbar-mega-link:hover {
    color: var(--color-bg-alt-hover);
}

.navbar-mega-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* --- Rik mega-meny: grupperade objekt + featured-panel + bottenrad --- */
.navbar-mega-rich {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-3xl);
    align-items: stretch;
    min-height: 300px;
}

.navbar-mega-groups {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xl);
}

.navbar-mega-groups .navbar-mega-col {
    min-width: 240px;
    flex: 1;
}

.navbar-mega-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.navbar-mega-item:hover {
    background: var(--color-primary-50);
}

.navbar-mega-item-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-primary-50);
    color: var(--color-primary);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.navbar-mega-item:hover .navbar-mega-item-icon {
    background: var(--color-cta);
    color: #061D37;
}

.navbar-mega-item-icon svg {
    width: 20px;
    height: 20px;
}

.navbar-mega-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.navbar-mega-item-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
}

.navbar-mega-item-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.35;
    margin-top: 2px;
}

/* Featured-panel (byts via hover) */
.navbar-mega-feature {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    background: linear-gradient(150deg, #062647 0%, #04182d 100%);
    color: #fff;
}

.navbar-mega-feature-swap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.navbar-mega-feature-media {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-cta);
}

.navbar-mega-feature-media svg {
    width: 28px;
    height: 28px;
}

.navbar-mega-feature-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    line-height: 1.25;
}

.navbar-mega-feature-desc {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
}

.navbar-mega-feature-btn {
    align-self: flex-start;
}

/* Dold preview-data som JS kopierar in i featured-panelen vid hover */
.navbar-mega-preview {
    display: none;
}

/* Bottenrad med sekundära länkar */
.navbar-mega-footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
    padding: var(--space-md) clamp(24px, 5vw, 120px) 0;
    border-top: 1px solid var(--color-border);
}

.navbar-mega-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.navbar-mega-footer-link:hover {
    color: var(--color-primary);
}

.navbar-mega-footer-link svg {
    width: 16px;
    height: 16px;
}

/* --- Feature Rows (alternating image/text) --- */
.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 88px;
    align-items: center;
    padding: 88px 0;
}

body.frontend .compact-features { padding: 40px 0; }
.compact-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
body.frontend .compact-feature { min-width: 0; padding: 24px; border: 0; border-radius: 8px; text-align: left; }
body.frontend .compact-features,
body.frontend .section-raised { background: var(--color-surface-raised); }
.page-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 56px; }
.page-media-text p { color: var(--color-text-muted); font-size: 1.125rem; line-height: 1.7; margin: 0; }
.page-media-image { width: 100%; height: 440px; object-fit: cover; object-position: center 30%; mask-image: var(--wave-image-mask); mask-size: 100% 100%; mask-repeat: no-repeat; }
.page-section-intro { max-width: 720px; margin: 0 0 32px; color: var(--color-text-muted); font-size: 1.125rem; line-height: 1.7; }
.page-security-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
.page-security-item { min-width: 0; }
.page-security-item h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 1.125rem; color: var(--color-text); }
.page-security-item h3 svg { flex-shrink: 0; color: var(--color-primary); }
.page-security-item p { margin: 0; color: var(--color-text-muted); }
.page-quote { text-align: center; }
.page-quote figure { max-width: 960px; margin: 0 auto; }
.page-quote blockquote { margin: 0 0 24px; font-size: 2.5rem; line-height: 1.4; }
.page-quote blockquote p { margin: 0; font-size: inherit; line-height: inherit; overflow-wrap: anywhere; }
.page-quote blockquote p::before,
.page-quote blockquote p::after { display: inline; font-family: Georgia, serif; font-size: 2em; line-height: 0; vertical-align: -0.15em; }
.page-quote blockquote p::before { content: '\201C\00A0'; color: var(--color-primary); }
.page-quote blockquote p::after { content: '\00A0\201D'; color: var(--color-cta); }
.page-quote figcaption { color: var(--color-text-muted); font-weight: 600; }
body.frontend .home-faq.page-faq { padding: 128px 0; }
.secure-share-title { margin: 0 0 8px; font-size: 1.5rem; }
.login-card.secure-share-report { max-width: 760px; }
.secure-share-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-bottom: var(--space-md); }
.secure-share-frame { display: block; width: 100%; min-height: 480px; border: 0; border-radius: 8px; background: #F1F5F9; }
.secure-share-body { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--color-border); line-height: 1.7; overflow-wrap: anywhere; }
.quote-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.quote-config,
.quote-contact { padding: 40px; border-radius: 16px; background: var(--color-surface-raised); box-shadow: 0 1px 2px rgba(2, 26, 59, 0.04), 0 12px 32px rgba(2, 26, 59, 0.06); }
.quote-slider + .quote-slider { margin-top: 40px; }
.quote-slider-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.quote-slider-head label { font-weight: 600; font-size: 1.125rem; color: var(--color-text); }
.quote-slider-number { width: 5.5ch; padding: 4px 0; border: 0; background: transparent; color: var(--color-primary); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2.5rem; font-weight: 800; line-height: 1; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.quote-slider-number::-webkit-outer-spin-button,
.quote-slider-number::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quote-slider-number:focus { outline: none; }
.quote-range { --fill: 0%; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.quote-range:focus { outline: none; }
.quote-range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--color-primary) var(--fill), var(--color-border) var(--fill)); }
.quote-range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--color-border); }
.quote-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--color-primary); }
.quote-range::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -10px; border: 3px solid var(--color-primary); border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(2, 26, 59, 0.2); transition: transform 150ms ease, box-shadow 150ms ease; -webkit-appearance: none; appearance: none; }
.quote-range::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid var(--color-primary); border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(2, 26, 59, 0.2); transition: transform 150ms ease, box-shadow 150ms ease; }
.quote-range:hover::-webkit-slider-thumb,
.quote-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.quote-range:hover::-moz-range-thumb,
.quote-range:active::-moz-range-thumb { transform: scale(1.12); }
.quote-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(10, 55, 102, 0.18); }
.quote-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 6px rgba(10, 55, 102, 0.18); }
.quote-slider-scale { display: flex; justify-content: space-between; margin-top: 8px; color: var(--color-text-muted); font-size: 0.8125rem; }
.quote-packages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 40px; }
.quote-package { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border: 1.5px solid var(--color-border); border-radius: 12px; background: transparent; color: var(--color-text); font: inherit; text-align: left; cursor: pointer; transition: border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease; }
.quote-package:hover { border-color: var(--color-primary); }
.quote-package:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.quote-package[aria-pressed="true"] { border-color: var(--color-primary); background: var(--color-primary-50); box-shadow: inset 0 0 0 1px var(--color-primary); }
.quote-package-name { font-weight: 700; }
.quote-package-desc { color: var(--color-text-muted); font-size: 0.875rem; }
.quote-summary { position: sticky; top: calc(var(--header-height, 72px) + 24px); padding: 40px; border-radius: 16px; background: var(--color-text); color: var(--color-text-inverse); box-shadow: 0 16px 40px rgba(2, 26, 59, 0.18); }
.quote-summary-label { margin: 0; color: var(--color-text-secondary); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.quote-summary-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 12px 0 28px; }
.quote-summary-total strong { color: #fff; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 3.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.quote-summary-total span { color: var(--color-text-secondary); }
.quote-summary-lines { margin: 0; }
.quote-summary-lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.quote-summary-lines > div[hidden] { display: none; }
.quote-summary-lines dt { color: var(--color-text-secondary); }
.quote-summary-lines dd { margin: 0; font-weight: 600; white-space: nowrap; }
.quote-summary-note { margin: 12px 0 0; color: var(--color-cta); font-size: 0.875rem; }
.quote-continue { width: 100%; margin-top: 28px; }
.quote-contact { margin-top: 24px; scroll-margin-top: calc(var(--header-height, 72px) + 24px); }
.quote-contact.is-visible { animation: quote-reveal 500ms cubic-bezier(0.25, 0.8, 0.25, 1); }
.quote-contact h3 { margin: 0 0 24px; font-size: 1.5rem; }
.quote-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.quote-contact-wide { grid-column: 1 / -1; }
@keyframes quote-reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
    .quote-grid { grid-template-columns: 1fr; }
    .quote-summary { position: static; }
}
@media (max-width: 700px) {
    .quote-config,
    .quote-contact,
    .quote-summary { padding: 24px; }
    .quote-packages,
    .quote-contact-grid { grid-template-columns: 1fr; }
    .quote-slider-number { font-size: 2rem; }
    .quote-summary-total strong { font-size: 2.75rem; }
    .quote-contact .btn { width: 100%; }
}
.page-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
body.frontend .page-related-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; border: 0; border-radius: 8px; color: var(--color-text); }
.page-related-card h3 { margin: 0; font-size: 1.25rem; }
.page-related-card p { margin: 0; color: var(--color-text-muted); }
@media (max-width: 900px) {
    .page-media { grid-template-columns: 1fr; gap: 32px; }
    .page-media-image { height: 300px; mask-image: none; border-radius: 8px; }
    .page-security-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .page-security-grid { grid-template-columns: 1fr; gap: 24px; }
    .page-quote blockquote { font-size: 1.75rem; }
    body.frontend section.home-faq.page-faq { padding: 64px 0; }
}
.compact-feature .feature-icon { margin-bottom: 12px; }
.compact-feature h3 { font-size: 1.25rem; margin-bottom: 10px; }
.compact-feature p { color: var(--color-text-muted); margin-bottom: 16px; }
.compact-feature .feature-list { margin: 0; }
.compact-feature .feature-list li { margin-bottom: 6px; }
.compact-feature .feature-list li:last-child { margin-bottom: 0; }
@media (max-width: 700px) {
    .compact-feature-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    body.frontend .compact-feature { padding: 20px; }
}

body.frontend .text-center {
    text-align: left;
}
body.frontend .text-center .hero-actions {
    justify-content: flex-start;
}
body.frontend .section .text-center h2::after {
    left: 0;
    transform: none;
    margin-left: 0;
}
.feature-screenshot {
    width: 100%;
    margin: 0;
    min-width: 0;
}
.feature-screenshot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 36 / 25;
    object-fit: contain;
    border-radius: 8px;
}
.feature-screenshot figcaption {
    margin-top: 12px;
    color: var(--color-text-muted);
    text-align: left;
    font-size: 0.875rem;
}

.feature-row + .feature-row {
    border-top: 1px solid var(--color-border);
}

.feature-row-reverse .feature-row-content {
    order: 2;
}

.feature-row-reverse .feature-row-visual {
    order: 1;
}

.feature-row-content h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 32px;
}

.feature-row-content p {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 44px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 8px;
    color: var(--color-text-muted);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-secondary);
    font-weight: 700;
}

.feature-row-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-illustration {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: 88px;
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.feature-illustration span {
    font-size: 4rem;
    display: block;
    margin-bottom: var(--space-md);
}

.feature-illustration span svg {
    color: var(--color-primary);
}

.feature-illustration p {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin: 0;
}

/* --- Feature Slider --- */
.feature-slider {
    background: var(--color-surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.feature-slider-stage {
    position: relative;
    flex: 1;
}

.feature-slider-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-slider-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0.92) 35%, rgba(255,255,255,0.5) 60%, rgba(255,255,255,0) 80%);
    z-index: 1;
}

.feature-slider-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-in animations for body content */
.feature-slider-body {
    position: relative;
    z-index: 2;
    text-align: left;
    padding: 32px 0px 32px 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-width: 65%;
    height: 100%;
    transform: translateX(-16px);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
                opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.feature-slider-slide.active .feature-slider-body {
    transform: translateX(0);
    opacity: 1;
}

.feature-slider-body h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--color-bg-alt);
}

.feature-slider-body p {
    font-size: 18px;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

.feature-slider-body .btn {
    align-self: flex-start;
}

/* Slider tabs / progress buttons */
.feature-slider-tabs {
    display: flex;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.feature-slider-tab {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0;
    background: var(--color-bg);
    border: none;
    border-right: 1px solid var(--color-border);
    cursor: pointer;
    overflow: hidden;
    font-family: inherit;
}

.feature-slider-tab:last-child {
    border-right: none;
}

.feature-slider-tab.active {
    background: var(--color-surface);
}

/* Progress fill overlay — driven by JS */
.feature-slider-tab-progress {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: var(--color-cta);
    pointer-events: none;
}

.feature-slider-tab-label {
    position: relative;
    z-index: 1;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    line-height: 1;
    margin: 0;
    font-family: var(--font-family);
}

.feature-slider-tab.active .feature-slider-tab-label {
    color: var(--color-bg-alt-hover);
    font-weight: 700;
}

/* Responsive hero — stack on tablet and below */
@media (max-width: 1024px) {
    .hero {
        padding: var(--space-2xl) 0;
    }

    .hero .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-image {
        padding: calc(var(--header-height) + 48px) 0 64px;
    }

    .hero-image-content .hero-title {
        font-size: 34px;
    }

    /* Split-hero staplas: foto överst (bakom flytande navbar), text under */
    .hero-split {
        display: flex;
        flex-direction: column-reverse;
        min-height: 0;
    }

    .hero-split-media {
        position: relative;
        inset: auto;
        height: 300px;
    }

    .hero-split-text {
        width: 100%;
        min-height: 0;
        mask-image: none;
        clip-path: none;
        padding: var(--space-2xl) 24px;
    }

    .hero-image-slider {
        margin-top: 40px;
        max-width: 100%;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    .hero-actions {
        justify-content: flex-start;
    }
}

/* Responsive slider — mobile horizontal scroll carousel */
@media (max-width: 768px) {
    .feature-slider {
        border: none;
        box-shadow: none;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }

    .feature-slider-stage {
        height: auto;
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: var(--space-sm);
        padding: 0 0 0 16px;
        scrollbar-width: none;
    }

    .feature-slider-stage::-webkit-scrollbar {
        display: none;
    }

    .feature-slider-slide {
        position: relative;
        inset: auto;
        display: flex;
        flex-direction: column;
        flex: 0 0 88%;
        height: 360px;
        scroll-snap-align: start;
        opacity: 1;
        pointer-events: auto;
        background-color: var(--color-surface);
        background-size: cover;
        background-position: center;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
        transition: none;
    }

    .feature-slider-slide::before {
        background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 30%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0.4) 70%, rgba(255,255,255,0) 100%);
    }

    .feature-slider-body {
        padding: 16px;
        padding-right:60px;
        text-align: left;
        transform: none;
        opacity: 1;
        transition: none;
        flex: 1;
        justify-content: flex-start;
        max-width: 100%;
    }

    .feature-slider-body h3 {
        font-size: 18px;
    }

    .feature-slider-body p {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-md);
        line-height: 1.6;
    }

    .feature-slider-body .btn {
        align-self: flex-start;
    }

    /* Hide tabs on mobile */
    .feature-slider-tabs {
        display: none;
    }

    .hero-image-slider .feature-slider-stage {
        min-height: 0;
    }
}

/* --- Social cards: gradient boxes --- */
.social-cards .card {
    background: linear-gradient(135deg, #ffffff 0%, #edeffc 50%, #d0eefb 100%);
    border: 1px solid rgba(26, 44, 163, 0.08);
    transition: background 0.4s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.social-cards > :nth-child(3) {
    background: linear-gradient(315deg, #ffffff 0%, #edeffc 50%, #d0eefb 100%);
}

.social-cards .card:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f4f5fe 40%, #e8f4fb 100%);
    box-shadow: 0 8px 24px rgba(26, 44, 163, 0.08);
}

.social-cards > :nth-child(3):hover {
    background: linear-gradient(315deg, #ffffff 0%, #f4f5fe 40%, #e8f4fb 100%);
}

/* --- Timeline (customer journey) --- */
.timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto auto;
    margin-top: var(--space-2xl);
    row-gap: var(--space-sm);
}

.timeline::before {
    content: '';
    grid-row: 2;
    grid-column: 1 / -1;
    height: 4px;
    background: linear-gradient(90deg, #dc2626, #ea580c, #d97706, #16a34a, #059669);
    border-radius: 2px;
    pointer-events: none;
    z-index: 0;
    align-self: center;
}

/* Each item spans all 3 rows in its column */
.timeline-item {
    display: contents;
}

/* Row 1: top area (bubble for odd, label for even) */
.timeline-item .timeline-bubble {
    grid-row: 1;
    justify-self: center;
    align-self: end;
}

/* Row 2: dot row */
.timeline-item .timeline-dot {
    grid-row: 2;
    justify-self: center;
    align-self: center;
}

/* Row 3: bottom area (label for odd, bubble for even) */
.timeline-item .timeline-label {
    grid-row: 3;
    justify-self: center;
    align-self: start;
}

/* Below items: bubble goes to row 3, label to row 1 */
.timeline-item-below .timeline-bubble {
    grid-row: 3;
    align-self: start;
}

.timeline-item-below .timeline-label {
    grid-row: 1;
    align-self: end;
}

/* Assign columns */
.timeline-item:nth-child(1) .timeline-bubble,
.timeline-item:nth-child(1) .timeline-dot,
.timeline-item:nth-child(1) .timeline-label { grid-column: 1; }
.timeline-item:nth-child(2) .timeline-bubble,
.timeline-item:nth-child(2) .timeline-dot,
.timeline-item:nth-child(2) .timeline-label { grid-column: 2; }
.timeline-item:nth-child(3) .timeline-bubble,
.timeline-item:nth-child(3) .timeline-dot,
.timeline-item:nth-child(3) .timeline-label { grid-column: 3; }
.timeline-item:nth-child(4) .timeline-bubble,
.timeline-item:nth-child(4) .timeline-dot,
.timeline-item:nth-child(4) .timeline-label { grid-column: 4; }
.timeline-item:nth-child(5) .timeline-bubble,
.timeline-item:nth-child(5) .timeline-dot,
.timeline-item:nth-child(5) .timeline-label { grid-column: 5; }

/* Bubble arrow pointing down (default) */
.timeline-bubble {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    line-height: 1.4;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 150px;
}

.timeline-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

/* Bubble arrow pointing up (below items) */
.timeline-item-below .timeline-bubble::after {
    bottom: auto;
    top: -6px;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid var(--color-border);
    border-top: 1px solid var(--color-border);
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc2626;
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.timeline-item:nth-child(1) .timeline-dot { background: #dc2626; }
.timeline-item:nth-child(2) .timeline-dot { background: #ea580c; }
.timeline-item:nth-child(3) .timeline-dot { background: #d97706; }
.timeline-item:nth-child(4) .timeline-dot { background: #16a34a; }
.timeline-item:nth-child(5) .timeline-dot { background: #059669; }

.timeline-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
}

/* --- Pricing Cards --- */
.pricing-grid {
    display: grid;
    gap: var(--space-2xl);
    align-items: stretch;
}

.pricing-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 880px;
    margin: 0 auto;
}

.pricing-grid-1 {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
}

.pricing-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.pricing-card-featured {
    border-color: var(--color-primary);
    border-width: 2px;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(180deg, var(--color-primary-50) 0%, var(--color-surface) 40%);
}

.pricing-card-featured:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px -12px rgba(26, 44, 163, 0.2);
}

.pricing-card-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary-fill);
    color: var(--color-text-inverse);
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.pricing-card-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
}

.pricing-card-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.pricing-card-desc {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    line-height: 1.7;
}

.pricing-card-body {
    flex: 1;
}

.pricing-card-footer {
    margin-top: var(--space-xl);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.pricing-features li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    padding-left: 1.5rem;
    position: relative;
}

.pricing-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-secondary);
    font-weight: 700;
}

.pricing-cta {
    width: 100%;
    display: block;
}

/* --- Pricing: pris --- */
.pricing-card-price {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    color: var(--color-text);
    margin: var(--space-lg) 0 var(--space-lg);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.pricing-card-price span {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    letter-spacing: 0;
}

/* --- Pricing: accordion --- */
.pricing-accordion {
    border-top: 1px solid var(--color-border-light, #f1f5f9);
    margin-top: 0;
    padding-top: var(--space-sm);
}

.pricing-accordion-intro {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: var(--space-sm) 0 0;
    padding: 0;
}

.pricing-accordion-item {
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
}

.pricing-accordion-item:last-child {
    border-bottom: none;
}

.pricing-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    text-align: left;
    font-family: inherit;
    transition: color 0.2s ease;
}

.pricing-accordion-trigger:hover {
    color: var(--color-primary);
}

.pricing-accordion-icon {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: var(--color-text-muted);
    opacity: 0.5;
}

.pricing-accordion-trigger[aria-expanded="true"] .pricing-accordion-icon {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--color-primary);
}

.pricing-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.pricing-accordion-body ul {
    list-style: none;
    padding: 0 0 var(--space-md) var(--space-sm);
    margin: 0;
}

.pricing-accordion-body li {
    padding: 0.35rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.6;
}

.pricing-accordion-body li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 0.8em;
}

.pricing-accordion-body p {
    padding: 0 0 var(--space-md) var(--space-sm);
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --- Pricing: includes --- */
.pricing-includes {
    list-style: none;
    padding: var(--space-lg) 0 0;
    margin: auto 0 0;
    border-top: 1px solid var(--color-border-light, #f1f5f9);
}

.pricing-includes li {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    padding: 0.3rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.pricing-includes li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-text-muted);
}

/* --- FAQ --- */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--color-border);
}

.faq-item:first-child {
    padding-top: 0;
}

.faq-question {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.faq-answer {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* --- About page --- */
.about-content {
    max-width: 800px;
}

.about-text p {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

/* --- Footer (Frontend) --- */
.site-footer {
    background-color: var(--color-text);
    color: #B0BCC9;
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(108px, 0.7fr) repeat(3, minmax(0, 1fr)) minmax(230px, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-bottom: var(--space-2xl);
}
.footer-grid > * { min-width: 0; }
.footer-grid .footer-links a { overflow-wrap: anywhere; }
@media (min-width: 1025px) and (max-width: 1279px) {
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.footer-brand {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-text-inverse);
    margin-bottom: var(--space-md);
}

.footer-description {
    font-size: var(--font-size-base);
    color: #B0BCC9;
    line-height: 1.7;
}

.footer-contact { max-width: 320px; padding: 20px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.footer-contact a { display: flex; align-items: center; gap: 10px; color: #E2F0FD; padding: 6px 0; }
.footer-contact a:hover { color: #fff; }
.footer-contact a span { overflow-wrap: anywhere; min-width: 0; }

.footer-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-inverse);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    font-size: var(--font-size-base);
    color: #93c5fd;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-text-inverse);
}

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid #64748B;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    color: #B0BCC9;
}

/* =============================================================================
   10. ADMIN/KUNDPANEL-SPECIFIKT
   ============================================================================= */

/* --- Inloggningssida --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-bg) 50%, var(--color-secondary-light) 100%);
    padding: var(--space-lg);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: var(--space-2xl);
    border-radius: var(--radius-2xl);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo-text {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-primary);
}

.login-logo-sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --- BankID-inloggning --- */
.bankid-login {
    margin-bottom: var(--space-lg);
}

.bankid-active {
    margin-top: var(--space-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.bankid-qr {
    display: flex;
    justify-content: center;
}

.bankid-qr svg,
.bankid-qr img {
    width: 220px;
    height: 220px;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin: var(--space-lg) 0;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}

.login-divider span {
    padding: 0 var(--space-sm);
}

/* --- Sök och filter --- */
.search-bar {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.search-bar .form-input {
    flex: 1;
}

/* --- Tom lista --- */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
    color: var(--color-text-muted);
    display: inline-flex;
}

.empty-state-icon svg {
    width: 44px;
    height: 44px;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-lg);
}

/* --- Flikar / Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
}

.tab-btn {
    padding: var(--space-md) var(--space-lg);
    border: none;
    background: none;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-bg-alt);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition-normal), border-color var(--transition-normal);
}

.tab-btn:hover {
    color: var(--color-bg-alt-hover);
}

.tab-btn.active {
    color: var(--color-bg-alt);
    border-bottom-color: var(--color-bg-alt);
}

/* Dolt tills "Visa alla" expanderas */
.expand-hidden {
    display: none;
}

/* Dokumentationspåminnelser (klientblad) */
.doc-reminders {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.doc-reminder-row {
    padding: var(--space-md);
}

.doc-reminder-row:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

/* =============================================================================
   11. PAGINERING
   ============================================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.pagination-link:hover {
    background-color: var(--color-bg-alt);
    color: var(--color-text);
}

.pagination-active {
    background-color: var(--color-primary-fill);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-sm);
}

.pagination-active:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-text-inverse);
}

/* =============================================================================
   12. RESPONSIVITET
   ============================================================================= */

/* Sidebar-toggle: dold på desktop, visas på mobil */
.sidebar-toggle {
    display: none;
    color: var(--color-text-secondary);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pricing-grid,
    .pricing-grid-2 {
        grid-template-columns: 1fr;
        max-width: 440px;
        margin: 0 auto;
    }

    .pricing-card-featured {
        transform: none;
        background: linear-gradient(180deg, var(--color-primary-50) 0%, var(--color-surface) 40%);
    }

    .timeline {
        grid-template-columns: repeat(3, 1fr);
        row-gap: var(--space-lg);
    }

    .timeline::before {
        display: none;
    }

    .timeline-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-sm);
    }

    .timeline-item .timeline-bubble,
    .timeline-item .timeline-dot,
    .timeline-item .timeline-label,
    .timeline-item-below .timeline-bubble,
    .timeline-item-below .timeline-label {
        grid-row: auto;
        grid-column: auto;
    }

    .timeline-item-below .timeline-bubble::after {
        bottom: -6px;
        top: auto;
        border-right: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
        border-left: none;
        border-top: none;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-5xl: 2.25rem;
        --font-size-4xl: 1.875rem;
        --font-size-3xl: 1.5rem;
    }

    body.frontend {
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
        --space-md: 1rem;
        --space-lg: 1rem;
        --space-3xl: 3.5rem;
        --space-4xl: 5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .navbar-inner {
        padding: 0 16px;
        gap: 0;
        justify-content: space-between;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background-color: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-md) var(--space-lg);
        box-shadow: var(--shadow-lg);
        gap: 0;
    }

    .navbar-nav.open {
        display: flex;
    }

    .navbar-nav .btn {
        margin-left: 0;
        margin-top: var(--space-md);
        align-self: flex-start;
    }

    .navbar-link {
        display: block;
        padding: var(--space-sm) 0;
    }

    .navbar-toggle {
        display: flex;
    }

    body.frontend .navbar-overlay {
        position: sticky;
        background: var(--color-surface);
    }
    body.frontend .navbar-overlay .navbar-link,
    body.frontend .navbar-overlay .navbar-mega-toggle,
    body.frontend .navbar-overlay .navbar-link:hover,
    body.frontend .navbar-overlay .navbar-link.active {
        color: var(--color-text);
    }
    body.frontend .navbar-overlay .brand-wordmark {
        --brand-topp-color: var(--color-primary);
    }
    body.frontend .navbar-overlay .brand-symbol-dark { display: block; }
    body.frontend .navbar-overlay .brand-symbol-light { display: none; }
    body.frontend .navbar-overlay .navbar-toggle span {
        background-color: var(--color-text);
    }
    body.frontend .navbar-link::after { display: none; }
    body.frontend .navbar-nav {
        max-height: calc(100dvh - var(--header-height));
        overflow-y: auto;
        padding: 16px 24px 24px;
    }

    .hero {
        padding: var(--space-2xl) 0;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    body.frontend .hero-actions {
        gap: 12px;
        align-items: stretch;
        margin-top: 24px;
    }
    body.frontend .hero-actions .cta-slot,
    body.frontend .hero-actions .btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    body.frontend .hero-actions .cta-slot {
        width: 100% !important;
        height: auto !important;
    }
    body.frontend .hero-split-inner {
        width: 100%;
        min-width: 0;
    }
    body.frontend .hero-actions .btn {
        justify-content: center;
        white-space: normal;
        text-align: center;
        margin: 0;
    }
    body.frontend .hero-split { padding: 0; margin-top: 0; }
    body.frontend .hero-split-text { padding: 32px 24px; }
    body.frontend .hero-subtitle { margin-bottom: 24px; }
    body.frontend .section { padding-top: 40px; padding-bottom: 40px; }

    .feature-row {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .feature-row-reverse .feature-row-content,
    .feature-row-reverse .feature-row-visual {
        order: unset;
    }

    .timeline {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: var(--space-md);
        margin-top: 0;
    }

    .navbar-dropdown.open .navbar-dropdown-menu {
        display: block;
    }

    /* Mega menu mobile */
    .navbar-mega {
        display: block;
        height: auto;
        width: 100%;
    }

    .navbar-mega-panel {
        position: static;
        box-shadow: none;
        border-top: none;
        border-bottom: none;
        padding: 0;
    }

    .navbar-mega.open .navbar-mega-panel {
        display: block;
    }

    .navbar-mega-inner {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .navbar-mega-col {
        min-width: 0;
    }

    .navbar-mega-heading {
        display: none;
    }

    .navbar-mega-link {
        padding: 6px 0 6px var(--space-lg);
        font-size: var(--font-size-sm);
    }

    /* Rik mega-meny på mobil: stapla objekt, dölj featured-panel och bottenrad */
    .navbar-mega-rich {
        display: block;
    }

    .navbar-mega-groups {
        flex-direction: column;
        gap: 0;
    }

    .navbar-mega-groups .navbar-mega-col {
        min-width: 0;
    }

    .navbar-mega-item {
        padding: 8px var(--space-lg);
        gap: 10px;
    }

    .navbar-mega-item-icon {
        width: 30px;
        height: 30px;
    }

    .navbar-mega-item-icon svg {
        width: 16px;
        height: 16px;
    }

    .navbar-mega-feature,
    .navbar-mega-footer {
        display: none;
    }

    .cookie-banner-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .search-bar {
        flex-direction: column;
    }

    .table-wrapper {
        font-size: var(--font-size-sm);
    }

    .modal {
        max-width: 100%;
        margin: var(--space-md);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    .app-content {
        padding: 0;
    }

    .app-layout .card {
        padding: var(--space-sm) var(--space-md);
    }

    .card {
        padding: var(--space-lg);
    }
}

/* =============================================================================
   13. ANIMATIONER
   ============================================================================= */

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-0.75rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Laddningsindikator */
.loading {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2.5px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-inverse);
    background-color: var(--color-text);
    border-radius: var(--radius-full);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    margin-bottom: 4px;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Påminnelse-dropdown på klientlistan */
.reminder-dropdown {
    position: relative;
    display: inline-block;
}
.reminder-toggle {
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.reminder-status-sent { color: var(--color-success); }
.reminder-status-draft { color: #d97706; }
.reminder-status-missing { color: #dc2626; }
.reminder-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: var(--radius-md, 6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 200px;
    padding: 4px 0;
}
.reminder-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: normal;
    white-space: nowrap;
}
.reminder-menu a:hover {
    background: var(--color-bg-hover, #f1f5f9);
    color: var(--color-primary);
}

/* Klickbar inline-redigering — text som blir input/select vid klick */
.inline-edit {
    position: relative;
    display: inline-block;
}
.inline-edit-display {
    cursor: pointer;
    border-bottom: 1px dashed var(--color-border, #cbd5e1);
    color: var(--color-text);
}
.inline-edit-display:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.inline-edit-field {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 10;
}

/* Klickbar hjälpbubbla — frågetecken som öppnar en ruta med längre hjälptext */
.help-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 0.35rem;
    border-radius: 50%;
    background: var(--color-bg-secondary, #e2e8f0);
    color: var(--color-text-muted, #485260);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    border: 1px solid var(--color-border, #cbd5e1);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    vertical-align: middle;
}
.help-toggle:hover,
.help-toggle[aria-expanded="true"] {
    background: var(--color-primary, #1A2CA3);
    color: #fff;
    border-color: var(--color-primary, #1A2CA3);
}
.help-bubble {
    display: none;
    margin-top: 0.35rem;
    padding: var(--space-sm) var(--space-md);
    background: #f8fafc;
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: var(--radius-md, 6px);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted, #485260);
    line-height: 1.5;
}
.help-bubble.is-open {
    display: block;
}

/* =============================================================================
   14. UTILITY-KLASSER
   ============================================================================= */

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mt-xs { margin-top: var(--space-xs); }

.list-plain {
    list-style: none;
    margin: 0;
    padding: 0;
}

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.w-full { width: 100%; }
.rounded { border-radius: var(--radius-lg); }

/* =============================================================================
   FÄRGSCHEMA: NAVY
   Marinblått primärtema med guld sekundär och koppar accent.
   Aktiveras via data-theme="navy" på <html>.
   ============================================================================= */

[data-theme="navy"] {
    /* --- Primär: Marinblå --- */
    --color-primary: #2E4272;
    --color-primary-dark: #06163A;
    --color-primary-light: #7787AA;
    --color-primary-50: #FDFDFD;

    /* --- Sekundär: Guld --- */
    --color-secondary: #AA9739;
    --color-secondary-dark: #564700;
    --color-secondary-light: #FEEFA9;

    /* --- Accent: Koppar --- */
    --color-accent: #AA6C39;
    --color-accent-dark: #562700;
    --color-accent-light: #FED0A9;

    /* --- Text --- */
    --color-text: #000002;

    /* --- Ramar --- */
    --color-border-focus: #2E4272;

    /* --- Info matchar primär --- */
    --color-info: #2E4272;
    --color-info-bg: #FDFDFD;
}

/* ==========================================================================
   Ändringshistorik / Revisioner
   ========================================================================== */
.revision-old-text {
    text-decoration: line-through;
    color: var(--color-text-muted);
    opacity: 0.75;
}

.revision-entry {
    padding: var(--space-sm) 0;
}

/* Expanderbara detaljrader i tabeller (t.ex. ändringshistorikens diff) */
.table tr.is-expandable {
    cursor: pointer;
}

.table tr.is-expandable .card-toggle-chevron {
    display: inline-block;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.table tr.history-detail-row > td {
    background: var(--color-bg, #f8f8f8);
}

.table tr.history-detail-row .history-detail {
    padding: var(--space-sm) 0;
}

/* ==========================================================================
   Kalender
   ========================================================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--color-border-strong);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.calendar-header {
    background: var(--color-bg-alt);
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    padding: var(--space-sm);
}

.calendar-header.calendar-weekend {
    background: var(--color-bg-alt-hover);
}

.calendar-day {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    min-height: 100px;
    padding: calc(var(--space-xs) + 4px);
    text-decoration: none;
    color: var(--color-text);
    transition: background var(--transition-fast), transform var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.calendar-day:hover {
    background: var(--color-primary-50);
    transform: scale(1.02);
    z-index: 1;
}

.calendar-day-empty {
    background: var(--color-surface, #f8f8f8);
    cursor: default;
    min-height: 60px;
}

.calendar-day-empty:hover {
    background: var(--color-surface, #f8f8f8);
}

.calendar-day-today {
    box-shadow: inset 0 0 0 2px var(--color-bg-alt-hover);
}

.calendar-day-weekend {
    background: var(--color-bg);
}

.calendar-day-red {
    background: #FFF5F5;
}

.calendar-day-red .calendar-day-number {
    color: var(--color-error);
    font-weight: 800;
}

.calendar-day-number {
    font-weight: 700;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-xs);
}

.calendar-day-today .calendar-day-number {
    color: inherit;
}

.calendar-day-today.calendar-day-red .calendar-day-number {
    color: var(--color-error);
}

.calendar-day-count {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    background: var(--color-primary-fill);
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-preview {
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    color: var(--color-text);
    background: transparent;
}

.calendar-day-preview::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    background: var(--color-text-muted);
}

.calendar-day-preview.entry-type-note::before     { background: #3B82F6; }
.calendar-day-preview.entry-type-action::before   { background: #10B981; }
.calendar-day-preview.entry-type-reminder::before { background: #F59E0B; }
.calendar-day-preview.entry-type-meeting::before  { background: #8B5CF6; }

.calendar-day-more {
    font-size: 0.7em;
    color: var(--color-bg-alt);
    font-weight: 600;
}

/* ==========================================================================
   Årsvy (12 månader samtidigt) — kompakta mini-kalendrar med färgprickar
   ========================================================================== */
.calendar-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

@media (max-width: 1200px) {
    .calendar-year-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .calendar-year-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .calendar-year-grid { grid-template-columns: 1fr; }
}

.mini-month {
    margin: var(--space-md);
    border: 1px solid var(--color-bg-alt) !important;
}

.mini-month-header {
    margin-bottom: var(--space-sm);
    text-align: center;
}

.mini-month-title {
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-md);
}
.mini-month-title:hover {
    color: var(--color-bg-alt-hover);
    text-decoration: underline;
}

.mini-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mini-dow {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-text-muted);
    padding: 2px 0;
    text-transform: uppercase;
}
.mini-dow-weekend { color: #DC2626; }

.mini-day {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    border: 1px solid transparent;
    position: relative;
    min-height: 28px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.mini-day:hover {
    background: var(--color-primary-50, #eff6ff);
    border-color: var(--color-bg-alt);
}

.mini-day-empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.mini-day-weekend { background: var(--color-bg); }
.mini-day-red    { background: #FFF5F5; color: var(--color-error); font-weight: 700; }
.mini-day-today {
    background: var(--color-primary-50);
    box-shadow: inset 0 0 0 2px var(--color-bg-alt-hover);
    font-weight: 700;
}

.mini-day-num { line-height: 1; }

.mini-day-dots {
    display: flex;
    gap: 1px;
    margin-top: 2px;
    min-height: 5px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.year-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-text-muted);
}

.year-dot-note     { background: #3B82F6; } /* blå */
.year-dot-action   { background: #10B981; } /* grön */
.year-dot-reminder { background: #F59E0B; } /* gul */
.year-dot-meeting  { background: #8B5CF6; } /* lila */

@media (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
        padding: 2px;
    }
    .calendar-day-preview,
    .calendar-day-more {
        display: none;
    }
    .calendar-header {
        font-size: 0.7em;
        padding: var(--space-xs);
    }
}

/* ==========================================================================
   Påminnelsebanner (legacy — replaced by topbar reminders)
   ========================================================================== */

/* ==========================================================================
   Sidebar-badge
   ========================================================================== */
.sidebar-badge {
    background: #B91C1C;
    color: #FFFFFF;
    font-size: 0.65em;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: auto;
}

/* ==========================================================================
   Dismiss-knapp (påminnelser)
   ========================================================================== */
.reminder-dismiss {
    background: none;
    border: 1px solid var(--color-warning);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75em;
    color: var(--color-warning);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.15s;
    line-height: 1;
}

.reminder-dismiss:hover {
    background: var(--color-warning);
    color: var(--color-text-inverse);
}

/* Delete button — red outline style */
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-height-sm);
    padding: 0 0.875rem;
    background: var(--color-surface);
    color: var(--color-error);
    border: 1.5px solid var(--color-error);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: var(--font-size-xs);
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}
.btn-delete:hover {
    background: #fef2f2;
    border-color: #b42c2c;
    color: #b42c2c;
    box-shadow: var(--shadow-sm);
}

/* Contact clients expandable panel */
.contact-clients-panel {
    background-color: var(--color-surface-raised);
    border-left: 3px solid var(--color-primary-light);
    padding: var(--space-sm) var(--space-md);
}
.contact-clients-panel .table {
    font-size: var(--font-size-sm);
}
.contact-clients-panel .table th {
    background-color: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}
.contact-clients-panel .table tbody tr:nth-child(even) {
    background-color: transparent;
}
[data-contact-clients] .card-toggle-chevron {
    display: inline-block;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

/* =============================================================================
   EMAIL PREVIEW (Sammanfattningsmail)
   ============================================================================= */
.email-preview {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--spacing-md);
}
.email-preview-header p {
    margin: 0.25rem 0;
    font-size: var(--font-size-sm);
}
.email-preview-body {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    margin: 0;
    padding: var(--spacing-sm) 0 0;
}
.email-preview-frame {
    width: 100%;
    min-height: 520px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
}

/* CC recipient tags */
.cc-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.cc-tag-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}
.cc-tag-input {
    flex: 1;
    height: var(--control-height) !important;
}
.cc-tag-remove {
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}
.cc-tag-remove:hover {
    color: var(--color-error);
}

/* ==========================================================================
   Tidslinje (delas av historik och händelser)
   ========================================================================== */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.history-date-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    margin-top: var(--space-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    user-select: none;
    border-radius: var(--border-radius, 0.5rem) var(--border-radius, 0.5rem) 0 0;
    transition: background 0.15s;
}
.history-date-header:hover { background: var(--color-bg-hover, #f9fafb); }
.history-date-header:first-child { margin-top: 0; }
.history-date-label { color: var(--color-text, #111827); }
.history-date-count {
    font-weight: 500;
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-muted, #9ca3af);
}
.history-date-header .group-toggle-icon {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
}
.history-date-header .card-toggle-chevron {
    display: inline-block;
    font-size: 1.1rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.history-entry {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius, 0.5rem);
    background: var(--color-surface, #fff);
    transition: box-shadow 0.15s;
    color: inherit;
    text-decoration: none;
}
.history-entry[open],
a.history-entry:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.history-summary {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.history-summary::-webkit-details-marker { display: none; }
.history-summary::marker { content: ''; }
.history-summary:hover { background: var(--color-bg-hover, #f9fafb); }
.history-icon {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.history-main { flex: 1; min-width: 0; }
.history-meta {
    color: var(--color-text-muted, #6b7280);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}
.history-detail {
    padding: var(--space-md);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle, #f9fafb);
}
.history-diff {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}
.history-diff th, .history-diff td {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}
.history-diff th {
    color: var(--color-surface, #6b7280);
    font-weight: 600;
}
.history-diff code {
    background: var(--color-bg-subtle, #eef2ff);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}
.history-ip {
    margin-top: var(--space-sm);
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-muted, #6b7280);
}
/* Händelse-poster i tidslinjen */
.event-entry .history-icon {
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
}
.event-entry .history-main strong {
    font-size: var(--font-size-sm);
    color: var(--color-text, #111827);
}
.event-sub {
    margin-top: 2px;
    color: var(--color-text-muted, #6b7280);
    font-size: var(--font-size-xs, 0.75rem);
    white-space: normal;
}

/* =============================================================================
   FORTNOX-BEHÖRIGHETER (app/fortnox)
   ============================================================================= */
.fortnox-scope-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}
.fortnox-scope-box ul {
    padding-left: 1.25rem;
    margin-bottom: var(--space-md);
}
.fortnox-scope-details {
    display: inline-block;
}
.fortnox-scope-details > summary {
    list-style: none;
    cursor: pointer;
}
.fortnox-scope-details > summary::-webkit-details-marker {
    display: none;
}
.fortnox-scope-details[open] > summary {
    margin-bottom: var(--space-sm);
}

/* =============================================================================
   HJÄLPCENTER (app/hjalp)
   ============================================================================= */
.help-shell {
    display: grid;
    grid-template-columns: 15rem 1fr;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    align-items: stretch;
}

/* Ämnesmeny */
.help-menu {
    border-right: 1px solid var(--color-border);
    padding: var(--space-md);
}
.help-menu-title {
    font-weight: 600;
    color: var(--color-text);
    padding: var(--space-xs) var(--space-sm) var(--space-sm);
    margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}
.help-menu-search {
    width: 100%;
    margin-bottom: var(--space-sm);
}
.help-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.help-menu-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.3;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.help-menu-link:hover {
    background: var(--color-primary-50);
    color: var(--color-text);
}
.help-menu-link.active {
    background: var(--color-primary-50);
    color: var(--color-primary);
    font-weight: 600;
    border-left-color: var(--color-primary);
}
.help-menu-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}
.help-menu-empty {
    padding: var(--space-sm);
    font-size: var(--font-size-sm);
}

/* Innehåll */
.help-content {
    padding: var(--space-xl);
    min-width: 0;
}

@media (max-width: 900px) {
    .help-shell { grid-template-columns: 1fr; }
    .help-menu { border-right: none; border-bottom: 1px solid var(--color-border); }
    .help-menu-nav { flex-direction: row; flex-wrap: wrap; }
    .help-content { padding: var(--space-lg); }
}

.help-article-body {
    line-height: 1.65;
}
.help-article-body h3 {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}
.help-article-body ul,
.help-article-body ol {
    padding-left: 1.5rem;
    margin-bottom: var(--space-md);
}
.help-article-body li { margin-bottom: var(--space-xs); }
.help-article-body p { margin-bottom: var(--space-md); }
.help-article-body code {
    background: var(--color-bg-alt);
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}
.help-note {
    border-left: 3px solid var(--color-primary);
    background: var(--color-primary-50);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
}

/* Skärmbilder */
.help-shots { margin-top: var(--space-xl); }
.help-shots > h3 { margin-bottom: var(--space-md); }
.help-shots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: var(--space-lg);
}
.help-figure {
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
}
.help-figure img {
    display: block;
    width: 100%;
    height: auto;
}
.help-figure figcaption {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}
.help-figure-empty .help-shot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: 10rem;
    background: repeating-linear-gradient(
        45deg,
        var(--color-bg-alt),
        var(--color-bg-alt) 10px,
        var(--color-bg) 10px,
        var(--color-bg) 20px
    );
    color: var(--color-text-muted);
    text-align: center;
    padding: var(--space-md);
}
.help-shot-icon { font-size: 1.75rem; }
.help-shot-text { font-weight: 600; }
.help-shot-placeholder code {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
}

/* =============================================================================
   Ikonväljare (händelsetyper)
   ============================================================================= */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--space-sm);
}
.icon-picker-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: var(--space-sm) var(--space-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.icon-picker-option:hover {
    background-color: var(--color-bg);
    border-color: var(--color-bg-alt);
}
.icon-picker-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.icon-picker-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}
.icon-picker-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.2;
}
.icon-picker-option:has(input:checked) {
    border-color: var(--color-bg-alt);
    background-color: var(--color-bg);
}
.icon-picker-option:has(input:checked) .icon-picker-tile,
.icon-picker-option:has(input:checked) .icon-picker-label {
    color: var(--color-bg-alt);
}
.icon-picker-option:has(input:focus-visible) {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Linjeikon i händelsetyp-badge och tidslinje */
.badge svg { margin-right: 0.3em; }
.event-entry .history-icon { color: var(--color-bg-alt); }

/* =============================================================================
   14. INTERAKTIVA FRONTEND-EFFEKTER
   Reveal-on-scroll och tilt/glow-kort.
   Dolt-läget sätts av JS (klassen .reveal-target) → fungerar utan JS.
   ============================================================================= */

/* --- Reveal-on-scroll --- */
.reveal-target {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
.reveal-target.is-visible {
    opacity: 1;
    transform: none;
}

/* --- Tilt + glow-kort --- */
.tilt-card {
    position: relative;
    isolation: isolate;
    transform: perspective(900px) rotateX(var(--tilt-rx, 0deg)) rotateY(var(--tilt-ry, 0deg));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.tilt-card.is-tilting {
    transition: transform 0.08s linear, box-shadow 0.2s ease;
    box-shadow: var(--shadow-xl);
}
/* Mjuk "spotlight"-glow bakom innehållet (z-index -1 inom eget stacking-context) */
.tilt-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%),
                rgba(79, 70, 229, 0.16), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tilt-card.is-tilting::before {
    opacity: 1;
}

/* --- Respektera reducerad rörelse --- */
@media (prefers-reduced-motion: reduce) {
    .reveal-target {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .tilt-card,
    .tilt-card.is-tilting {
        transform: none !important;
    }
}


