/*
Theme Name: J2 Portal Theme
Theme URI: https://j2systems.se
Author: J2 Systems
Author URI: https://j2systems.se
Description: Mörkt WordPress-tema för J2 Systems kundportal och projektportal.
Version: 0.1.0
Text Domain: j2-portal-theme
*/

:root {
    --j2-bg: #050b13;
    --j2-bg-soft: #07111d;
    --j2-panel: rgba(18, 31, 49, 0.88);
    --j2-panel-2: rgba(10, 20, 32, 0.94);
    --j2-border: rgba(255, 255, 255, 0.09);
    --j2-border-strong: rgba(65, 143, 255, 0.35);
    --j2-text: #eaf2ff;
    --j2-muted: #92a4bd;
    --j2-muted-2: #64748b;
    --j2-blue: #297aff;
    --j2-blue-2: #0c4bd5;
    --j2-green: #56df75;
    --j2-green-dark: #139447;
    --j2-orange: #ffb13d;
    --j2-red: #ff6969;
    --j2-radius: 18px;
    --j2-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--j2-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(41, 122, 255, 0.16), transparent 30%),
        radial-gradient(circle at top left, rgba(86, 223, 117, 0.08), transparent 26%),
        linear-gradient(180deg, #07111d 0%, #050b13 100%);
    color: var(--j2-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

body.admin-bar .j2-site-shell {
    min-height: calc(100vh - 32px);
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.j2-site-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
}

.j2-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 16px;
    background: linear-gradient(180deg, rgba(8, 20, 33, 0.98), rgba(5, 11, 19, 0.98));
    border-right: 1px solid var(--j2-border);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.admin-bar .j2-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}

.j2-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 4px 20px;
    border-bottom: 1px solid var(--j2-border);
    text-decoration: none;
}

.j2-brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 25px;
    font-weight: 900;
    background: linear-gradient(135deg, #1769ff, #0b3a92);
    box-shadow: 0 16px 38px rgba(23, 105, 255, 0.24);
}

.j2-brand-text strong {
    display: block;
    color: #fff;
    font-size: 16px;
    letter-spacing: 0.04em;
}

.j2-brand-text span {
    display: block;
    color: #4b96ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.j2-nav {
    display: grid;
    gap: 8px;
}

.j2-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #b8c5d7;
    text-decoration: none;
    padding: 12px 13px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.j2-nav a:hover,
.j2-nav a.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(27, 109, 255, 0.28), rgba(27, 109, 255, 0.08));
    border-color: rgba(58, 137, 255, 0.22);
}

.j2-nav-icon {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    opacity: 0.95;
}

.j2-sidebar-bottom {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.j2-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--j2-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
}

.j2-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2272ff, #11264c);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
}

.j2-user-card strong {
    display: block;
    color: #fff;
    line-height: 1.15;
}

.j2-user-card span {
    display: block;
    color: var(--j2-green);
    font-size: 12px;
}

.j2-sidebar-projects {
    padding: 14px;
    border: 1px solid var(--j2-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
}

.j2-sidebar-projects h3 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 13px;
}

.j2-mini-project {
    display: grid;
    gap: 5px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.j2-mini-project:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.j2-mini-project span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #b8c5d7;
    font-size: 12px;
}

.j2-mini-progress {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.j2-mini-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--j2-blue), var(--j2-green));
}

.j2-version {
    color: #64748b;
    font-size: 12px;
    padding: 0 4px;
}

.j2-main {
    min-width: 0;
    padding: 0;
}

.j2-topbar {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 34px;
    border-bottom: 1px solid var(--j2-border);
    background: rgba(5, 11, 19, 0.45);
    backdrop-filter: blur(16px);
}

.j2-topbar-left,
.j2-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.j2-wp-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #cbd8ea;
    text-decoration: none;
    font-weight: 700;
}

.j2-wp-icon {
    width: 31px;
    height: 31px;
    border-radius: 999px;
    border: 1px solid var(--j2-border);
    display: grid;
    place-items: center;
    color: #fff;
}

.j2-search {
    width: min(420px, 35vw);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--j2-border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--j2-muted);
}

.j2-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--j2-text);
}

.j2-search kbd {
    padding: 3px 7px;
    border-radius: 6px;
    color: #8fa1ba;
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
}

.j2-icon-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--j2-border);
    background: rgba(255, 255, 255, 0.035);
    color: #dbe7f8;
    display: grid;
    place-items: center;
    text-decoration: none;
    position: relative;
}

.j2-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--j2-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.j2-content {
    padding: 34px;
}

.j2-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 26px;
}

.j2-page-header h1 {
    margin: 0 0 7px;
    color: #fff;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.j2-page-header p {
    margin: 0;
    color: var(--j2-muted);
}

.j2-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--j2-green);
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.j2-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
    background: var(--j2-green);
    box-shadow: 0 0 18px rgba(86, 223, 117, 0.55);
}

