/* =================================
   RESET & VARIABLES
================================= */

:root {
    --bg: #f5f7f6;
    --surface: #ffffff;
    --sidebar: #111713;
    --sidebar-soft: #1b241e;

    --text: #172019;
    --muted: #7b847d;
    --line: #e5e9e6;

    --accent: #7c5cff;
    --accent-soft: #eeeaff;

    --green: #2d9b68;
    --green-soft: #e8f6ef;

    --red: #d45b5b;
    --red-soft: #fceeee;

    --sans: "DM Sans", sans-serif;
    --display: "Space Grotesk", sans-serif;
}


/* =================================
   GLOBAL
================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}


/* =================================
   APP LAYOUT
================================= */

.app {
    min-height: 100vh;
    display: flex;
}


/* =================================
   SIDEBAR
================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;

    width: 245px;
    height: 100vh;

    padding: 28px 18px;

    background: var(--sidebar);
    color: #ffffff;

    display: flex;
    flex-direction: column;

    z-index: 100;
}


/* BRAND */

.brand {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 0 10px;
    margin-bottom: 45px;

    font-family: var(--display);
    font-weight: 600;
    font-size: 17px;
}

.brand-mark {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    background: var(--accent);
    border-radius: 9px;

    font-weight: 700;
}


/* NAVIGATION */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-label {
    margin: 20px 10px 10px;

    color: #6f7971;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 11px 12px;

    border-radius: 9px;

    color: #aeb6b0;

    font-size: 12px;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.nav-item span {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.nav-item:hover {
    background: var(--sidebar-soft);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--accent);
    color: #ffffff;
}


/* SIDEBAR BOTTOM */

.sidebar-bottom {
    margin-top: auto;
}

.user-card {
    margin-top: 22px;
    padding: 12px 10px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-top: 1px solid rgba(255,255,255,0.08);
}

.avatar,
.top-avatar {
    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #d9cfff;
    color: #5540c7;

    font-size: 10px;
    font-weight: 700;
}

.avatar {
    width: 34px;
    height: 34px;
}

.user-card strong {
    display: block;
    font-size: 11px;
}

.user-card small {
    color: #737d75;
    font-size: 9px;
}


/* =================================
   MAIN CONTENT
================================= */

.main-content {
    width: calc(100% - 245px);
    margin-left: 245px;
}


/* =================================
   TOPBAR
================================= */

.topbar {
    height: 76px;

    padding: 0 42px;

    background: rgba(255,255,255,0.9);

    border-bottom: 1px solid var(--line);

    display: flex;
    align-items: center;
    justify-content: space-between;

    position: sticky;
    top: 0;

    backdrop-filter: blur(12px);

    z-index: 50;
}

.search-box {
    width: 280px;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 10px 13px;

    background: var(--bg);
    border: 1px solid var(--line);

    border-radius: 8px;
}

.search-box span {
    color: var(--muted);
    font-size: 19px;
}

.search-box input {
    width: 100%;

    border: none;
    outline: none;

    background: transparent;

    font-size: 11px;
    color: var(--text);
}

.search-box input::placeholder {
    color: #9ca39e;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 34px;
    height: 34px;

    border: 1px solid var(--line);
    border-radius: 8px;

    background: var(--surface);
    color: var(--muted);

    transition: 0.25s ease;
}

.icon-btn:hover {
    color: var(--accent);
    border-color: #d8d0ff;
}

.top-avatar {
    width: 34px;
    height: 34px;
}

.mobile-menu {
    display: none;
}


/* =================================
   DASHBOARD
================================= */

.dashboard {
    padding: 45px 42px 70px;
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    margin-bottom: 32px;
}

.eyebrow {
    color: var(--muted);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 0.12em;

    margin-bottom: 9px;
}

.welcome h1 {
    font-family: var(--display);

    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.1;

    font-weight: 600;
    letter-spacing: -0.04em;
}

.welcome-text {
    margin-top: 9px;

    color: var(--muted);

    font-size: 12px;
}


/* BUTTON */

.primary-btn {
    border: none;

    padding: 12px 18px;

    background: var(--accent);
    color: #ffffff;

    border-radius: 8px;

    font-size: 11px;
    font-weight: 600;

    box-shadow: 0 7px 18px rgba(124,92,255,0.2);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124,92,255,0.3);
}


/* =================================
   STAT CARDS
================================= */

.stats-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 16px;
}

.stat-card {
    padding: 21px;

    background: var(--surface);

    border: 1px solid var(--line);

    border-radius: 12px;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);

    box-shadow: 0 12px 30px rgba(23,32,25,0.07);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;

    color: var(--muted);

    font-size: 10px;
}

.stat-icon {
    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    border-radius: 7px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 12px;
    font-weight: 700;
}

.stat-card h2 {
    margin-top: 18px;

    font-family: var(--display);

    font-size: 27px;
    font-weight: 600;

    letter-spacing: -0.04em;
}

