:root {
    --jc-header-bg: #1f252b;
    --jc-header-bg-dark: #171c21;
    --jc-header-green: #16a34a;
    --jc-header-text: #ffffff;
    --jc-header-muted: #d1d5db;
    --jc-header-height: 86px;
}

/* =========================
     HEADER
  ========================= */

.jc-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    border-top: 4px solid var(--jc-header-green);
    background:
        linear-gradient(135deg,
            var(--jc-header-bg) 0%,
            var(--jc-header-bg-dark) 100%);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .2);
}

.jc-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: var(--jc-header-height);
    padding: 10px 22px;
}

/* =========================
     LOGO VÄNSTER
  ========================= */

.jc-header-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    text-decoration: none;
}

.jc-header-brand:hover {
    color: #fff;
}

.jc-header-logo {
    display: block;
    width: auto;
    height: 46px;
    max-width: 150px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    box-shadow: none;
    transition: transform .2s ease, opacity .2s ease;
}

.jc-header-brand:hover .jc-header-logo {
    transform: translateY(-1px);
    opacity: .92;
}

/* =========================
     HÖGERKNAPPAR
  ========================= */

.jc-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.jc-header-action {
    display: grid;
    place-items: center;
    width: 40px;
    height: 44px;
    border-radius: 11px;
    color: #fff;
    text-decoration: none;
    transition:
        background .2s ease,
        transform .2s ease;
}

.jc-header-action:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    transform: translateY(-1px);
}

.jc-header-action i {
    font-size: 1.5rem;
    line-height: 1;
}

.jc-header-notification {
    position: relative;
}

.jc-header-notification-dot {
    position: absolute;
    top: 6px;
    right: 4px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--jc-header-bg);
    border-radius: 50%;
    background: #22c55e;
}

/* =========================
     HAMBURGARE
  ========================= */

.menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: transparent;
    cursor: pointer;
    transition: none;
}


.menu-toggle {
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, .08);
    transform: translateY(-1px);
}

.menu-toggle:focus,
.menu-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.menu-toggle:active {
    background: rgba(255, 255, 255, .08);
}

.menu-toggle::-moz-focus-inner {
    border: 0;
}


.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    border-radius: 999px;
    background: #fff;
    transition:
        transform .25s ease,
        opacity .2s ease;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Förhindra att menyn blinkar till under sidladdning */
.jc-header-initializing .jc-menu {
    visibility: hidden !important;
    transform: translateX(105%) !important;
    transition: none !important;
}

.jc-header-initializing .jc-menu-backdrop {
    visibility: hidden !important;
    opacity: 0 !important;
    transition: none !important;
}

/* =========================
     SIDOMENY
  ========================= */

.jc-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: min(380px, 90vw);
    height: 100dvh;
    overflow: hidden;
    visibility: hidden;
    background:
        linear-gradient(180deg,
            #222930 0%,
            #171c21 100%);
    box-shadow: -18px 0 50px rgba(0, 0, 0, .35);
    transform: translateX(105%);
    transition:
        transform .28s ease,
        visibility .28s ease;
}

.jc-menu.show {
    visibility: visible;
    transform: translateX(0);
}

.jc-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 92px;
    padding: 18px 20px;
    border-top: 4px solid var(--jc-header-green);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.jc-menu-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--jc-header-green);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.jc-menu-user {
    display: block;
    max-width: 255px;
    overflow: hidden;
    color: #fff;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jc-menu-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    cursor: pointer;
}

.jc-menu-close i {
    font-size: 1.25rem;
}

/* =========================
     MENYALTERNATIV
  ========================= */

.jc-menu-list {
    flex: 1;
    margin: 0;
    padding: 12px 12px 28px;
    overflow-y: auto;
    list-style: none;

    /* Dölj scrollbar men behåll scrollfunktionen */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.jc-menu-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.jc-menu-list li {
    margin: 2px 0;
}

.jc-menu-list li a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 13px;
    color: var(--jc-header-muted);
    text-decoration: none;
    font-size: .96rem;
    font-weight: 550;
    transition:
        color .2s ease,
        background .2s ease,
        transform .2s ease;
}

.jc-menu-list li a i {
    display: grid;
    place-items: center;
    width: 24px;
    color: #fff;
    font-size: 1.15rem;
}

.jc-menu-list li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    transform: translateX(2px);
}

.jc-menu-list li a.active {
    color: #fff;
    background: rgba(22, 163, 74, .15);
}

.jc-menu-list li a.active i {
    color: #22c55e;
}

.jc-menu-list li a.active::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: var(--jc-header-green);
}

