:root {
    color-scheme: dark;

    --bg: #07111f;
    --bg-soft: #0b1728;

    --panel: #101d30;
    --panel-soft: #142338;

    --border: #223651;

    --text: #f5f8fc;
    --muted: #93a6c1;

    --primary: #4f8cff;
    --primary-hover: #6b9cff;

    --success: #2dd4a0;
    --danger: #ff6577;

    --sidebar-width: 270px;

    --shadow:
        0 24px 70px
        rgba(0, 0, 0, 0.30);
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    font-family:
        Tahoma,
        Arial,
        sans-serif;

    background:
        var(--bg);

    color:
        var(--text);
}


button,
input {
    font: inherit;
}


a {
    color: inherit;
    text-decoration: none;
}


/* Authentication */

.auth-body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 70% 10%,
            rgba(79, 140, 255, 0.17),
            transparent 33%
        ),
        radial-gradient(
            circle at 20% 90%,
            rgba(45, 212, 160, 0.10),
            transparent 28%
        ),
        var(--bg);
}


.auth-shell {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 28px;
}


.auth-panel {
    width: min(
        470px,
        100%
    );

    padding: 34px;

    background:
        rgba(
            16,
            29,
            48,
            0.94
        );

    border:
        1px solid
        var(--border);

    border-radius:
        26px;

    box-shadow:
        var(--shadow);
}


.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}


.brand-mark {
    width: 52px;
    height: 52px;

    display: grid;
    place-items: center;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #4f8cff,
            #6d5dfc
        );

    color: #fff;

    font-size: 24px;
    font-weight: 900;
}


.brand-mark.small {
    width: 42px;
    height: 42px;

    border-radius: 13px;

    font-size: 20px;
}


.brand-name {
    font-size: 21px;
    font-weight: 800;
}


.brand-subtitle {
    margin-top: 3px;

    color:
        var(--muted);

    font-size: 12px;
}


.auth-heading {
    margin:
        34px
        0
        24px;
}


.auth-heading h1 {
    margin:
        12px
        0
        8px;

    font-size: 32px;
}


.auth-heading p {
    margin: 0;

    color:
        var(--muted);

    line-height: 1.8;
}


.status-pill {
    display: inline-flex;
    align-items: center;

    padding:
        7px
        11px;

    border-radius:
        999px;

    color:
        var(--success);

    background:
        rgba(
            45,
            212,
            160,
            0.10
        );

    font-size: 12px;
    font-weight: 700;
}


.auth-form {
    display: grid;
    gap: 18px;
}


.field {
    display: grid;
    gap: 8px;

    font-size: 13px;
    font-weight: 700;
}


.field input {
    width: 100%;

    padding:
        14px
        15px;

    color:
        var(--text);

    background:
        #0b1728;

    border:
        1px solid
        var(--border);

    border-radius:
        12px;

    outline: none;

    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}


.field input:focus {
    border-color:
        var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(
            79,
            140,
            255,
            0.13
        );
}


.primary-button {
    width: 100%;

    padding:
        14px
        18px;

    border: 0;
    border-radius: 12px;

    cursor: pointer;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #4f8cff,
            #5968f2
        );

    font-weight: 800;

    transition:
        transform .15s ease,
        opacity .15s ease;
}


.primary-button:hover {
    transform:
        translateY(-1px);

    opacity: .96;
}


.alert {
    margin-bottom: 20px;

    padding:
        13px
        14px;

    border-radius:
        12px;

    line-height: 1.6;

    font-size: 13px;
}


.alert-error {
    color:
        #ffd3d9;

    border:
        1px solid
        rgba(
            255,
            101,
            119,
            .28
        );

    background:
        rgba(
            255,
            101,
            119,
            .10
        );
}


.security-note {
    margin-top: 22px;

    padding-top: 18px;

    border-top:
        1px solid
        var(--border);

    color:
        var(--muted);

    font-size: 12px;

    line-height: 1.7;
}


/* Dashboard */

.dashboard-body {
    min-height: 100vh;

    background:
        #08121f;
}


.app-layout {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        var(--sidebar-width)
        minmax(0, 1fr);
}


.sidebar {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;

    width:
        var(--sidebar-width);

    display: flex;
    flex-direction: column;

    padding:
        22px
        18px;

    background:
        #0c1829;

    border-left:
        1px solid
        var(--border);
}


.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding:
        0
        5px
        22px;
}


.sidebar-brand strong {
    display: block;

    font-size: 17px;
}


.sidebar-brand span {
    display: block;

    max-width: 155px;

    margin-top: 3px;

    color:
        var(--muted);

    font-size: 11px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.sidebar-nav {
    display: grid;
    gap: 6px;

    margin-top: 10px;
}


.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;

    padding:
        11px
        13px;

    border-radius:
        11px;

    color:
        #b4c2d6;

    font-size: 13px;
}


.nav-link span {
    min-width: 20px;

    text-align: center;

    font-size: 16px;
}


.nav-link.active {
    color:
        #fff;

    background:
        rgba(
            79,
            140,
            255,
            .13
        );

    border:
        1px solid
        rgba(
            79,
            140,
            255,
            .18
        );
}


.nav-link.disabled {
    opacity: .55;

    cursor:
        default;
}


