
:root {
    color-scheme: dark;
    --bg: #0b1018;
    --sidebar: #0e1520;
    --surface: #121b28;
    --surface-hover: #192538;
    --border: #253247;
    --text: #edf2fa;
    --muted: #8998ad;
    --subtle: #5e6e84;
    --accent: #9a83ff;
    --accent-strong: #8064f6;
    --blue: #6ea8ff;
    --green: #50d6a0;
    --red: #ff7285;
    --amber: #f2bd67;
    --radius: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .17em;
    line-height: 1.5;
}

.accent {
    color: var(--accent);
}

/* Login */

.login-page {
    display: grid;
    min-height: 100vh;
    padding: 32px;
    place-items: center;
    background:
        radial-gradient(ellipse at 15% 15%, #392c6c30, transparent 42%),
        radial-gradient(ellipse at 90% 90%, #193f6330, transparent 38%),
        var(--bg);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr);
    width: min(1050px, 100%);
    min-height: 610px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 28px 90px #0005;
}

.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    padding: 48px;
    background:
        radial-gradient(ellipse at 70% 70%, #8064f626, transparent 48%),
        linear-gradient(145deg, #151f31, #101724 70%);
    border-right: 1px solid var(--border);
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid #a78bfa70;
    border-radius: 13px;
    background: #8b75ff16;
    color: #c5b7ff;
}

.brand-mark svg {
    width: 34px;
    height: 34px;
}

.login-brand > .eyebrow {
    margin-top: 26px;
}

.login-brand h1 {
    margin: 14px 0;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 750;
    letter-spacing: -.055em;
    line-height: 1.08;
}

.login-brand h1 span {
    color: #aa98ff;
}

.brand-description {
    max-width: 330px;
    color: #a3b0c3;
    line-height: 1.8;
}

.login-decoration {
    position: absolute;
    right: 28px;
    bottom: 95px;
    display: grid;
    grid-template-columns: repeat(4, 15px);
    gap: 9px;
    transform: rotate(-12deg);
    opacity: .7;
}

.login-decoration span {
    width: 15px;
    height: 15px;
    border: 1px solid #9a83ff70;
    border-radius: 4px;
    background: #9a83ff0b;
}

.login-decoration span:nth-child(3n) {
    background: #9a83ff55;
}

.login-decoration span:nth-child(5n) {
    border-color: #6ea8ff70;
}

.brand-footer {
    margin: auto 0 0;
    color: #63738b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .15em;
}

.login-panel {
    display: grid;
    padding: 42px;
    place-items: center;
    background: #111925;
}

.login-panel-inner {
    width: 100%;
    max-width: 350px;
}

.login-panel h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -.04em;
}

.login-panel .muted {
    margin: 8px 0 30px;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    margin-top: 8px;
    color: #c8d2e1;
    font-size: 12px;
    font-weight: 650;
}

.login-form input {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #2b394e;
    border-radius: 9px;
    background: #0b121d;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
}

.login-form input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px #9a83ff20;
}

.button-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 47px;
    margin-top: 17px;
    padding: 0 15px;
    border: 1px solid #a99aff;
    border-radius: 9px;
    background: linear-gradient(110deg, #9277ff, #7457e9);
    color: white;
    font-weight: 750;
    cursor: pointer;
    transition: filter .18s, transform .18s;
}

.button-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.login-footnote {
    margin-top: 28px;
    color: var(--subtle);
    font-size: 11px;
    text-align: center;
}

.notice {
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 12px;
}

.notice p {
    margin: 0;
}

.notice-error {
    border-color: #7f3547;
    background: #52202d40;
    color: #ffb0bb;
}

.notice-success {
    border-color: #27684e;
    background: #17473440;
    color: #8aebbf;
}

/* Application shell */

.app-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: 246px;
    padding: 25px 16px 15px;
    border-right: 1px solid var(--border);
    background: var(--sidebar);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 7px 29px;
}