.positive,
.negative {
    margin-top: 9px;

    font-size: 9px;
    font-weight: 600;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.positive span,
.negative span {
    color: var(--muted);
    font-weight: 400;
}


/* =================================
   RESPONSIVE
================================= */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 800px) {

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        padding: 0 20px;
    }

    .mobile-menu {
        display: block;

        border: none;
        background: transparent;

        font-size: 20px;
        color: var(--text);
    }

    .search-box {
        display: none;
    }

    .dashboard {
        padding: 30px 20px 50px;
    }

    .welcome {
        align-items: flex-start;
        flex-direction: column;
        gap: 25px;
    }

}


@media (max-width: 520px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .welcome h1 {
        font-size: 30px;
    }

    .topbar-actions {
        margin-left: auto;
    }

}

/* =================================
   ANALYTICS & PROJECT PANELS
================================= */

.dashboard-grid {
    padding: 0 42px 70px;

    display: grid;
    grid-template-columns: 1.35fr 1fr;

    gap: 18px;
}

.panel {
    background: var(--surface);

    border: 1px solid var(--line);

    border-radius: 12px;

    padding: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 30px;
}

.panel-label {
    color: var(--muted);

    font-size: 8px;
    font-weight: 700;

    letter-spacing: 0.13em;

    margin-bottom: 7px;
}

.panel-header h2 {
    font-family: var(--display);

    font-size: 18px;
    font-weight: 600;

    letter-spacing: -0.03em;
}

.period-select {
    border: 1px solid var(--line);

    background: var(--bg);

    border-radius: 6px;

    padding: 7px 9px;

    color: var(--muted);

    font-size: 9px;

    outline: none;
}


/* =================================
   CHART
================================= */

.chart {
    height: 260px;

    display: flex;
}

.chart-values {
    width: 35px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding-bottom: 28px;

    color: #9ba29d;

    font-size: 8px;
}

.chart-area {
    position: relative;

    flex: 1;

    border-bottom: 1px solid var(--line);
}

.grid-line {
    position: absolute;
    left: 0;
    right: 0;

    border-top: 1px dashed #e7ebe8;
}

.line-1 {
    top: 0;
}

.line-2 {
    top: 33%;
}

.line-3 {
    top: 66%;
}

.line-4 {
    top: 100%;
}

.bars {
    position: absolute;

    inset: 0;

    display: flex;
    justify-content: space-around;
    align-items: flex-end;

    padding: 0 8px 0;
}

.bar-group {
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;

    gap: 9px;
}

.bar {
    width: 24px;

    min-height: 10px;

    border-radius: 5px 5px 2px 2px;

    background: #ddd8ff;

    transition:
        height 0.6s ease,
        transform 0.25s ease;
}

.bar:hover {
    transform: scaleX(1.15);
}

.bar.highlight {
    background: var(--accent);
}

.bar-group span {
    color: #929a94;

    font-size: 8px;
}


/* =================================
   PROJECTS
================================= */

.view-link {
    color: var(--accent);

    font-size: 9px;
    font-weight: 600;
}

.project-list {
    display: flex;
    flex-direction: column;
}

.project {
    display: grid;

    grid-template-columns: 38px 1fr 95px;

    align-items: center;

    gap: 12px;

    padding: 15px 0;

    border-bottom: 1px solid var(--line);
}

.project:last-child {
    border-bottom: none;
}

.project-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    font-size: 11px;
    font-weight: 700;
}

.project-icon.purple {
    background: #eeeaff;
    color: #7255e8;
}

.project-icon.green {
    background: #e8f6ef;
    color: #2d9b68;
}

.project-icon.orange {
    background: #fff0df;
    color: #c47a25;
}

.project-icon.blue {
    background: #e8f1ff;
    color: #4d7dcc;
}

.project-info {
    min-width: 0;
}

.project-info strong {
    display: block;

    font-size: 11px;
    font-weight: 600;
}

.project-info span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 8px;
}

.project-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-track {
    width: 55px;
    height: 5px;

    background: #edf0ee;

    border-radius: 10px;

    overflow: hidden;
}

.progress-fill {
    height: 100%;

    background: var(--accent);

    border-radius: inherit;
}

.project-progress > span {
    color: var(--muted);

    font-size: 8px;
}


/* =================================
   RESPONSIVE PANELS
================================= */

@media (max-width: 1100px) {

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .dashboard-grid {
        padding: 0 20px 50px;
    }

    .panel {
        padding: 18px;
    }

    .project {
        grid-template-columns: 35px 1fr;
    }

    .project-progress {
        grid-column: 2;
    }

    .chart {
        height: 220px;
    }

}  
/* =================================
   TASKS & AI ASSISTANT
================================= */

.bottom-grid {
    padding: 0 42px 70px;

    display: grid;

    grid-template-columns: 1.15fr 0.85fr;

    gap: 18px;
}


/* =================================
   TASKS
================================= */

.task-list {
    display: flex;
    flex-direction: column;
}

.task {
    position: relative;

    display: grid;

    grid-template-columns: 20px 1fr auto;

    align-items: center;

    gap: 12px;

    padding: 16px 0;

    border-bottom: 1px solid var(--line);

    cursor: pointer;
}

