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

:root {
    --bg: #080808;
    --surface: #0f0f0f;
    --border: #1e1e1e;
    --text: #e8e8e8;
    --muted: #555;
    --accent: #c8ff00;
    --accent-dim: rgba(200,255,0,0.08);
    --sidebar-w: 220px;
    --font: 'JetBrains Mono', monospace;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
.layout {
    display: flex;
    height: 100dvh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
}

.sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -.02em;
}

.sidebar-logo i {
    color: var(--accent);
    font-size: 1rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.logo-text span { color: var(--accent); }

/* nav */
.nav-section {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-label {
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 8px;
    margin-bottom: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-family: var(--font);
    border: 1px solid transparent;
    transition: color .15s, background .15s, border-color .15s;
    user-select: none;
}

.nav-link i { width: 14px; text-align: center; font-size: 11px; }

.nav-link:hover {
    color: var(--text);
    background: var(--accent-dim);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: rgba(200,255,0,0.15);
}

/* footer */
.sidebar-footer {
    padding: 16px 20px 0;
    border-top: 1px solid var(--border);
}

.tagline {
    font-size: 9px;
    letter-spacing: .08em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.footer-socials {
    display: flex;
    gap: 14px;
}

.footer-socials a {
    color: var(--muted);
    font-size: 12px;
    transition: color .15s;
    text-decoration: none;
}

.footer-socials a:hover { color: var(--accent); }

/* ── MAIN ── */
.main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

#page-frame-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#app-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── LOADING ── */
#loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 50;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--muted);
    text-transform: uppercase;
}

/* ── MOBILE HEADER ── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 300;
}

.btn-menu {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

/* ── OVERLAY ── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 150;
    backdrop-filter: blur(2px);
}

.overlay.active { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .mobile-header { display: flex; }

    .layout { padding-top: 48px; }

    .sidebar {
        position: fixed;
        top: 48px; left: 0; bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.active { transform: translateX(0); }
}
