/* ===== 1. Global Design ===== */

* {
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --secondary: #06b6d4;
    --dark: #101a35;
    --background: #f4f7fc;
    --text: #17233f;
    --muted: #7b879d;
    --white: #ffffff;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

/* ===== 2. Main Layout ===== */

.app {
    display: flex;
    min-height: 100vh;
}

/* ===== 3. Sidebar ===== */

.sidebar {
    width: 255px;
    flex-shrink: 0;
    padding: 28px 16px;
    color: white;
    background: linear-gradient(180deg, #101a35, #172d55);
}

.sidebar h2 {
    margin: 0 0 40px;
    padding-left: 12px;
    font-size: 25px;
    letter-spacing: 0.5px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #c3cee3;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
}

.nav-btn:hover {
    background: #ffffff12;
    color: white;
    transform: translateX(3px);
}

.nav-btn.active {
    background: linear-gradient(100deg, #2563eb, #0891b2);
    color: white;
    box-shadow: 0 7px 20px #00000025;
}

/* ===== 4. Main Content ===== */

.content {
    flex: 1;
    min-width: 0;
    padding: 38px;
}

.content h1 {
    margin: 0 0 12px;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.5px;
}

.content > section > p {
    color: var(--muted);
    line-height: 1.7;
}

/* ===== 5. Dashboard Cards ===== */

.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 30px;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    min-height: 145px;
    background: var(--white);
    border: 1px solid #e8edf5;
    border-radius: 20px;
    box-shadow: 0 8px 28px #2038640a;
    transition: transform 0.25s ease,
                box-shadow 0.25s ease;
}

/* Decorative curved shape */

.card::after {
    content: "";
    position: absolute;
    width: 115px;
    height: 115px;
    right: -38px;
    top: -45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #cffafe);
    opacity: 0.8;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px #20386416;
}

.card h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.card p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
}

/* ===== 6. Page Switching ===== */

.page {
    display: none;
    animation: appear 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 7. Footer ===== */

footer {
    margin-top: 45px;
    padding-top: 20px;
    border-top: 1px solid #e0e7f1;
    color: var(--muted);
    font-size: 12px;
}

/* ===== 8. Responsive Layout ===== */

@media (max-width: 760px) {
    .sidebar {
        width: 175px;
        padding: 22px 10px;
    }

    .sidebar h2 {
        padding-left: 5px;
        font-size: 19px;
    }

    .content {
        padding: 22px 14px;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .nav-btn {
        padding: 12px 9px;
        font-size: 12px;
    }
}

@media (max-width: 430px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar h2 {
        margin-bottom: 20px;
    }

    nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
