:root {
    --color-primary: #075985;
    --color-primary-dark: #0c4a6e;
    --color-surface: #ffffff;
    --color-background: #f1f5f9;
    --color-text: #172033;
    --color-muted: #526174;
    --color-border: #dbe3ec;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a { color: var(--color-primary); }

a:focus-visible,
button:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #0f172a;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .2);
}

.site-nav {
    display: flex;
    align-items: center;
    min-height: 58px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-logo {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

.nav-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: #e2e8f0;
    text-decoration: none;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
    background: #334155;
    color: #fff;
}

.nav-menu .logout-link { color: #fecaca; }

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
    display: block;
    width: 24px;
    height: 2px;
    margin: auto;
    background: currentColor;
    content: "";
}

.nav-toggle-icon::before { transform: translateY(-7px); }
.nav-toggle-icon::after { transform: translateY(5px); }

.site-content {
    width: min(1180px, calc(100% - 32px));
    min-height: calc(100vh - 104px);
    margin: 0 auto;
    padding: 32px 0;
}

.site-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    text-align: center;
}

.dashboard-header { margin-bottom: 28px; }
.dashboard-header h1 { margin: 0 0 6px; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.dashboard-header p { max-width: 720px; margin: 0; color: var(--color-muted); }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-card {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.dashboard-card h2 { margin: 0 0 8px; font-size: 1.25rem; }
.dashboard-card p { margin: 0 0 20px; color: var(--color-muted); }
.dashboard-card .dashboard-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--color-text);
}
.dashboard-count strong {
    font-size: 1.75rem;
    color: var(--color-primary);
}
.dashboard-case-lists {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.dashboard-case-lists h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
}
.dashboard-case-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.dashboard-case-list li + li {
    border-top: 1px solid var(--color-border);
}
.dashboard-case-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 0;
    color: var(--color-text);
    text-decoration: none;
}
.dashboard-case-list a:hover span {
    color: var(--color-primary);
}
.dashboard-case-list small {
    color: var(--color-muted);
}
@media (max-width: 700px) {
    .dashboard-case-lists {
        grid-template-columns: 1fr;
    }
}

.dashboard-action {
    align-self: flex-start;
    margin-top: auto;
    padding: 9px 14px;
    border-radius: 7px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-action:hover { background: var(--color-primary-dark); }

/* Kompatibilitet med eksisterende undersider. */
.content { background: var(--color-background); }
.rcorners1, .rcorners2, .rcornersmicro { background: var(--color-surface); }
.rcorners1 { padding: 20px; border-radius: 14px; }
.rcorners2 { margin-bottom: 10px; padding: 5px 10px; border-radius: 7px; }
.rcornersmicro { padding: 5px 10px; border-radius: 3px; }
.buttonsub { width: 100%; border-radius: 4px; background: #008cba; font-size: 22px; }
.buttonselect { width: 50%; border-radius: 4px; background: #808080; font-size: 18px; }

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .site-nav { flex-wrap: wrap; padding: 7px 16px; }
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        width: 100%;
        max-height: calc(100vh - 58px);
        margin: 7px 0 0;
        padding: 8px 0 14px;
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu a { padding: 12px; }
    .site-content { width: min(100% - 24px, 1180px); padding: 22px 0; }
}

@media (max-width: 560px) {
    .dashboard-grid,
    .dashboard-grid-two { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