.brand-mark-small {
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    font-size: 20px;
    font-weight: 850;
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    font-size: 13px;
    letter-spacing: .12em;
}

.sidebar-brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .15em;
}

.nav-caption {
    margin: 0 9px 10px;
    color: #5f7086;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
}

.main-nav {
    display: grid;
    gap: 5px;
}

.nav-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 12px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #99a8bb;
    font-size: 12px;
    font-weight: 600;
}

.nav-link:not(.disabled):hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-link.active {
    border-color: #6552a733;
    background: linear-gradient(90deg, #8064f624, #8064f608);
    color: #c5b8ff;
}

.nav-icon {
    width: 18px;
    font-size: 17px;
    text-align: center;
}

.nav-link.disabled {
    opacity: .52;
    cursor: default;
}

.nav-tag {
    margin-left: auto;
    color: #77869a;
    font-size: 8px;
    letter-spacing: .07em;
}

.sidebar-bottom {
    margin-top: auto;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 3px 16px;
    padding: 13px 9px;
    border: 1px solid #26374a;
    border-radius: 9px;
    background: #111b28;
}

.status-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px #50d6a050;
}

.connection-indicator strong,
.connection-indicator small,
.user-details strong,
.user-details small {
    display: block;
}

.connection-indicator strong {
    font-size: 10px;
}

.connection-indicator small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 3px 0;
    border-top: 1px solid var(--border);
}

.user-avatar {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #8270df70;
    border-radius: 10px;
    background: #8064f624;
    color: #c6baff;
    font-weight: 800;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
}

.user-details small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.icon-button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #98a8bc;
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--border);
    background: var(--surface-hover);
    color: white;
}

.main-content {
    width: calc(100% - 246px);
    min-width: 0;
    margin-left: 246px;
}

.topbar {
    display: flex;
    height: 61px;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--border);
    background: #0e1520;
}

.breadcrumb {
    display: flex;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
}

.breadcrumb strong {
    color: #e5eaf2;
    font-weight: 650;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f93a9;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
}

.topbar-status .status-dot {
    width: 6px;
    height: 6px;
}

.page-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 36px 34px 22px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 33px);
    font-weight: 750;
    letter-spacing: -.055em;
    line-height: 1.2;
}

.page-heading .muted {
    max-width: 650px;
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.8;
}

.heading-mark {
    flex: 0 0 auto;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #7f8ea3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
}