.sidebar-footer {
    margin-top: auto;

    padding-top: 20px;

    border-top:
        1px solid
        var(--border);
}


.user-mini strong {
    display: block;

    font-size: 12px;
}


.user-mini span {
    display: block;

    margin-top: 4px;

    color:
        var(--muted);

    font-size: 11px;
}


.logout-button {
    width: 100%;

    margin-top: 14px;

    padding:
        10px
        12px;

    border:
        1px solid
        var(--border);

    border-radius:
        10px;

    color:
        #c6d2e3;

    background:
        transparent;

    cursor: pointer;
}


.main-area {
    grid-column: 2;

    min-width: 0;
}


.topbar {
    min-height: 84px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        16px
        30px;

    background:
        rgba(
            8,
            18,
            31,
            .88
        );

    border-bottom:
        1px solid
        var(--border);
}


.topbar h1 {
    margin: 3px 0 0;

    font-size: 20px;
}


.eyebrow {
    color:
        var(--muted);

    font-size: 11px;
}


.topbar-user {
    padding:
        9px
        13px;

    border:
        1px solid
        var(--border);

    border-radius:
        999px;

    color:
        #d5deeb;

    font-size: 12px;
}


.dashboard-content {
    width: min(
        1400px,
        100%
    );

    margin: 0 auto;

    padding:
        28px;
}


.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;

    padding:
        28px;

    border:
        1px solid
        var(--border);

    border-radius:
        20px;

    background:
        linear-gradient(
            135deg,
            rgba(
                79,
                140,
                255,
                .12
            ),
            rgba(
                16,
                29,
                48,
                .76
            )
        );
}


.welcome-panel h2 {
    margin:
        12px
        0
        8px;

    font-size: 25px;
}


.welcome-panel p {
    max-width: 680px;

    margin: 0;

    color:
        var(--muted);

    line-height: 1.8;

    font-size: 13px;
}


.welcome-badge {
    min-width: 90px;
    height: 90px;

    display: grid;
    place-items: center;

    border-radius: 22px;

    background:
        rgba(
            79,
            140,
            255,
            .12
        );

    color:
        var(--primary);

    font-size: 34px;
    font-weight: 900;
}


.welcome-badge small {
    display: block;

    margin-top: -24px;

    color:
        var(--muted);

    font-size: 10px;
    font-weight: 400;
}


.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(
                0,
                1fr
            )
        );

    gap: 16px;

    margin-top: 18px;
}


.stat-card {
    padding: 20px;

    border:
        1px solid
        var(--border);

    border-radius:
        16px;

    background:
        var(--panel);
}


.stat-card span {
    color:
        var(--muted);

    font-size: 12px;
}


.stat-card strong {
    display: block;

    margin:
        8px
        0
        4px;

    font-size: 30px;
}


.stat-card small {
    color:
        #7187a4;

    font-size: 10px;
}


.section-card {
    margin-top: 18px;

    padding: 22px;

    border:
        1px solid
        var(--border);

    border-radius:
        18px;

    background:
        var(--panel);
}


.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}


.section-header h3 {
    margin:
        5px
        0
        0;

    font-size: 18px;
}


.section-count {
    padding:
        7px
        10px;

    border-radius:
        999px;

    color:
        var(--muted);

    background:
        var(--panel-soft);

    font-size: 11px;
}


.platform-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(
                0,
                1fr
            )
        );

    gap: 12px;
}


.platform-card {
    display: grid;

    grid-template-columns:
        46px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 12px;

    padding: 14px;

    border:
        1px solid
        var(--border);

    border-radius:
        14px;

    background:
        #0d1a2c;
}


.platform-icon {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border-radius:
        12px;

    background:
        #182943;

    font-weight: 900;
}


.platform-info strong {
    display: block;

    font-size: 13px;
}


.platform-info span {
    display: block;

    margin-top: 4px;

    color:
        var(--muted);

    font-size: 10px;
}


.platform-status {
    color:
        #758aa5;

    font-size: 10px;
}


@media (
    max-width: 1050px
) {
    :root {
        --sidebar-width:
            220px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            );
    }

    .platform-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            );
    }
}


@media (
    max-width: 760px
) {
    .app-layout {
        display: block;
    }

    .sidebar {
        position: static;

        width: 100%;

        border-left: 0;
        border-bottom:
            1px solid
            var(--border);
    }

    .sidebar-nav {
        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            );
    }

    .main-area {
        width: 100%;
    }

    .topbar {
        padding:
            14px
            18px;
    }

    .dashboard-content {
        padding: 18px;
    }

    .stats-grid,
    .platform-grid {
        grid-template-columns:
            1fr;
    }

    .welcome-panel {
        align-items:
            flex-start;
    }

    .welcome-badge {
        min-width: 70px;
        height: 70px;
    }
}

.connection-row {
    grid-column: 1 / -1;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;

    align-items: center;

    gap: 18px;

    padding:
        13px
        15px;

    border:
        1px solid
        var(--border);

    border-radius:
        12px;

    background:
        #0a1626;
}

.connection-row strong {
    display: block;

    font-size: 12px;
}

.connection-row span {
    display: block;

    margin-top: 4px;

    color:
        var(--muted);

    font-size: 10px;
}
