* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    color-scheme: light dark;
    --page-background: #ffffff;
    --surface-background: #f7f7f7;
    --ink: #171717;
    --text: #252525;
    --line: #dedede;
    --header-background: #111111;
    --header-text: #ffffff;
    --blue: #0071e3;
    --blue-hover: #0077ed;
    --body-font: 'Fira Sans', sans-serif;
    --title-font: 'League Spartan', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page-background: #111111;
        --surface-background: #1a1a1a;
        --ink: #f5f5f5;
        --text: #e5e5e5;
        --line: #333333;
    }
}

html { scroll-behavior: smooth; }

body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--page-background);
    color: var(--ink);
    font-family: var(--body-font);
    line-height: 1.42;
    overflow: hidden; /* Prevents double scrolling */
}

a { color: inherit; }

.title-font {
    font-family: var(--title-font);
    font-weight: 700;
}

/* Header */
.site-header {
    flex-shrink: 0;
    height: 54px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    background: var(--header-background);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text);
    text-decoration: none;
    line-height: 1;
}

.brand img {
    height: 22px;
    max-width: 52px;
    object-fit: contain;
}

.brand span {
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

/* Console Layout */
.console-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.console-sidebar {
    width: 260px;
    background-color: var(--surface-background);
    border-right: 1px solid var(--line);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover {
    background-color: rgba(0, 113, 227, 0.08);
    color: var(--blue);
}

.sidebar-link.active {
    background-color: var(--blue);
    color: #ffffff;
}

.console-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background-color: var(--page-background);
}

.console-header { margin-bottom: 32px; }

.console-header h2 {
    font-size: 2rem;
    letter-spacing: -0.02em;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 2000;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--page-background);
    padding: 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-box h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.modal-box p {
    font-size: 0.96rem;
    color: var(--text);
    margin-bottom: 24px;
}

.modal-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--blue);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.modal-button:hover {
    background: var(--blue-hover);
}

/* Mobile Adjustments */
@media (max-width: 900px) {
    .console-wrapper { flex-direction: column; }
    .console-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--line);
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }
    .sidebar-link { white-space: nowrap; }
}