:root {
    --bg: #0f172a;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --line: #e5e7eb;
    --soft: #f8fafc;
    --danger: #ef4444;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #ecfeff 100%);
    color: var(--text);
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    color: white;
    font-weight: 800;
    margin-bottom: 18px;
}

.login-card h1 {
    margin: 0 0 8px;
}

.muted {
    color: var(--muted);
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    color: #991b1b;
    margin: 18px 0;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
}

button {
    border: 0;
    background: var(--primary);
    color: white;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--primary-dark);
}

.login-card button {
    width: 100%;
    margin-top: 22px;
}

.sidebar {
    position: fixed;
    inset: 18px auto 18px 18px;
    width: 280px;
    background: #0f172a;
    color: white;
    border-radius: 28px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3b82f6, #22d3ee);
    font-weight: 900;
}

.brand span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 3px;
}

nav {
    display: grid;
    gap: 10px;
}

nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 14px;
}

nav a.active,
nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-note {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
}

.sidebar-note span {
    color: #94a3b8;
    display: block;
    font-size: 12px;
}

.main {
    margin-left: 320px;
    padding: 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}

.eyebrow {
    color: var(--primary);
    margin: 0 0 4px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

h1, h2 {
    margin: 0;
}

.user-pill {
    background: white;
    border: 1px solid var(--line);
    padding: 12px 16px;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.stat-card,
.panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 34px;
    letter-spacing: -1px;
}

.stat-card small {
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
    gap: 18px;
}

.panel {
    padding: 22px;
}

.chart-panel {
    height: 520px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-head p {
    color: var(--muted);
    margin: 6px 0 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .7px;
}

td, th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
}

td {
    font-size: 14px;
}

canvas {
    max-height: 410px;
}

@media (max-width: 1050px) {
    .sidebar {
        position: static;
        width: auto;
        margin: 16px;
    }

    .sidebar-note {
        position: static;
        margin-top: 20px;
    }

    .main {
        margin-left: 0;
        padding: 18px;
    }

    .stats,
    .grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }
}