:root {
    --navy: #14213d;
    --blue: #2563eb;
    --soft: #f4f7fb;
    --line: #e5eaf2;
    --text: #172033;
    --muted: #6f7b91;
    --white: #fff;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--soft);
    color: var(--text);
    font:
        14px Inter,
        Arial,
        sans-serif;
}
button,
input {
    font: inherit;
}
button {
    cursor: pointer;
}
.app {
    min-height: 100vh;
}
.topbar {
    height: 66px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 22px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--navy);
    white-space: nowrap;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: var(--blue);
    border-radius: 9px;
    color: #fff;
    font-size: 18px;
}
.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    font-size: 22px;
    color: var(--navy);
}
.top-spacer {
    flex: 1;
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.user-meta small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}
.logout {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
    border-radius: 8px;
    padding: 8px 11px;
    text-decoration: none;
    font-weight: 600;
}
.shell {
    display: flex;
    min-height: calc(100vh - 66px);
}
.sidebar {
    width: 235px;
    padding: 22px 14px;
    background: var(--white);
    border-right: 1px solid var(--line);
    flex-shrink: 0;
}
.nav-label {
    padding: 0 12px 9px;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    color: #9aa5b6;
    letter-spacing: 0.07em;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin: 3px 0;
    border-radius: 9px;
    color: #536076;
    text-decoration: none;
    font-weight: 500;
}
.nav-link:hover,
.nav-link.active {
    background: #eff6ff;
    color: #1d4ed8;
}
.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 17px;
}
.main {
    width: min(100%, 1200px);
    margin: 0 auto;
    padding: 30px 28px;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 24px;
}
.page-heading h1 {
    font-size: 25px;
    margin: 0 0 6px;
}
.page-heading p {
    margin: 0;
    color: var(--muted);
}
main.master-main .page-heading > a.primary-btn {
    margin-top: 8px;
}
.primary-btn {
    border: 0;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 2px #1d29390a;
}
.metric-label {
    color: var(--muted);
    font-size: 13px;
}
.metric-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 10px;
}
.placeholder {
    margin-top: 18px;
}
.placeholder h2 {
    margin: 0 0 8px;
    font-size: 17px;
}
.placeholder p {
    color: var(--muted);
    margin: 0 0 18px;
}
.empty {
    padding: 30px;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    background: #fafcff;
    text-align: center;
    color: var(--muted);
}
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #e9f0ff 0%, #f8fbff 60%, #eef5ff 100%);
}
.login-card {
    width: min(100%, 410px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 16px 50px #1e3a5f18;
}
.login-card .brand {
    justify-content: center;
    margin-bottom: 28px;
}
.login-card h1 {
    font-size: 24px;
    margin: 0 0 8px;
}
.login-card p {
    color: var(--muted);
    margin: 0 0 24px;
}
.field {
    display: block;
    margin: 15px 0;
}
.field span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 7px;
}
.field input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cdd5e1;
    border-radius: 8px;
    outline: 0;
}
.field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px #2563eb18;
}
.login-card .primary-btn {
    width: 100%;
    margin-top: 8px;
}
.demo-note {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    margin: 18px 0 0;
}
@media (max-width: 700px) {
    main.master-main .page-heading > a.primary-btn {
        margin-top: 0;
    }
    .topbar {
        height: 58px;
        padding: 0 15px;
    }
    .menu-toggle {
        display: block;
    }
    .sidebar {
        position: fixed;
        z-index: 30;
        top: 58px;
        bottom: 0;
        left: 0;
        width: 250px;
        transform: translateX(-101%);
        transition: transform 0.2s;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 24px #0f172a22;
    }
    .main {
        padding: 22px 16px;
    }
    .user-meta {
        display: none;
    }
    .logout {
        padding: 7px 9px;
        font-size: 12px;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .page-heading h1 {
        font-size: 22px;
    }
    .page-heading {
        margin-bottom: 18px;
    }
    .brand {
        font-size: 13px;
    }
}
@media (max-width: 380px) {
    .logout {
        display: none;
    }
    .topbar {
        gap: 10px;
    }
    .brand-mark {
        width: 29px;
        height: 29px;
    }
}
