@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    --purple: #7655D9;
    --deep: #35205F;
    --lavender: #F1ECFF;
    --orange: #FFAD66;
    --pink: #FCE8F0;
    --green: #DFF5EA;
    --blue: #E6F0FF;
    --bg: #F7F5FC;
    --white: #FFFFFF;
    --text: #302746;
    --muted: #928AA4;
    --border: #EDE8F5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    background: var(--bg);
    color: var(--text);
}

/* Sidebar */

.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 255px;
    height: 100vh;
    background: linear-gradient(160deg, #493078, #291747);
    padding: 35px 22px;
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.logo {
    font-size: 23px;
    font-weight: 800;
    margin-bottom: 65px;
    padding-right: 10px;
}

.logo span,
footer h3 span {
    color: var(--orange);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.sidebar nav a {
    text-decoration: none;
    color: #D8CDEB;
    padding: 14px 16px;
    border-radius: 13px;
    font-size: 14px;
    transition: 0.3s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #7655D9;
    color: white;
    transform: translateX(-4px);
}

.sidebar-bottom {
    margin-top: auto;
    padding: 20px 10px;
    border-top: 1px solid #ffffff20;
}

.sidebar-bottom p {
    font-size: 10px;
    color: var(--orange);
    font-weight: 800;
    letter-spacing: 1px;
}

.sidebar-bottom span {
    font-size: 11px;
    color: #BDB0D2;
}

/* Main */

.main-content {
    margin-right: 255px;
    padding: 30px 38px;
    max-width: 1600px;
}

/* Topbar */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 15px;
}

.welcome {
    font-size: 13px;
    color: var(--muted);
}

.topbar h2 {
    font-size: 23px;
    font-weight: 800;
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 10px 17px;
    border: 1px solid var(--border);
    border-radius: 15px;
}

.profile > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--lavender);
    border-radius: 12px;
    font-size: 21px;
}

.profile strong {
    display: block;
    font-size: 12px;
}

.profile small {
    color: var(--muted);
    font-size: 11px;
}

/* Hero */

.hero {
    background: linear-gradient(115deg, #50347E, #7856D7 75%, #987BE5);
    color: white;
    border-radius: 25px;
    padding: 42px;
    min-height: 245px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 27px;
    box-shadow: 0 15px 35px #6544b522;
}

.hero::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    background: #ffffff12;
    border-radius: 50%;
    left: 13%;
    top: -150px;
}

.hero-label {
    color: #FFD0A4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 13px;
}

.hero h1 {
    font-size: clamp(25px, 3vw, 35px);
    line-height: 1.6;
    margin-bottom: 8px;
}

.hero h1 span {
    color: var(--orange);
}

.hero > div:first-child > p:last-of-type {
    color: #E5DCF7;
    font-size: 13px;
    margin-bottom: 22px;
}

.hero-button {
    display: inline-block;
    text-decoration: none;
    background: var(--orange);
    color: #4B2B52;
    padding: 11px 21px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
    transition: 0.3s;
}

.hero-button:hover {
    background: white;
    transform: translateY(-3px);
}

.hero-icon {
    font-size: 85px;
    background: #ffffff18;
    border: 1px solid #ffffff25;
    border-radius: 30px;
    width: 140px;
    height: 140px;
    display: grid;
    place-items: center;
    transform: rotate(-8deg);
    flex-shrink: 0;
}

/* Statistics */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 19px;
    padding: 21px;
    box-shadow: 0 5px 20px #35205f08;
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card:nth-child(1) {
    border-bottom: 4px solid var(--purple);
}

.stat-card:nth-child(2) {
    border-bottom: 4px solid var(--orange);
}

.stat-card:nth-child(3) {
    border-bottom: 4px solid #54B88A;
}

.stat-card:nth-child(4) {
    border-bottom: 4px solid #78A4E8;
}

.stat-card > span {
    display: grid;
    place-items: center;
    width: 47px;
    height: 47px;
    border-radius: 15px;
    font-size: 21px;
    margin-bottom: 14px;
}

.stat-card:nth-child(1) > span {
    background: var(--lavender);
}

.stat-card:nth-child(2) > span {
    background: #FFF0E2;
}

.stat-card:nth-child(3) > span {
    background: var(--green);
}

