:root {
    --bg: #eef4ff;
    --bg-soft: #f8fbff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --muted: #64748b;
    --line: rgba(148, 163, 184, .28);
    --white: #ffffff;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --shadow: 0 24px 70px rgba(15, 23, 42, .10);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--secondary);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .18), transparent 32rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, .18), transparent 30rem),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.menu-toggle {
    display: none;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 0;
}

.app-header {
    grid-column: 1 / -1;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 18px 26px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.brand-area,
.user-area,
.user-chip {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    letter-spacing: -.04em;
    border-radius: 16px;
    
    box-shadow: 0 15px 30px rgba(37, 99, 235, .28);
}

.brand-area h1 {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    line-height: 1.1;
}

.brand-area p,
.sidebar-header p,
.section-title p,
.stat-card p,
.quick-card small,
.user-chip small {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .86rem;
}

.avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--primary-dark);
    font-weight: 800;
    background: #dbeafe;
}

.user-chip {
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
}

.user-chip strong {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .92rem;
}

.btn-logout,
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    transition: .2s ease;
}

.btn-logout {
    color: #fff;
    background: linear-gradient(135deg, var(--danger), #fb7185);
    box-shadow: 0 14px 28px rgba(220, 38, 38, .18);
}

.btn-logout:hover,
.btn-primary:hover,
.btn-secondary:hover,
.quick-card:hover,
.stat-card:hover {
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--secondary);
    border-radius: 99px;
}

.sidebar {
    grid-row: 2 / 4;
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, .58);
    backdrop-filter: blur(16px);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #eff6ff, #fff);
    border: 1px solid var(--line);
}

.sidebar-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--secondary);
    color: #fff;
}

.sidebar-header h2,
.section-title h3 {
    margin: 0;
    font-size: 1rem;
}

.nav-menu {
    display: grid;
    gap: 8px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    color: #334155;
    border-radius: 16px;
    font-weight: 700;
    transition: .2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    box-shadow: 0 16px 28px rgba(37, 99, 235, .18);
}

.content {
    padding: 28px;
    overflow: hidden;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 700;
}

.alert.success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
    gap: 22px;
    min-height: 300px;
    padding: clamp(24px, 4vw, 42px);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #ffffff, #f8fbff 45%, #dbeafe);
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: var(--shadow);
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: auto -8rem -10rem auto;
    width: 28rem;
    height: 28rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, .12);
}

.badge {
    display: inline-flex;
    width: fit-content;
    padding: 8px 13px;
    color: var(--primary-dark);
    background: #dbeafe;
    border-radius: 999px;
    font-weight: 800;
    font-size: .82rem;
}

.hero-text h2 {
    margin: 16px 0 12px;
    font-size: clamp(1.75rem, 4vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -.05em;
}

.hero-text p {
    max-width: 720px;
    margin: 0;
    color: #475569;
    font-size: 1.02rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    box-shadow: 0 16px 32px rgba(37, 99, 235, .24);
}

.btn-secondary {
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid #bfdbfe;
}

.hero-illustration {
    position: relative;
    min-height: 220px;
}

.circle-orbit {
    position: absolute;
    right: 10%;
    top: 14%;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #22c55e);
    opacity: .9;
    box-shadow: inset 0 0 35px rgba(255, 255, 255, .35), 0 30px 60px rgba(37, 99, 235, .28);
}

.floating-card {
    position: absolute;
    z-index: 2;
    display: grid;
    gap: 6px;
    min-width: 150px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
    font-size: 1.8rem;
    backdrop-filter: blur(10px);
}

.floating-card span {
    font-size: .9rem;
    font-weight: 800;
}

.card-a {
    left: 10%;
    top: 18%;
}

.card-b {
    right: 2%;
    bottom: 12%;
}

.stat-grid,
.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.stat-card,
.quick-panel,
.quick-card {
    border: 1px solid rgba(255, 255, 255, .82);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .07);
    backdrop-filter: blur(14px);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-radius: var(--radius-lg);
    transition: .2s ease;
}

.stat-icon {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 1.35rem;
}

.stat-icon.blue { background: #dbeafe; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.amber { background: #fef3c7; }

.stat-card span {
    color: var(--muted);
    font-weight: 800;
    font-size: .85rem;
}

.stat-card strong {
    display: block;
    margin-top: 3px;
    font-size: 2rem;
    line-height: 1;
}

.quick-panel {
    margin-top: 22px;
    padding: 24px;
    border-radius: var(--radius-xl);
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
}

.quick-card {
    display: grid;
    gap: 8px;
    min-height: 145px;
    padding: 20px;
    border-radius: var(--radius-lg);
    transition: .2s ease;
}

.quick-card span {
    font-size: 2rem;
}

.quick-card strong {
    font-size: 1rem;
}

.app-footer {
    padding: 20px 28px;
    color: var(--muted);
    text-align: center;
    font-size: .9rem;
}

.overlay {
    display: none;
}

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

    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-illustration {
        min-height: 180px;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .hamburger {
        display: grid;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: min(86vw, 330px);
        transform: translateX(-105%);
        transition: .25s ease;
        background: rgba(255, 255, 255, .95);
        box-shadow: 30px 0 70px rgba(15, 23, 42, .18);
        overflow-y: auto;
    }

    .menu-toggle:checked ~ .app-shell .sidebar {
        transform: translateX(0);
    }

    .menu-toggle:checked ~ .app-shell .overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(15, 23, 42, .46);
    }

    .user-chip {
        display: none;
    }

    .content {
        padding: 18px;
    }
}

@media (max-width: 620px) {
    .app-header {
        padding: 14px;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .brand-area p,
    .btn-logout {
        display: none;
    }

    .hero-card,
    .quick-panel {
        border-radius: 22px;
        padding: 20px;
    }

    .stat-grid,
    .quick-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 18px;
    }

    .hero-actions a {
        width: 100%;
    }

    .hero-illustration {
        display: none;
    }

    .section-title {
        align-items: start;
        flex-direction: column;
    }
}

.back-home-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #64748b;
    background: #64748b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.back-home-button:hover {
    background: #475569;
    border-color: #475569;
    color: #ffffff;
}