:root {
    --primary: #4c63ff;
    --primary-dark: #3644c2;
    --accent: #ff9f5c;
    --success: #4ad6a8;
    --danger: #ff6b6b;
    --bg-page: #f5f7fb;
    --bg-card: #ffffff;
    --bg-subtle: rgba(76, 99, 255, 0.05);
    --text-primary: #1d2333;
    --text-muted: #6f7794;
    --border-soft: rgba(60, 72, 117, 0.12);
    --border-strong: rgba(60, 72, 117, 0.2);
    --shadow-soft: 0 18px 45px rgba(26, 40, 75, 0.12);
    --sidebar-width: 280px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 20%, rgba(76, 99, 255, 0.16), transparent 45%),
        radial-gradient(circle at 88% 6%, rgba(255, 159, 92, 0.18), transparent 35%),
        radial-gradient(circle at 50% 80%, rgba(82, 226, 194, 0.14), transparent 40%);
    z-index: 0;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.page-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 0 clamp(20px, 5vw, 48px);
}

.page-shell.page-shell-centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-surface {
    background: var(--bg-card);
    border-radius: 28px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:focus-visible {
    outline: 3px solid rgba(76, 99, 255, 0.35);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(120deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 18px 30px rgba(76, 99, 255, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 35px rgba(76, 99, 255, 0.32);
}

.btn-ghost {
    background: rgba(76, 99, 255, 0.08);
    color: var(--primary-dark);
}

.btn-ghost:hover {
    transform: translateY(-1px);
}

.neo-frame {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: clamp(16px, 3vw, 32px);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: clamp(16px, 2vw, 32px);
}

.neo-sidebar {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.neo-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.neo-brand .brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: transparent;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
}

.neo-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.neo-brand .brand-title {
    font-size: 18px;
    font-weight: 600;
}

.neo-brand .brand-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.neo-user {
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(76, 99, 255, 0.08), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(76, 99, 255, 0.12);
    display: flex;
    align-items: center;
    gap: 14px;
}

.neo-user img {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: cover;
}

.neo-user .user-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.neo-user .user-name {
    font-weight: 600;
}

.neo-user .user-role {
    font-size: 13px;
    color: var(--text-muted);
}

.neo-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.neo-menu a,
.neo-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 16px;
    color: var(--text-primary);
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    text-decoration: none;
}

.neo-menu a .menu-icon,
.neo-menu .menu-item .menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(76, 99, 255, 0.08);
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 16px;
}

.neo-menu a.active,
.neo-menu a:hover,
.neo-menu .menu-item.active,
.neo-menu .menu-item:hover {
    background: rgba(76, 99, 255, 0.12);
    border-color: rgba(76, 99, 255, 0.2);
    transform: translateX(4px);
}

.neo-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: calc(100vh - (clamp(16px, 3vw, 32px) + clamp(16px, 3vw, 32px)));
}

.neo-main > .container-fluid {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.neo-main > .container-fluid > .bg-light {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.neo-topbar {
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.neo-topbar .search-shell {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    background: #fff;
}

.neo-topbar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
}

.neo-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.neo-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(76, 99, 255, 0.2);
}

.neo-content {
    padding-bottom: 32px;
}

.neo-content-inner {
    padding: clamp(16px, 3vw, 28px);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(76, 99, 255, 0.08);
    box-shadow: var(--shadow-soft);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.stat-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--border-soft);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 600;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(76, 99, 255, 0.08);
    color: var(--primary-dark);
}

.neo-menu-toggle {
    display: none;
}

@media (max-width: 1200px) {
    .neo-frame {
        grid-template-columns: minmax(0, 1fr);
    }

    .neo-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 85vw);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 10;
    }

    .neo-sidebar.is-open {
        transform: translateX(0);
    }

    .neo-menu-toggle {
        display: inline-flex;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: #eef1fb;
    }
}

