/* SNI-kodregister 2025 - styles */
.snikod-wrapper,
.snikod-kodsida {
    max-width: 820px;
    margin: 2em auto;
    padding: 1.5em;
    background: #ffffff;
    line-height: 1.6;
}

.snikod-header {
    border-bottom: 3px solid #1e3a5f;
    padding-bottom: 1em;
    margin-bottom: 1.5em;
}

.snikod-header h2 {
    margin: 0 0 0.3em 0;
    color: #1e3a5f;
    font-size: 1.8em;
}

.snikod-subtitle {
    margin: 0;
    color: #4b5563;
}

.snikod-search-box {
    margin-bottom: 1.5em;
}

.snikod-search-box label {
    display: block;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 0.4em;
}

.snikod-search-box input {
    width: 100%;
    padding: 0.8em 1em;
    font-size: 1.1em;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    background: #ffffff;
}

.snikod-search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Resultatlista */
.snikod-results {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1.5em;
    max-height: 500px;
    overflow-y: auto;
}

.snikod-result-item {
    display: block;
    padding: 0.8em 1em;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.snikod-result-item:hover {
    background: #eff6ff;
}

.snikod-result-item:last-child {
    border-bottom: none;
}

.snikod-result-kod {
    display: inline-block;
    font-family: monospace;
    background: #1e3a5f;
    color: #ffffff !important;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.9em;
    margin-right: 0.6em;
    min-width: 60px;
    text-align: center;
}

.snikod-result-niva {
    display: inline-block;
    background: #e5e7eb;
    color: #4b5563;
    padding: 0.1em 0.5em;
    border-radius: 3px;
    font-size: 0.75em;
    margin-left: 0.4em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.snikod-result-niva-gammal {
    background: #fef3c7;
    color: #92400e;
}

.snikod-result-gammal {
    background: #fffbeb;
}

.snikod-result-pil {
    display: inline-block;
    margin-left: 0.6em;
    color: #059669;
    font-weight: 600;
    font-size: 0.9em;
}

.snikod-result-namn {
    color: #1f2937;
    font-weight: 500;
}

.snikod-result-beskrivning {
    display: block;
    color: #6b7280;
    font-size: 0.9em;
    margin-top: 0.3em;
    margin-left: 70px;
}

.snikod-no-results {
    padding: 1em;
    color: #6b7280;
    text-align: center;
}

/* Avdelnings-grid */
.snikod-wrapper h3 {
    color: #1e3a5f;
    margin-top: 1.5em;
}

.snikod-avdelningar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.6em;
    margin: 1em 0 2em;
}

.snikod-avdelning-card {
    display: flex;
    align-items: center;
    padding: 0.8em 1em;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.15s;
}

.snikod-avdelning-card:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}

.snikod-avd-kod {
    font-family: monospace;
    font-size: 1.2em;
    font-weight: 700;
    color: #1e3a5f;
    background: #f1f5f9;
    padding: 0.3em 0.6em;
    border-radius: 4px;
    margin-right: 0.8em;
    min-width: 2em;
    text-align: center;
}

.snikod-avd-namn {
    font-size: 0.9em;
    color: #1f2937;
    flex: 1;
}

/* Info-box */
.snikod-info-box {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    padding: 1em 1.2em;
    border-radius: 4px;
    margin: 1.5em 0;
}

.snikod-info-box h3 {
    margin-top: 0;
    color: #1e3a5f;
}

/* Enskild kod-sida */
.snikod-breadcrumb {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 1em;
}

.snikod-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.snikod-breadcrumb a:hover {
    text-decoration: underline;
}

.snikod-kodsida h1 {
    color: #1e3a5f;
    border-bottom: 3px solid #1e3a5f;
    padding-bottom: 0.5em;
}

.snikod-kodsida h2 {
    color: #1e3a5f;
    margin-top: 1.5em;
}

