* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
    background: #f8fafc;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* Stadigvarande vänstermeny */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar h1 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin: 0 0 1rem;
}

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

.sidebar li {
    margin-bottom: 0.25rem;
}

.sidebar a {
    display: block;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.95rem;
}

.sidebar a:hover {
    background: #334155;
}

.sidebar a.active {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}

.sidebar .older-years {
    margin-bottom: 0.25rem;
}

.sidebar .older-years summary {
    cursor: pointer;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    font-size: 0.95rem;
    list-style: none;
}

.sidebar .older-years summary::-webkit-details-marker {
    display: none;
}

.sidebar .older-years summary::before {
    content: "\25B8";
    display: inline-block;
    width: 1em;
    margin-right: 0.25em;
    transition: transform 0.15s ease;
}

.sidebar .older-years[open] summary::before {
    transform: rotate(90deg);
}

.sidebar .older-years summary:hover {
    background: #334155;
}

.sidebar .older-years ul {
    margin-top: 0.25rem;
}

.content {
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: 900px;
}

.content h1 {
    margin-top: 0;
}

.content.content-wide {
    max-width: none;
}

.table-scroll {
    overflow-x: auto;
}

.nowrap-table td,
.nowrap-table th {
    white-space: nowrap;
}

.welcome-image {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.doc-category {
    margin-bottom: 1.75rem;
}

.doc-category h2 {
    font-size: 1.15rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.35rem;
}

.doc-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.doc-list li {
    margin-bottom: 0.35rem;
}

.doc-list a {
    color: #2563eb;
    text-decoration: none;
}

.doc-list a:hover {
    text-decoration: underline;
}

.user-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 2rem;
}

.user-table th,
.user-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.inline-form {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.profile-form {
    max-width: 480px;
    margin-bottom: 2rem;
}

.profile-form fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem 0.25rem;
}

.profile-form legend {
    padding: 0 0.4rem;
    font-weight: 600;
    color: #475569;
}

.profile-form input.field-invalid {
    border: 1px solid #dc2626;
    outline-color: #dc2626;
    background: #fef2f2;
}

.profile-form .field-hint {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: #dc2626;
}
