:root {
    color-scheme: dark;
    --bg: #0b0d12;
    --surface: #11141b;
    --surface-2: #171b24;
    --border: #252b38;
    --text: #f3f5f8;
    --muted: #929aaa;
    --accent: #8b7cff;
    --accent-soft: rgba(139, 124, 255, 0.13);
    --good: #56d89a;
    --good-soft: rgba(86, 216, 154, 0.12);
    --bad: #ff6f7d;
    --bad-soft: rgba(255, 111, 125, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    color: inherit;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 230px 1fr;
    grid-template-rows: 76px 1fr;
}

.topbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(17, 20, 27, 0.94);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    font-size: 21px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    letter-spacing: 0.12em;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.16em;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.user strong,
.user a {
    display: block;
}

.user a {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.user a:hover {
    color: var(--text);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.sidebar {
    padding: 24px 14px;
    border-right: 1px solid var(--border);
    background: var(--surface);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

.nav-item.active {
    color: var(--text);
    background: var(--accent-soft);
    border: 1px solid rgba(139, 124, 255, 0.24);
}

.nav-item.disabled {
    cursor: default;
    opacity: 0.58;
}

.nav-item small {
    margin-left: auto;
    font-size: 8px;
    letter-spacing: 0.12em;
}

.content {
    width: min(1180px, 100%);
    padding: 42px;
}

.login-content {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    place-items: center;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 30px;
}

.page-heading h1,
.panel h2,
.status-card h2,
.login-panel h1 {
    margin: 0;
}

.page-heading h1 {
    font-size: clamp(28px, 4vw, 42px);
}

.page-heading > div > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.eyebrow,
.card-label {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.environment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.good {
    background: var(--good);
    box-shadow: 0 0 12px rgba(86, 216, 154, 0.55);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.status-card,
.panel,
.login-panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.status-card {
    padding: 22px;
}

.card-top,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-top {
    margin-bottom: 26px;
}

.card-icon {
    font-size: 22px;
}

.status-pill {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.status-pill.good {
    color: var(--good);
    background: var(--good-soft);
}

.status-pill.bad {
    color: var(--bad);
    background: var(--bad-soft);
}

.status-card h2 {
    font-size: 25px;
}

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

.status-card .muted {
    margin-bottom: 0;
    font-size: 13px;
}

.panel {
    padding: 24px;
    margin-top: 16px;
}

.panel-heading {
    margin-bottom: 22px;
}

.panel-heading .eyebrow {
    margin-bottom: 5px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.detail {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.detail:nth-child(3n) {
    border-right: 0;
}

.detail:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.detail span,
.detail strong {
    display: block;
}

.detail span {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail strong {
    overflow-wrap: anywhere;
}

.coming-panel {
    background:
        linear-gradient(
            135deg,
            rgba(139, 124, 255, 0.08),
            transparent 45%
        ),
        var(--surface);
}

.login-panel {
    width: min(460px, calc(100vw - 36px));
    padding: 42px;
    text-align: center;
}

.login-paw {
    margin-bottom: 20px;
    font-size: 42px;
}

.login-panel h1 {
    font-size: 36px;
}

.login-copy {
    margin: 16px auto 26px;
    max-width: 360px;
    color: var(--muted);
    line-height: 1.6;
}

.discord-button,
.secondary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
}

.discord-button {
    width: 100%;
    background: #5865f2;
    color: white;
}

.secondary-button {
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.login-footnote {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 820px) {
    .shell {
        display: block;
    }

    .topbar {
        min-height: 70px;
        padding: 12px 18px;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
    }

    .sidebar nav {
        display: flex;
        min-width: max-content;
    }

    .nav-item {
        min-width: max-content;
    }

    .content {
        padding: 26px 18px;
    }

    .status-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .detail,
    .detail:nth-child(3n),
    .detail:nth-last-child(-n + 3) {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .detail:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 520px) {
    .brand small {
        display: none;
    }

    .user strong {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page-heading {
        display: block;
    }

    .environment {
        width: fit-content;
        margin-top: 18px;
    }

    .login-panel {
        padding: 30px 22px;
    }
}


/* Dobrev HQ — Logs */

.log-service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.log-service-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 82px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--muted);
    text-decoration: none;
    transition:
        border-color 120ms ease,
        background 120ms ease,
        color 120ms ease;
}

.log-service-card:hover {
    color: var(--text);
    border-color: rgba(139, 124, 255, 0.45);
}

.log-service-card.selected {
    color: var(--text);
    border-color: rgba(139, 124, 255, 0.42);
    background: var(--accent-soft);
}

.log-service-card strong,
.log-service-card small {
    display: block;
}

.log-service-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.log-service-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

.log-panel {
    padding-bottom: 0;
    overflow: hidden;
}

.log-panel-heading {
    margin-bottom: 0;
}

.log-unit {
    margin: 5px 0 0;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 11px;
}

.log-controls {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px -1px 0;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.log-controls label {
    display: grid;
    gap: 6px;
}

.log-controls label > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.log-controls select,
.log-button {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.log-controls select {
    min-width: 130px;
    padding: 0 34px 0 11px;
}

.log-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
}

.log-button:hover {
    border-color: rgba(139, 124, 255, 0.5);
}

.log-button:not(.secondary) {
    border-color: rgba(139, 124, 255, 0.36);
    background: var(--accent-soft);
}

.log-button.secondary {
    color: var(--muted);
}

.log-table-wrap {
    overflow: auto;
    max-height: 680px;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.log-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
    background: #141821;
    color: var(--muted);
    text-align: left;
    font-size: 9px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.log-table th:nth-child(1) {
    width: 115px;
}

.log-table th:nth-child(2) {
    width: 95px;
}

.log-table th:nth-child(3) {
    width: 130px;
}

.log-table td {
    padding: 12px 13px;
    border-bottom: 1px solid rgba(37, 43, 56, 0.72);
    vertical-align: top;
    font-size: 12px;
}

.log-table tbody tr:last-child td {
    border-bottom: 0;
}

.log-row:hover {
    background: rgba(255, 255, 255, 0.018);
}

.log-time strong,
.log-time span,
.log-process span {
    display: block;
}

.log-time strong {
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 12px;
}

.log-time span,
.log-process span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.log-process {
    color: #c8ced9;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
}

.log-message {
    overflow-wrap: anywhere;
    color: #cfd4de;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    line-height: 1.55;
}

.log-level {
    display: inline-flex;
    min-width: 62px;
    justify-content: center;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.log-level.error {
    border-color: rgba(255, 111, 125, 0.3);
    background: var(--bad-soft);
    color: var(--bad);
}

.log-level.warning {
    border-color: rgba(255, 190, 92, 0.3);
    background: rgba(255, 190, 92, 0.1);
    color: #ffbe5c;
}

.log-level.notice {
    border-color: rgba(139, 124, 255, 0.3);
    background: var(--accent-soft);
    color: #b8aeff;
}

.log-level.info {
    border-color: rgba(86, 216, 154, 0.24);
    background: var(--good-soft);
    color: var(--good);
}

.log-level.debug {
    opacity: 0.72;
}

.log-error,
.log-empty {
    display: grid;
    gap: 6px;
    padding: 34px 22px;
    text-align: center;
}

.log-error strong {
    color: var(--bad);
}

.log-error span,
.log-empty span {
    color: var(--muted);
    font-size: 12px;
}

.log-footnote {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 11px;
}

.log-footnote p {
    margin: 0;
}

@media (max-width: 820px) {
    .log-service-grid {
        grid-template-columns: 1fr;
    }

    .log-table {
        min-width: 760px;
    }
}

@media (max-width: 520px) {
    .log-controls {
        align-items: stretch;
    }

    .log-controls label {
        flex: 1 1 120px;
    }

    .log-controls select {
        width: 100%;
    }

    .log-button {
        flex: 1 1 auto;
    }
}
