/* ===================================================
   Navium – Design System
   Primary: #1D9E75 (teal/green)
   Fonts: DM Serif Display (headings) + DM Sans (body)
   =================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: #1a1a2e;
    background: #fafafa;
    line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
}

/* --- Colors --- */
:root {
    --primary: #1D9E75;
    --primary-dark: #178a65;
    --primary-light: #e8f5f0;
    --primary-bg: #f0faf6;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg: #fafafa;
    --white: #ffffff;
    --border: #e5e7eb;
    --border-light: rgba(0,0,0,0.06);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

/* --- Utility --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
    border-radius: var(--radius);
}

/* --- Navbar --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.navbar-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    color: var(--text);
    letter-spacing: -0.5px;
}

.navbar-logo .accent {
    color: var(--primary);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    transition: color 0.2s;
}
.navbar-links a:hover {
    color: var(--text);
}
.navbar-links a.btn-primary {
    color: var(--white);
}
.navbar-links a.btn-primary:hover {
    color: var(--white);
}

/* Navbar hamburger toggle (hidden on desktop) */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
}
.navbar-toggle:active {
    color: var(--primary);
}

@media (max-width: 768px) {
    .navbar-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        gap: 16px;
        box-shadow: var(--shadow);
        z-index: 50;
    }
    .navbar-links.open {
        display: flex;
    }
    .navbar-links .btn {
        align-self: flex-start;
    }
    .navbar {
        position: relative;
    }
    .navbar-toggle {
        display: flex;
        align-items: center;
    }
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-badge svg {
    width: 16px;
    height: 16px;
}

.hero h1 {
    max-width: 800px;
    margin: 0 auto 20px;
}