.heading-mark span {
    color: var(--accent);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, #18243565, transparent 65%),
        var(--surface);
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.metric-label {
    color: #a3b1c4;
    font-size: 11px;
    font-weight: 600;
}

.metric-symbol {
    display: grid;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: #ffffff05;
    font-size: 15px;
}

.metric-symbol.purple { color: #ac96ff; }
.metric-symbol.blue { color: #7db8ff; }
.metric-symbol.red { color: #ff8294; }
.metric-symbol.green { color: #63deb0; }

.metric-value {
    margin-top: 17px;
    font-size: 32px;
    font-weight: 750;
    letter-spacing: -.055em;
    line-height: 1;
}

.metric-foot {
    margin-top: 10px;
    color: #75859a;
    font-size: 10px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(270px, .8fr);
    gap: 18px;
    align-items: start;
}

.panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 17px;
    border-bottom: 1px solid var(--border);
}

.panel-heading .eyebrow {
    margin-bottom: 5px;
    font-size: 9px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.panel-counter {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #98a7ba;
    font-size: 9px;
    white-space: nowrap;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.report-table th {
    padding: 12px 15px;
    background: #101824;
    color: #788aa1;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.report-table td {
    padding: 13px 15px;
    border-top: 1px solid #202d3f;
    color: #a8b5c7;
    font-size: 10px;
}

.report-table tbody tr:hover {
    background: #ffffff04;
}

.report-game,
.report-message {
    display: block;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-game {
    color: #e0e7f1;
    font-size: 10px;
}

.report-message {
    margin-top: 4px;
    color: #7e8ea3;
}

.report-table code {
    color: #b3a5ff;
    font-size: 10px;
}

.date-cell {
    color: #8d9db2 !important;
    font-variant-numeric: tabular-nums;
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.severity-badge.critical,
.severity-badge.error {
    border-color: #753744;
    background: #6d2a392b;
    color: #ff8999;
}

.severity-badge.warning {
    border-color: #72572f;
    background: #71532a20;
    color: #f2c577;
}

.severity-badge.info {
    border-color: #2d5279;
    background: #28527b25;
    color: #8bc1ff;
}

.severity-badge.neutral {
    color: #a9b5c6;
}

.severity-panel {
    padding-bottom: 16px;
}

.severity-total {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 22px 20px 19px;
}

.severity-total strong {
    font-size: 30px;
    letter-spacing: -.05em;
}

.severity-total span {
    color: var(--muted);
    font-size: 10px;
}

.severity-list {
    display: grid;
    gap: 19px;
    padding: 0 20px 22px;
}

.severity-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    color: #a9b6c7;
    font-size: 11px;
}

.severity-row-top > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.severity-row-top strong {
    color: #e5ebf4;
    font-size: 11px;
}

.severity-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.severity-dot.critical,
.severity-dot.error { background: var(--red); }
.severity-dot.warning { background: var(--amber); }
.severity-dot.info { background: var(--blue); }

.progress-track {
    height: 5px;
    overflow: hidden;
    border-radius: 20px;
    background: #263347;
}

.progress-fill {
    height: 100%;
    min-width: 0;
    border-radius: inherit;
}

.progress-fill.critical,
.progress-fill.error { background: var(--red); }
.progress-fill.warning { background: var(--amber); }
.progress-fill.info { background: var(--blue); }

.panel-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: #77889e;
    font-size: 9px;
}

.panel-note .status-dot {
    width: 6px;
    height: 6px;
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
}

.empty-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #27684e;
    border-radius: 12px;
    background: #17473440;
    color: var(--green);
    font-size: 18px;
}

.empty-state h3 {
    margin: 14px 0 5px;
    font-size: 14px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 25px;
    padding: 17px 2px 0;
    border-top: 1px solid #1c2939;
    color: #596b81;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .13em;
}

/* Responsive */

@media (max-width: 1200px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .login-page {
        padding: 14px;
    }

    .login-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .login-brand {
        min-height: 270px;
        padding: 28px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .login-brand h1 {
        font-size: 34px;
    }

    .login-decoration {
        right: 25px;
        bottom: 30px;
    }

    .brand-footer {
        margin-top: 25px;
    }

    .login-panel {
        padding: 32px 25px;
    }

    .sidebar {
        position: static;
        width: 65px;
        flex: 0 0 65px;
        padding: 18px 8px;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 0 0 24px;
    }

    .sidebar-brand > span:not(.brand-mark),
    .nav-caption,
    .nav-link:not(.active),
    .nav-link.active {
        font-size: 0;
    }

    .main-nav {
        gap: 8px;
    }

    .nav-link {
        justify-content: center;
        padding: 0;
    }

    .nav-icon {
        font-size: 18px;
    }

    .sidebar-bottom {
        display: none;
    }

    .main-content {
        width: calc(100% - 65px);
        margin-left: 0;
    }

    .topbar {
        height: 54px;
        padding: 0 15px;
    }

    .topbar-status {
        font-size: 0;
    }

    .page-content {
        padding: 25px 15px;
    }

    .page-heading {
        align-items: flex-start;
    }

    .heading-mark {
        display: none;
    }

    .metric-grid {
        gap: 9px;
    }

    .metric-card {
        padding: 13px;
    }

    .metric-label {
        font-size: 10px;
    }

    .metric-value {
        font-size: 27px;
    }

    .metric-foot {
        line-height: 1.5;
    }

    .panel-heading {
        padding: 16px;
    }

    .report-table th,
    .report-table td {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
