/* SkaraKollen - Modern ljus design */

/* === VARIABLER === */
:root {
    --primary: #1a5f7a;
    --primary-light: #2a7d9c;
    --primary-dark: #144a5e;
    --primary-bg: #e8f4f8;

    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
}

/* === LAYOUT === */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary);
}

.sidebar-logo svg {
    width: 32px;
    height: 32px;
}

.sidebar-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-bg);
    font-weight: 500;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-body {
    padding: 2rem;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-hover);
}

/* === STAT CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}

.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.stat-info-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-source {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === SOURCE INFO TOOLTIP === */
.source-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    min-width: 280px;
    z-index: 100;
    font-size: 0.8125rem;
}

.source-tooltip h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.source-tooltip dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
}

.source-tooltip dt {
    color: var(--text-muted);
}

.source-tooltip dd {
    color: var(--text-secondary);
}

.source-tooltip pre {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* === ALERTS === */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.alert-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.alert.high {
    background: var(--danger-bg);
    border: 1px solid #fecaca;
}

.alert.high .alert-icon {
    color: var(--danger);
}

.alert.high .alert-title {
    color: var(--danger);
}

.alert.medium {
    background: var(--warning-bg);
    border: 1px solid #fde68a;
}

.alert.medium .alert-icon {
    color: var(--warning);
}

.alert.medium .alert-title {
    color: #b45309;
}

.alert.low {
    background: var(--info-bg);
    border: 1px solid #bfdbfe;
}

.alert.low .alert-icon {
    color: var(--info);
}

.alert.low .alert-title {
    color: var(--info);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

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

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

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

.form-input:disabled {
    background: var(--bg-hover);
    cursor: not-allowed;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em;
    padding-right: 2.5rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* === TABLES === */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-hover);
    white-space: nowrap;
}

.table th.sortable {
    cursor: pointer;
    user-select: none;
}

.table th.sortable:hover {
    background: var(--border);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table td {
    color: var(--text-primary);
}

.table .text-right {
    text-align: right;
}

.table .text-center {
    text-align: center;
}

.table .mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: #b45309;
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-neutral {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* === CHARTS === */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* === LOADING === */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-light) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === LOGIN PAGE === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--bg-page) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo svg {
    width: 40px;
    height: 40px;
    color: white;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.login-error {
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* === FILTERS === */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    min-width: 150px;
}

/* === GRID LAYOUTS === */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

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

    .page-body {
        padding: 1rem;
    }
}

/* === TABS === */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

.empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    max-width: 400px;
    margin: 0 auto;
}

/* === WASTE INDICATORS === */
.indicator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.indicator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.indicator-card.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.indicator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.indicator-type {
    font-weight: 600;
    color: var(--text-primary);
}

.indicator-severity {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.indicator-severity.high {
    background: var(--danger-bg);
    color: var(--danger);
}

.indicator-severity.medium {
    background: var(--warning-bg);
    color: #b45309;
}

.indicator-severity.low {
    background: var(--info-bg);
    color: var(--info);
}

.indicator-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.indicator-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* === KPI LIST === */
.kpi-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 200px);
}

.kpi-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kpi-list-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.kpi-search {
    width: 100%;
}

.kpi-items {
    flex: 1;
    overflow-y: auto;
}

.kpi-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s ease;
}

.kpi-item:hover {
    background: var(--bg-hover);
}

.kpi-item.selected {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary);
}

.kpi-item.multi-selected {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
}

.kpi-item.multi-selected:not(.selected) {
    border-left-color: var(--success);
}

.category-tabs {
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.kpi-item-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.kpi-item-area {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.kpi-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    overflow-y: auto;
}

/* === SIMULATION === */
.simulation-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

.scenario-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.scenario-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
}

.scenario-item:hover {
    background: var(--bg-hover);
}

.scenario-item.selected {
    background: var(--primary-bg);
}

.scenario-name {
    font-weight: 600;
    color: var(--text-primary);
}

.scenario-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.simulation-results {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* === CALCULATION DISPLAY === */
.calculation-box {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin: 1rem 0;
}

.calculation-box .formula {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.calculation-box .values {
    color: var(--text-primary);
}

.calculation-box .result {
    color: var(--primary);
    font-weight: 600;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* === UTILITIES === */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.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;
}

/* ============================================
   Notiser & Sambandsanalys
   ============================================ */

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Notis-kort */
.annotation-card {
    border: 1px solid var(--border);
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

.annotation-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.annotation-year {
    background: var(--warning-bg);
    color: var(--warning);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.125rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.annotation-actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.annotation-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.badge-remove {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0 0.125rem;
    font-size: 0.7rem;
    color: inherit;
    opacity: 0.7;
}

.badge-remove:hover { opacity: 1; }

/* KPI-väljare i modal/analys */
.annotation-kpi-picker {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.annotation-kpi-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}

.annotation-kpi-option:last-child { border-bottom: none; }
.annotation-kpi-option:hover { background: var(--bg-hover); }
.annotation-kpi-option.linked { background: var(--primary-bg); }

/* Tidslinje */
.timeline-group { margin-bottom: 2rem; }

.timeline-year {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--primary-bg);
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
}

/* Sambandsanalys */
.correlation-pickers {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.correlation-charts {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.correlation-charts .card { min-width: 320px; }

.picked-kpi {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-bg);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

.scan-row { cursor: pointer; }
.scan-row:hover { background: var(--bg-hover); }

.warning-callout {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: 8px;
    color: #92400e;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.strength-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.strength-very-strong { background: #dcfce7; color: #166534; }
.strength-strong { background: #d1fae5; color: #047857; }
.strength-moderate { background: var(--info-bg); color: #1d4ed8; }
.strength-weak { background: var(--bg-hover); color: var(--text-secondary); }
.strength-none { background: var(--bg-hover); color: var(--text-muted); }
