@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: #00AEEF;
}

.btn-primary {
    color: #fff;
    background-color: #00AEEF;
    border-color: #0099d4;
}

.btn-primary:hover {
    background-color: #0099d4;
    border-color: #0088bc;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #00AEEF;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Ett fel har uppstått.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ===== KANALENS DAG ADMIN LAYOUT & SIDEBAR ===== */

/* Dold checkbox för mobil-toggle */
.kd-sidebar-checkbox {
    display: none;
}

/* Overlay vid öppen sidebar på mobil */
.kd-sidebar-overlay {
    display: none;
}

/* Layout */
.kd-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ── */
.kd-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 50px;
    background-color: #192734;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: white;
}

.kd-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kd-header-title {
    font-weight: 700;
    font-size: 1rem;
}

.kd-header-title span {
    color: #E31E24;
}

.kd-header-subtitle {
    font-size: 0.7rem;
    opacity: 0.6;
    font-weight: 400;
    margin-left: 8px;
}

.kd-hamburger {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    color: white;
    transition: background-color 0.15s;
}

.kd-hamburger:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.kd-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Profilmeny ── */
.kd-user-menu {
    position: relative;
}

.kd-user-trigger {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

.kd-user-trigger::-webkit-details-marker {
    display: none;
}

.kd-user-trigger:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.kd-user-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: white;
}

.kd-user-chevron {
    font-size: 1.2rem !important;
    transition: transform 0.2s;
}

.kd-user-menu[open] .kd-user-chevron {
    transform: rotate(180deg);
}

.kd-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    min-width: 180px;
    z-index: 1001;
}

.kd-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.88rem;
    transition: background-color 0.12s;
}

.kd-user-dropdown-item:hover {
    background-color: #e8f7fd;
    color: #00AEEF;
}

.kd-user-dropdown-item .material-symbols-outlined {
    font-size: 1.15rem;
    color: #999;
}

/* ── Sidebar ── */
.kd-sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    bottom: 0;
    width: 260px;
    background-color: #1e3044;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    z-index: 900;
    transition: transform 0.25s ease;
}

.kd-sidebar::-webkit-scrollbar {
    width: 6px;
}

.kd-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* ── Huvudinnehåll ── */
.kd-main {
    margin-top: 50px;
    margin-left: 260px;
    padding: 1.5rem 2rem;
    min-height: calc(100vh - 50px);
    transition: margin-left 0.25s ease;
    background-color: #f8f9fa;
}

/* ── Sidebar-item (nivå 1) ── */
.kd-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
    list-style: none;
}

.kd-sidebar-item::-webkit-details-marker {
    display: none;
}

.kd-sidebar-item:hover {
    background-color: rgba(0, 174, 239, 0.18);
    color: #fff;
    text-decoration: none;
}

.kd-sidebar-item.active {
    background-color: rgba(0, 174, 239, 0.25);
    color: #fff;
    border-left: 3px solid #00AEEF;
}

/* ── Sidebar-item ikoner ── */
.kd-sidebar .material-symbols-outlined {
    font-size: 1.25rem;
    opacity: 0.75;
}

/* ── Chevron (expand/collapse-pil) ── */
.kd-sidebar-chevron {
    margin-left: auto;
    font-size: 1.1rem !important;
    opacity: 0.5;
    transition: transform 0.2s;
}

details.kd-sidebar-group[open] > summary .kd-sidebar-chevron {
    transform: rotate(180deg);
    opacity: 0.8;
    color: rgba(0, 174, 239, 0.8);
}

/* ── Öppen group-header: subtil bakgrund ── */
details.kd-sidebar-group[open] > summary.kd-sidebar-item {
    background-color: rgba(255, 255, 255, 0.06);
}

/* ── Submenu (barn-container) ── */
.kd-sidebar-submenu {
    border-left: 2px solid rgba(0, 174, 239, 0.4);
    margin-left: 24px;
    padding: 4px 0;
}

.kd-sidebar-submenu .kd-sidebar-submenu {
    margin-left: 16px;
    border-left-color: rgba(0, 174, 239, 0.25);
}

/* ── Subitem (nivå 2+) ── */
.kd-sidebar-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 1px 6px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.15s;
    list-style: none;
}

.kd-sidebar-subitem::-webkit-details-marker {
    display: none;
}

.kd-sidebar-subitem:hover {
    background-color: rgba(0, 174, 239, 0.15);
    color: #fff;
    text-decoration: none;
}

.kd-sidebar-subitem.active {
    background-color: rgba(0, 174, 239, 0.22);
    color: #fff;
    font-weight: 500;
}

/* Subgroup-toggle */
.kd-sidebar-subgroup-toggle {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

details.kd-sidebar-group[open] > .kd-sidebar-subgroup-toggle {
    color: rgba(255, 255, 255, 0.92);
}

/* Ikoner i submenyer */
.kd-sidebar-submenu .material-symbols-outlined {
    font-size: 1.05rem;
    opacity: 0.55;
}

/* ── Disabled items ── */
.kd-sidebar-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

/* ── Mobil: Responsiv ── */
@media (max-width: 768px) {
    .kd-sidebar {
        transform: translateX(-100%);
    }

    .kd-main {
        margin-left: 0;
        padding: 1rem;
    }

    .kd-sidebar-checkbox:checked ~ .kd-layout .kd-sidebar {
        transform: translateX(0);
    }

    .kd-sidebar-checkbox:checked ~ .kd-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 899;
    }
}

@media (min-width: 769px) {
    .kd-sidebar {
        transform: translateX(0);
    }
}