.stat-card:nth-child(4) > span {
    background: var(--blue);
}

.stat-card h3 {
    font-size: 29px;
    font-weight: 800;
}

.stat-card p {
    font-size: 12px;
    color: var(--muted);
}

/* Sections */

.section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px;
    margin-bottom: 27px;
    box-shadow: 0 6px 22px #35205f08;
    scroll-margin-top: 25px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-heading p {
    font-size: 10px;
    color: var(--purple);
    font-weight: 800;
    letter-spacing: 1.4px;
}

.section-heading h2 {
    font-size: 21px;
    font-weight: 800;
    margin-top: 3px;
}

/* Forms */

.project-form,
.task-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

input,
select {
    font-family: inherit;
    background: #FAF9FD;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 15px;
    min-height: 48px;
    outline: none;
    font-size: 12px;
    transition: 0.2s;
}

input:focus,
select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px #7655D91A;
}

.project-form input {
    flex: 1;
    min-width: 180px;
}

.task-form input {
    flex: 1.5;
    min-width: 180px;
}

.task-form select {
    flex: 1;
    min-width: 130px;
}

.project-form button,
.task-form button {
    background: var(--purple);
    color: white;
    padding: 12px 22px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    transition: 0.3s;
}

.project-form button:hover,
.task-form button:hover {
    background: var(--deep);
    transform: translateY(-2px);
}

/* Project cards */

.projects-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.projects-container > div {
    background: #FCFAFF;
    border: 1px solid #EAE3F8;
    border-radius: 17px;
    padding: 20px;
    transition: 0.3s;
}

.projects-container > div:hover {
    border-color: #BDA9ED;
    transform: translateY(-3px);
}

/* Tasks */

.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tasks-container > div {
    background: #FCFAFF;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 17px;
    transition: 0.3s;
}

.tasks-container > div:hover {
    border-color: #C8B7ED;
}

/* Dynamic buttons */

.projects-container button,
.tasks-container button {
    font-family: inherit;
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 11px;
    margin: 5px 3px;
    transition: 0.2s;
}

.projects-container button:hover,
.tasks-container button:hover {
    opacity: 0.8;
}

/* Progress */

.progress-card {
    background: linear-gradient(120deg, #F5F0FF, #FFF5EA);
    padding: 26px;
    border-radius: 18px;
    border: 1px solid #EAE1F8;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
}

.progress-info strong {
    font-size: 14px;
}

.progress-info span {
    color: var(--purple);
    font-size: 27px;
    font-weight: 800;
}

.progress-bar {
    width: 100%;
    height: 13px;
    background: #E5DDF2;
    border-radius: 30px;
    overflow: hidden;
}

#progressFill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--orange), var(--purple));
    border-radius: 30px;
    transition: width 0.4s ease;
}

.progress-card > p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 15px;
}

/* Footer */

footer {
    text-align: center;
    padding: 28px 15px;
    margin-top: 20px;
    background: #35205F;
    color: white;
    border-radius: 20px;
}

footer h3 {
    font-size: 19px;
    margin-bottom: 8px;
}

footer p {
    color: #D5CBE6;
    font-size: 11px;
    margin-top: 5px;
}

/* Responsive */

@media (max-width: 1050px) {
    .sidebar {
        width: 210px;
    }

    .main-content {
        margin-right: 210px;
        padding: 25px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 18px;
    }

    .logo {
        margin-bottom: 18px;
    }

    .sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 7px;
    }

    .sidebar nav a {
        white-space: nowrap;
        padding: 10px;
        font-size: 12px;
    }

    .sidebar-bottom {
        display: none;
    }

    .main-content {
        margin-right: 0;
        padding: 20px 15px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding: 25px;
        min-height: auto;
    }

    .hero-icon {
        display: none;
    }

    .hero h1 {
        font-size: 25px;
    }

    .stats {
        gap: 11px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card h3 {
        font-size: 24px;
    }

    .section {
        padding: 19px;
    }

    .projects-container {
        grid-template-columns: 1fr;
    }

    .project-form,
    .task-form {
        flex-direction: column;
    }

    .project-form input,
    .task-form input,
    .task-form select {
        width: 100%;
    }

    .profile {
        width: 100%;
    }
}