.j2-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid var(--j2-border);
    background: rgba(255, 255, 255, 0.045);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.j2-button:hover {
    border-color: var(--j2-border-strong);
}

.j2-button-primary {
    background: linear-gradient(135deg, var(--j2-blue), var(--j2-blue-2));
    border-color: rgba(58, 137, 255, 0.55);
    box-shadow: 0 16px 40px rgba(41, 122, 255, 0.22);
}

.j2-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    gap: 22px;
    align-items: stretch;
}

.j2-card {
    border: 1px solid var(--j2-border);
    border-radius: var(--j2-radius);
    background: linear-gradient(180deg, var(--j2-panel), var(--j2-panel-2));
    box-shadow: var(--j2-shadow);
    padding: 24px;
}

.j2-card h2,
.j2-card h3 {
    margin-top: 0;
    color: #fff;
}

.j2-card p {
    color: var(--j2-muted);
}

.j2-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 22px;
}

.j2-status-card {
    position: relative;
    min-height: 150px;
    padding: 20px;
    border-radius: 17px;
    border: 1px solid var(--j2-border);
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

.j2-status-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--j2-blue), var(--j2-green));
    opacity: 0.8;
}

.j2-status-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: #6eadff;
    background: rgba(41, 122, 255, 0.16);
    font-weight: 900;
}

.j2-status-card.is-done {
    border-color: rgba(86, 223, 117, 0.28);
    background: linear-gradient(180deg, rgba(22, 65, 48, 0.48), rgba(10, 25, 25, 0.66));
}

.j2-status-card.is-done .j2-status-icon {
    color: var(--j2-green);
    background: rgba(86, 223, 117, 0.14);
}

.j2-status-card h3 {
    margin: 0 0 5px;
    color: #fff;
    font-size: 17px;
}

.j2-status-card p {
    margin: 0;
    color: var(--j2-muted);
    font-size: 13px;
}

.j2-status-card strong {
    display: inline-flex;
    margin-top: 16px;
    color: var(--j2-green);
}

.j2-login-panel {
    max-width: 520px;
    margin: 70px auto;
}

.j2-login-panel .login-username,
.j2-login-panel .login-password,
.j2-login-panel .login-remember {
    margin-bottom: 16px;
}

.j2-login-panel label {
    display: block;
    color: #cbd8ea;
    font-weight: 800;
    margin-bottom: 7px;
}

.j2-login-panel input[type="text"],
.j2-login-panel input[type="password"] {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--j2-border);
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
    padding: 0 14px;
}

.j2-login-panel input[type="submit"] {
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 900;
    padding: 0 20px;
    background: linear-gradient(135deg, var(--j2-blue), var(--j2-blue-2));
    cursor: pointer;
}

.j2-public-landing {
    max-width: 920px;
    margin: 80px auto;
    text-align: center;
}

.j2-public-landing h1 {
    color: #fff;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 0.96;
    letter-spacing: -0.06em;
    margin: 0 0 20px;
}

.j2-public-landing p {
    color: var(--j2-muted);
    font-size: 18px;
    max-width: 680px;
    margin: 0 auto 30px;
}

.j2-page-body {
    max-width: 1100px;
}

.j2-page-body > *:first-child {
    margin-top: 0;
}

.j2-page-body a {
    color: #6eadff;
}

/* Plugin override: gör [j2_customer_portal] mer integrerat i temat */
.j2-content .j2p-customer-shell {
    padding: 0 !important;
    min-height: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.j2-content .j2p-customer-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 26px;
}

.j2-content .j2p-customer-header h1 {
    font-size: clamp(30px, 4vw, 44px);
    letter-spacing: -0.04em;
}

.j2-content .j2p-customer-card {
    border-radius: 18px !important;
    background: linear-gradient(180deg, var(--j2-panel), var(--j2-panel-2)) !important;
    box-shadow: var(--j2-shadow);
}

.j2-content .j2p-customer-info {
    background: rgba(255, 255, 255, 0.035) !important;
}

/* WordPress core */
.wp-block-post-title,
.entry-title {
    color: #fff;
}

.alignwide,
.alignfull {
    max-width: 100%;
}

@media (max-width: 1200px) {
    .j2-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .j2-hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .j2-site-shell {
        grid-template-columns: 1fr;
    }

    .j2-sidebar {
        position: static;
        height: auto;
    }

    .admin-bar .j2-sidebar {
        top: auto;
        height: auto;
    }

    .j2-topbar {
        padding: 18px 22px;
        height: auto;
        flex-wrap: wrap;
    }

    .j2-search {
        width: 100%;
    }

    .j2-content {
        padding: 24px 20px 40px;
    }

    .j2-page-header {
        display: grid;
    }
}

@media (max-width: 640px) {
    .j2-status-grid {
        grid-template-columns: 1fr;
    }

    .j2-topbar-right {
        width: 100%;
    }

    .j2-public-landing {
        margin: 40px auto;
    }
}