.jc-menu-section {
    margin: 17px 14px 7px !important;
    color: #6b7280;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* =========================
     MENYNS NEDRE DEL
  ========================= */

.jc-menu-footer {
    padding: 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.jc-language-menu {
    position: relative;
    margin-bottom: 8px;
}

.jc-language-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    background: rgba(255, 255, 255, .055);
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}

.jc-language-trigger:hover,
.jc-language-trigger.open {
    border-color: rgba(34, 197, 94, .42);
    background: rgba(255, 255, 255, .085);
}

.jc-language-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .15);
}

.jc-language-trigger-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(22, 163, 74, .14);
    color: #4ade80;
    font-size: 1.05rem;
}

.jc-language-trigger-text {
    display: block;
    flex: 1;
    min-width: 0;
}

.jc-language-trigger-text small,
.jc-language-trigger-text strong {
    display: block;
}

.jc-language-trigger-text small {
    margin-bottom: 2px;
    color: #89939f;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.jc-language-trigger-text strong {
    overflow: hidden;
    color: #fff;
    font-size: .88rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jc-language-chevron {
    flex: 0 0 auto;
    color: #89939f;
    font-size: .78rem;
    transition: transform .18s ease;
}

.jc-language-trigger.open .jc-language-chevron {
    transform: rotate(180deg);
}

.jc-language-options {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 5;
    display: grid;
    gap: 4px;
    padding: 7px;
    visibility: hidden;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    background: #20262c;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .32);
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}

.jc-language-options.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear 0s;
}

.jc-language-option {
    display: grid;
    grid-template-columns: 34px 1fr 20px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 43px;
    padding: 7px 9px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #d5dbe2;
    text-align: left;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.jc-language-option:hover {
    color: #fff;
    background: rgba(255, 255, 255, .065);
}

.jc-language-option.active {
    color: #fff;
    background: rgba(22, 163, 74, .13);
}

.jc-language-code {
    display: grid;
    place-items: center;
    width: 32px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .055);
    color: #b9c1ca;
    font-size: .66rem;
    font-weight: 800;
}

.jc-language-option.active .jc-language-code {
    border-color: rgba(34, 197, 94, .3);
    background: rgba(22, 163, 74, .17);
    color: #4ade80;
}

.jc-language-option i {
    visibility: hidden;
    color: #4ade80;
}

.jc-language-option.active i {
    visibility: visible;
}

.jc-logout {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 13px;
    color: #fca5a5;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s ease;
}

.jc-logout:hover {
    color: #fff;
    background: rgba(220, 38, 38, .17);
}

.jc-logout i {
    width: 24px;
    font-size: 1.2rem;
}

/* =========================
     BAKGRUND
  ========================= */

.jc-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1150;
    visibility: hidden;
    opacity: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.jc-menu-backdrop.show {
    visibility: visible;
    opacity: 1;
}

body.jc-menu-open {
    overflow: hidden;
}

/* =========================
     MOBIL
  ========================= */

@media (max-width: 680px) {
    :root {
        --jc-header-height: 76px;
    }

    .jc-header-inner {
        padding: 8px 13px;
    }

    .jc-header-logo {
        width: auto;
        height: 42px;
        max-width: 132px;
    }

    .jc-header-actions {
        gap: 0;
    }

    .jc-header-action,
    .menu-toggle {
        width: 38px;
        height: 42px;
    }

    .jc-header-action i {
        font-size: 1.35rem;
    }

    .menu-toggle .bar {
        width: 25px;
    }
}

@media (max-width: 390px) {
    .jc-header-inner {
        padding-inline: 10px;
    }

    .jc-header-logo {
        width: auto;
        height: 39px;
        max-width: 120px;
    }

    .jc-header-action,
    .menu-toggle {
        width: 36px;
        height: 40px;
    }
}


/* Finished profile header and notification badge */
.jc-menu-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    padding: 8px;
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    transition: background .16s ease;
}

.jc-menu-profile:hover,
.jc-menu-profile:focus-visible {
    background: rgba(255, 255, 255, .07);
    outline: none;
}

.jc-menu-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 3px solid rgba(255, 255, 255, .86);
    border-radius: 50%;
    background: var(--jc-header-green);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .18);
}

.jc-menu-profile-text {
    display: block;
    flex: 1;
    min-width: 0;
}

.jc-menu-profile-text strong,
.jc-menu-profile-text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jc-menu-profile-text strong {
    color: #fff;
    font-size: .98rem;
    font-weight: 700;
}

.jc-menu-profile-text small {
    margin-top: 3px;
    color: #aeb7c2;
    font-size: .72rem;
}

.jc-menu-profile-arrow {
    flex: 0 0 auto;
    color: #7f8a96;
    font-size: .8rem;
    transition: color .16s ease, transform .16s ease;
}

.jc-menu-profile:hover .jc-menu-profile-arrow {
    color: #fff;
    transform: translateX(2px);
}

.jc-header-notification-badge {
    position: absolute;
    top: 3px;
    right: 1px;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--jc-header-bg);
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    line-height: 1;
}