:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --sidebar: #151a22;
    --sidebar-hover: #232a35;
    --text: #20242c;
    --muted: #667085;
    --border: #e3e6eb;
    --accent: #f59e0b;
    --success: #087a4b;
    --success-bg: #eafaf1;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 252px;
    padding: 18px 14px;
    overflow-y: auto;
    background: var(--sidebar);
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 11px 24px;
    font-size: 19px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #151a22;
    font-size: 20px;
    font-weight: 800;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: #98a2b3;
    font-size: 12px;
}

.nav-title {
    margin: 20px 12px 8px;
    color: #8e99aa;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    padding: 11px 12px;
    border-radius: 9px;
    color: #d0d5dd;
    text-decoration: none;
    transition: background .15s ease;
}

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

.nav-link.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.main {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 68px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.topbar strong {
    font-size: 20px;
}

#mobileMenuButton {
    display: none;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 20px;
}

.system-status {
    justify-self: end;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 13px;
    font-weight: 800;
}

.content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px;
}

.welcome {
    margin-bottom: 24px;
}

.welcome h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.welcome p {
    margin: 0;
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(16, 24, 40, .045);
}

.card {
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.card span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.card strong {
    margin-top: 15px;
    font-size: 32px;
}

.panel {
    margin-top: 18px;
    padding: 22px;
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.panel p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .sidebar {
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

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

    .main {
        min-width: 0;
    }

    .topbar {
        grid-template-columns: auto 1fr auto;
        padding: 0 16px;
    }

    #mobileMenuButton {
        display: block;
    }

    .content {
        padding: 18px 16px;
    }

    .welcome h1 {
        font-size: 25px;
    }

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

    .system-status {
        font-size: 0;
    }

    .system-status::after {
        content: "●";
        font-size: 16px;
    }
}