.task:last-child {
    border-bottom: none;
}

.task input {
    position: absolute;

    opacity: 0;
}

.checkmark {
    width: 17px;
    height: 17px;

    border: 1px solid #ccd2ce;

    border-radius: 5px;

    transition: 0.25s ease;
}

.task:hover .checkmark {
    border-color: var(--accent);
}

.task input:checked + .checkmark {
    background: var(--accent);

    border-color: var(--accent);
}

.task input:checked + .checkmark::after {
    content: "✓";

    display: block;

    color: #ffffff;

    font-size: 10px;

    text-align: center;

    line-height: 16px;
}

.task-content strong {
    display: block;

    font-size: 11px;
    font-weight: 600;

    transition: 0.25s ease;
}

.task-content span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 8px;
}

.task input:checked ~ .task-content strong {
    color: #a0a6a2;
    text-decoration: line-through;
}

.task-tag {
    padding: 5px 8px;

    border-radius: 5px;

    font-size: 7px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.task-tag.high {
    background: var(--red-soft);
    color: var(--red);
}

.task-tag.medium {
    background: #fff3df;
    color: #c48128;
}

.task-tag.low {
    background: var(--green-soft);
    color: var(--green);
}


/* =================================
   AI PANEL
================================= */

.ai-panel {
    position: relative;

    overflow: hidden;

    min-height: 300px;

    padding: 27px;

    background: #171321;

    color: #ffffff;

    border-radius: 12px;

    border: 1px solid #282038;
}

.ai-glow {
    position: absolute;

    width: 180px;
    height: 180px;

    top: -90px;
    right: -50px;

    background: var(--accent);

    opacity: 0.15;

    border-radius: 50%;

    filter: blur(40px);
}

.ai-header {
    position: relative;

    display: flex;
    align-items: center;

    gap: 12px;
}

.ai-icon {
    width: 37px;
    height: 37px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: rgba(124,92,255,0.18);

    color: #a995ff;

    font-size: 17px;
}

.ai-panel .panel-label {
    color: #8e879f;
}

.ai-panel h2 {
    font-family: var(--display);

    font-size: 17px;

    font-weight: 600;

    letter-spacing: -0.03em;
}


/* AI MESSAGE */

.ai-message {
    position: relative;

    margin-top: 35px;

    padding: 15px;

    display: flex;
    align-items: flex-start;

    gap: 9px;

    background: rgba(255,255,255,0.05);

    border: 1px solid rgba(255,255,255,0.07);

    border-radius: 9px;
}

.ai-status {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    margin-top: 5px;

    border-radius: 50%;

    background: #5edb99;

    box-shadow: 0 0 10px rgba(94,219,153,0.5);
}

.ai-message p {
    color: #bcb6c7;

    font-size: 10px;

    line-height: 1.6;
}

.ai-message strong {
    color: #ffffff;
}


/* AI INSIGHT */

.ai-insight {
    position: relative;

    display: flex;

    gap: 10px;

    margin-top: 18px;

    color: #9c95a8;

    font-size: 9px;

    line-height: 1.7;
}

.ai-insight > span {
    color: #a995ff;

    font-size: 13px;
}


/* AI BUTTON */

.ai-button {
    position: relative;

    width: 100%;

    margin-top: 22px;

    padding: 11px 14px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    border: 1px solid #3b3150;

    border-radius: 7px;

    background: #241d32;

    color: #ffffff;

    font-size: 9px;

    transition: 0.25s ease;
}

.ai-button:hover {
    background: var(--accent);

    border-color: var(--accent);

    transform: translateY(-2px);
}


/* =================================
   RESPONSIVE
================================= */

@media (max-width: 1100px) {

    .bottom-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .bottom-grid {
        padding: 0 20px 50px;
    }

    .task {
        grid-template-columns: 20px 1fr;
    }

    .task-tag {
        grid-column: 2;

        width: fit-content;
    }

}
/* =================================
   FINAL POLISH
================================= */

.panel,
.stat-card {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.panel:hover {
    border-color: #dce1de;
    box-shadow: 0 14px 35px rgba(23, 32, 25, 0.05);
}


/* Project hover */

.project {
    transition: transform 0.25s ease;
}


/* Smooth task interaction */

.task {
    transition: background 0.25s ease;
}

.task:hover {
    background: #fafbfa;
}


/* AI glow animation */

.ai-glow {
    animation: aiGlow 5s ease-in-out infinite alternate;
}

@keyframes aiGlow {

    from {
        transform: scale(1);
        opacity: 0.12;
    }

    to {
        transform: scale(1.25);
        opacity: 0.2;
    }

}


/* Dashboard entrance */

.dashboard,
.dashboard-grid,
.bottom-grid {
    animation: dashboardEnter 0.7s ease both;
}

.dashboard-grid {
    animation-delay: 0.08s;
}

.bottom-grid {
    animation-delay: 0.16s;
}

@keyframes dashboardEnter {

    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

