:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #687386;
    --line: #e6eaf0;
    --primary: #2563eb;
    --primary-soft: #dbeafe;
    --shadow: 0 18px 45px rgba(22, 33, 62, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.sidebar {
    min-height: 100vh;
    padding: 24px 18px;
    background: #101828;
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px 28px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #ffffff;
    color: #101828;
    font-weight: 800;
}

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

.brand span {
    margin-top: 4px;
    color: #98a2b3;
    font-size: 12px;
}

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

.nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
}

.nav a.active,
.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main {
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

h1,
h2,
p {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 18px;
}

button {
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-name {
    color: var(--muted);
    font-size: 14px;
}

.primary-button {
    width: 100%;
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
}

.primary-button:hover {
    color: #fff;
    background: #1d4ed8;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metrics article,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.metrics article {
    padding: 18px;
}

.metrics span,
.metrics em,
.panel-head p,
.status-text {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.metrics strong {
    display: block;
    margin: 10px 0 8px;
    font-size: 30px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.panel {
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.panel-head p {
    margin-top: 6px;
}

.chart-wrap {
    width: 100%;
    height: 360px;
    padding: 12px 18px 18px;
}

#growthChart {
    width: 100%;
    height: 360px;
    display: block;
}

.login-page {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}

.login-shell {
    width: 100%;
    max-width: 420px;
}

.login-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-brand {
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.login-brand .brand-mark {
    background: #101828;
    color: #fff;
}

.login-form {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.login-form h1 {
    margin-bottom: 4px;
    font-size: 24px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    height: 42px;
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: #fff;
    font-size: 15px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.login-message {
    min-height: 20px;
    color: #dc2626;
    font-size: 13px;
}

@media (max-width: 980px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 18px;
    }

    .topbar,
    .actions,
    .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

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