.hero h1 .accent {
    color: var(--primary);
    font-style: italic;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.hero-price {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
}

/* --- Feature Grid --- */
.features {
    padding: 80px 0;
}

.features-header {
    text-align: center;
    margin-bottom: 48px;
}

.features-header p {
    color: var(--text-light);
    margin-top: 12px;
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .features-grid { grid-template-columns: 1fr; }
}

.feature-card {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* Pillar color variants */
.pillar-board { background: #f0f6ff; }
.pillar-board .feature-icon { background: #dbeafe; }
.pillar-board .feature-icon svg { color: #3b82f6; }
.pillar-portal { background: var(--primary-light); }
.pillar-ai { background: #f5f3ff; }
.pillar-ai .feature-icon { background: #ede9fe; }
.pillar-ai .feature-icon svg { color: #8b5cf6; }

/* Sub-feature card color accents (icon only) */
.feature-card.accent-board .feature-icon svg { color: #3b82f6; }
.feature-card.accent-ai .feature-icon svg { color: #8b5cf6; }

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Gallery / Slideshow --- */
.gallery {
    padding: 80px 0;
    background: var(--primary-bg);
}

.gallery-header {
    text-align: center;
    margin-bottom: 48px;
}

.gallery-header p {
    color: var(--text-light);
    margin-top: 12px;
}

.gallery-track {
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 0.5px solid var(--border);
}

.gallery-slides {
    display: flex;
    transition: transform 0.5s ease;
}

.gallery-slides img {
    width: 100%;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
}

.gallery-dot.active {
    background: var(--primary);
}

/* --- Pricing --- */
.pricing {
    padding: 80px 0;
}

.pricing-header {
    text-align: center;
    margin-bottom: 48px;
}

.pricing-header p {
    color: var(--text-light);
    margin-top: 12px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .pricing-grid { grid-template-columns: 1fr; }
}

.pricing-card {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--primary);
    border-width: 2px;
}

.pricing-card .popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 4px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-card h3 {
    margin-bottom: 8px;
}

.pricing-card .price {
    font-family: 'DM Serif Display', serif;
    font-size: 2.5rem;
    margin-bottom: 4px;
}
.pricing-card .price small {
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-light);
}

.pricing-card .price-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.pricing-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.pricing-features li svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.pricing-card .btn {
    width: 100%;
}

/* --- Footer --- */
.footer {
    padding: 48px 0;
    border-top: 0.5px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
}
.footer-logo .accent { color: var(--primary); }

.footer-links {
    display: flex;
    gap: 24px;
}
.footer-links a {
    font-size: 0.9rem;
    color: var(--text-light);
}
.footer-links a:hover { color: var(--text); }

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ===================================================
   App Layout (authenticated pages)
   =================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 0;
    margin-bottom: 0;
}

.sidebar-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    padding: 0 24px;
    margin-bottom: 32px;
}
.sidebar-logo .accent { color: var(--primary); }

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.15s;
}
.sidebar-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 0.5px solid var(--border);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.sidebar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

/* --- Main Content --- */
.app-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    background: var(--bg);
    min-height: 100vh;
}

.app-main h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.app-main .subtitle {
    color: var(--text-light);
    margin-bottom: 32px;
}

/* --- Freemium Banner --- */
.freemium-banner {
    background: linear-gradient(135deg, var(--primary-light), #dff5ec);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.freemium-banner p {
    font-size: 0.9rem;
    color: var(--text);
}

.freemium-banner .btn {
    padding: 8px 20px;
    font-size: 0.85rem;
}

/* --- Cards --- */
.card {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 1.1rem;
}

/* --- Quick Links Grid --- */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.quick-link {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}
.quick-link:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.quick-link .icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-link .icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.quick-link .label {
    font-weight: 600;
    font-size: 0.9rem;
}
.quick-link .desc {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* --- Chat UI (Juridik, K3, etc.) --- */
.chat-layout {
    display: flex;
    gap: 24px;
    height: calc(100vh - 140px);
}

.chat-sidebar {
    width: 280px;
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-sidebar-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-light);
    transition: background 0.15s;
}
.chat-sidebar-item:hover {
    background: var(--primary-light);
}
.chat-sidebar-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.chat-panel {
    flex: 1;
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-panel-input {
    padding: 16px;
    border-top: 0.5px solid var(--border);
    display: flex;
    gap: 12px;
}

.chat-panel-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s;
    min-height: 48px;
    max-height: 120px;
}
.chat-panel-input textarea:focus {
    border-color: var(--primary);
}

.chat-panel-input .btn {
    align-self: flex-end;
    padding: 12px 20px;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* --- Auth Pages --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.auth-card {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    text-align: center;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.auth-card .btn {
    width: 100%;
    margin-top: 8px;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-card .auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* --- Data Table --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1.5px solid var(--border);
}
.data-table td {
    padding: 12px;
    border-bottom: 0.5px solid var(--border);
    color: var(--text);
}
.data-table tbody tr {
    transition: background 0.15s;
}
.data-table tbody tr:hover {
    background: var(--primary-light);
}
.data-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.01);
}
.data-table tbody tr:nth-child(even):hover {
    background: var(--primary-light);
}

/* --- Status Badge --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge.planerad { background: #dbeafe; color: #1d4ed8; }
.status-badge.pagaende { background: #fef3c7; color: #92400e; }
.status-badge.utford { background: #f0fdf4; color: #16a34a; }
.status-badge.avbokad { background: #f3f4f6; color: #6b7280; }
.status-badge.inkommen { background: #dbeafe; color: #1d4ed8; }
.status-badge.godkand { background: var(--primary-light); color: var(--primary); }
.status-badge.nekad { background: #fef2f2; color: #dc2626; }
.status-badge.genomford { background: #f0fdf4; color: #16a34a; }
.status-badge.aktiv { background: var(--primary-light); color: var(--primary); }
.status-badge.inaktiv { background: #fef2f2; color: #dc2626; }
.status-badge.hog { background: #fef2f2; color: #dc2626; }
.status-badge.medel { background: #fef3c7; color: #92400e; }
.status-badge.lag { background: #f0fdf4; color: #16a34a; }

/* --- Warning Banner --- */
.warning-banner {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #92400e;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Detail Grid --- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.detail-grid .detail-item {
    padding: 12px 0;
    border-bottom: 0.5px solid var(--border);
}
.detail-grid .detail-item .detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.detail-grid .detail-item .detail-value {
    font-size: 0.95rem;
    font-weight: 500;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    background: var(--white);
    outline: none;
}
.filter-bar select:focus {
    border-color: var(--primary);
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding-bottom: 16px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--white);
}
.timeline-item .timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.timeline-item .timeline-content {
    font-size: 0.85rem;
}

/* --- Year Group (Underhållsplan) --- */
.year-group {
    margin-bottom: 32px;
}
.year-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}
.year-group-header h3 {
    font-size: 1.25rem;
    color: var(--primary);
}
.year-group-header .year-total {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* --- Chart Container --- */
.chart-container {
    position: relative;
    width: 100%;
    max-height: 300px;
}

/* --- Print --- */
@media print {
    .sidebar { display: none !important; }
    .app-main { margin-left: 0 !important; padding: 0 !important; }
    .freemium-banner { display: none !important; }
    .btn, button, .filter-bar { display: none !important; }
    .no-print { display: none !important; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 6px 8px; }
    .card { border: none; box-shadow: none; padding: 0; }
}

/* --- Mobile Top Bar (outside .app-layout) --- */
.mobile-topbar {
    display: none; /* hidden on desktop */
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.mobile-topbar button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.mobile-topbar button:active {
    background: var(--primary-light);
}

/* Sidebar close button (hidden on desktop) */
.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    border-radius: 6px;
}
.sidebar-close-btn:hover {
    color: var(--text);
    background: var(--primary-light);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 12px;
}

/* Sidebar backdrop overlay (hidden on desktop) */
.sidebar-backdrop {
    display: none; /* hidden on desktop */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* --- Responsive: Tablet & Mobile (<=900px) --- */
@media (max-width: 900px) {
    /* Show mobile top bar */
    .mobile-topbar {
        display: flex;
    }

    /* Show sidebar close button */
    .sidebar-close-btn {
        display: flex;
    }

    /* Show backdrop */
    .sidebar-backdrop {
        display: block;
    }

    /* Sidebar: slide off-screen, slide in when .open */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Main content: no sidebar margin */
    .app-main {
        margin-left: 0;
        padding: 24px 16px;
        min-height: auto;
    }
    .app-main h1 {
        font-size: 1.5rem;
    }

    /* Tables scroll horizontally on mobile */
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    .data-table {
        min-width: 600px;
    }

    /* Stack detail grids */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Filter bar wraps */
    .filter-bar {
        flex-wrap: wrap;
    }

    /* Chat layout stacks */
    .chat-layout {
        flex-direction: column;
        height: auto;
    }
    .chat-sidebar {
        width: 100%;
        max-height: 200px;
    }

    /* Forms single column */
    .form-grid-2 {
        grid-template-columns: 1fr !important;
    }

    /* Quick links full width */
    .quick-links {
        grid-template-columns: 1fr;
    }

    /* Freemium banner stacks */
    .freemium-banner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 12px;
    }
    .card {
        padding: 16px;
    }
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* --- Onboarding Wizard --- */
.onboarding-container {
    max-width: 800px;
    margin: 0 auto;
}

.onboarding-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.onboarding-header h2 {
    font-size: 1.75rem;
    margin: 0;
}

.onboarding-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

.onboarding-progress {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    gap: 0;
}

.onboarding-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    flex-shrink: 0;
}

.onboarding-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg);
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.onboarding-step.active .onboarding-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.onboarding-step.completed .onboarding-step-circle {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.onboarding-step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.onboarding-step.active .onboarding-step-label {
    color: var(--primary);
}

.onboarding-step.completed .onboarding-step-label {
    color: var(--text);
}

.onboarding-step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 22px;
}

.onboarding-step-line.completed {
    background: var(--primary);
}

.onboarding-card {
    padding: 0;
}

.onboarding-card .card-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.onboarding-card .card-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.onboarding-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.onboarding-next-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.onboarding-next-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.onboarding-sidebar-link {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm);
    margin: 4px 8px 8px !important;
}

.onboarding-sidebar-link:hover {
    background: var(--primary) !important;
    color: white !important;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
}

@media (max-width: 768px) {
    .onboarding-header {
        flex-direction: column;
    }
    .onboarding-step-label {
        display: none;
    }
    .onboarding-step-line {
        margin-bottom: 0;
    }
    .onboarding-progress {
        justify-content: center;
    }
}

/* Beslut cards */
.beslut-card {
    transition: border-color 0.2s, box-shadow 0.2s;
}
.beslut-card:hover {
    border-left-color: var(--primary) !important;
    box-shadow: var(--shadow-sm);
}

/* --- Notification Center --- */
.notis-wrapper {
    position: fixed;
    top: 16px;
    right: 24px;
    z-index: 150;
}
.notis-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s, box-shadow 0.15s;
}
.notis-bell:hover {
    background: var(--bg);
    box-shadow: var(--shadow-sm);
}
.notis-bell svg {
    width: 20px;
    height: 20px;
}
.notis-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.notis-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.notis-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
}
.notis-dropdown-header button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}
.notis-dropdown-header button:hover {
    text-decoration: underline;
}
.notis-list {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}
.notis-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background 0.1s;
    align-items: flex-start;
}
.notis-item:hover {
    background: var(--bg);
}
.notis-item.olast {
    background: #f0fdf4;
}
.notis-item.olast:hover {
    background: #e0f7ec;
}
.notis-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.notis-item-icon svg {
    width: 16px;
    height: 16px;
}
.notis-item-content {
    flex: 1;
    min-width: 0;
}
.notis-item-rubrik {
    font-size: 0.85rem;
    line-height: 1.3;
}
.notis-item.olast .notis-item-rubrik {
    font-weight: 600;
}
.notis-item-beskrivning {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notis-item-tid {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-top: 2px;
}
.notis-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.notis-dropdown-footer a {
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.notis-dropdown-footer a:hover {
    text-decoration: underline;
}
.notis-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Notification Center: mobile topbar bell */
.mobile-topbar .notis-bell-mobile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text);
    margin-left: auto;
}
.mobile-topbar .notis-bell-mobile svg {
    width: 20px;
    height: 20px;
}

/* Full-page notification list items */
.notis-fullpage-item {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background 0.1s;
}
.notis-fullpage-item:hover {
    background: var(--bg);
}
.notis-fullpage-item.olast {
    background: #f0fdf4;
}

@media (max-width: 900px) {
    .notis-wrapper {
        display: none;
    }
}
@media (max-width: 480px) {
    .notis-dropdown {
        width: calc(100vw - 16px);
        right: -8px;
    }
}