.snikod-faktaruta {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1em 1.2em;
    margin: 1em 0;
}

.snikod-faktatable {
    width: 100%;
    border-collapse: collapse;
}

.snikod-faktatable th,
.snikod-faktatable td {
    padding: 0.5em 0.8em 0.5em 0;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.snikod-faktatable th {
    font-weight: 600;
    color: #4b5563;
    width: 180px;
    font-size: 0.9em;
    white-space: nowrap;
}

.snikod-faktatable tr:last-child th,
.snikod-faktatable tr:last-child td {
    border-bottom: none;
}

.snikod-faktatable code {
    background: #1e3a5f;
    color: #ffffff;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.95em;
}

/* Lista-tabell */
.snikod-lista {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.snikod-lista thead th {
    background: #1e3a5f;
    color: #ffffff !important;
    padding: 0.7em;
    text-align: left;
    border: 1px solid #1e3a5f;
}

.snikod-lista tbody td {
    padding: 0.6em 0.7em;
    border: 1px solid #e5e7eb;
}

.snikod-lista tbody tr:nth-child(even) {
    background: #f9fafb;
}

.snikod-lista tbody tr:hover {
    background: #eff6ff;
}

.snikod-lista a {
    color: #3b82f6;
    text-decoration: none;
}

.snikod-lista a:hover {
    text-decoration: underline;
}

.snikod-lista code {
    background: #f1f5f9;
    padding: 0.1em 0.5em;
    border-radius: 3px;
    font-size: 0.9em;
    color: #1e3a5f;
}

/* Hjälpruta */
.snikod-hjalp-ruta {
    background: #ecfdf5;
    border-left: 4px solid #34d399;
    padding: 1em 1.2em;
    border-radius: 4px;
    margin: 1.5em 0;
}

.snikod-hjalp-ruta h3 {
    margin-top: 0;
    color: #065f46;
}

.snikod-back {
    margin-top: 2em;
}

.snikod-back a {
    color: #3b82f6;
    text-decoration: none;
}

.snikod-back a:hover {
    text-decoration: underline;
}

/* Rika kodsidor (v1.1.0) */
.snikod-intro {
    font-size: 1.1em;
    color: #1f2937;
    line-height: 1.5;
    margin: 1em 0 1.5em;
    padding: 0.8em 1.2em;
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
}

.snikod-lista-punkter {
    padding-left: 1.5em;
    margin: 0.8em 0 1.5em;
}

.snikod-lista-punkter li {
    margin-bottom: 0.4em;
    line-height: 1.5;
}

.snikod-lista-punkter a {
    color: #3b82f6;
    text-decoration: none;
}

.snikod-lista-punkter a:hover {
    text-decoration: underline;
}

.snikod-exempel-lista {
    column-count: 2;
    column-gap: 2em;
}

@media (max-width: 700px) {
    .snikod-exempel-lista {
        column-count: 1;
    }
}

.snikod-exempel-lista li {
    break-inside: avoid;
}

.snikod-exkludera-lista {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 1em 1.2em 1em 2.5em;
    border-radius: 4px;
    margin: 1em 0 1.5em;
}

.snikod-exkludera-lista li {
    color: #7f1d1d;
}

.snikod-exkludera-lista code {
    background: #fff;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    color: #1e3a5f;
}

.snikod-kodsida h2 {
    color: #1e3a5f;
    margin-top: 1.8em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #e5e7eb;
}

.snikod-kodsida h3 {
    color: #1e3a5f;
    margin-top: 1.3em;
    font-size: 1.15em;
}

@media (max-width: 600px) {
    .snikod-wrapper,
    .snikod-kodsida {
        padding: 1em;
    }

    .snikod-avdelningar {
        grid-template-columns: 1fr;
    }

    .snikod-faktatable th {
        width: auto;
        display: block;
    }

    .snikod-faktatable td {
        display: block;
        padding-top: 0;
    }
}
