/* =========================
   VARIABLES
========================= */

:root {

    --background: #f6f7fb;

    --surface: #ffffff;

    --surface-soft: #f1f3f8;

    --text: #151820;

    --text-secondary: #737987;

    --border: #e6e8ee;

    --primary: #5b5ce2;

    --primary-dark: #494acb;

    --primary-soft: #ededff;

    --green: #35a36a;

    --green-soft: #e7f7ee;

    --red: #df5c67;

    --red-soft: #fdecef;

    --orange: #e99b3f;

    --orange-soft: #fff3df;

    --blue: #4f8bd6;

    --blue-soft: #eaf3ff;

    --shadow:
        0 8px 30px rgba(20, 25, 40, 0.05);

    --radius: 16px;

}


/* =========================
   RESET
========================= */

* {

    box-sizing: border-box;

    margin: 0;

    padding: 0;

}


body {

    font-family: "Inter", sans-serif;

    background: var(--background);

    color: var(--text);

    min-height: 100vh;

}


button,
input,
select,
textarea {

    font-family: inherit;

}


button {

    cursor: pointer;

}


button:focus,
input:focus,
select:focus,
textarea:focus {

    outline: none;

}


/* =========================
   APP
========================= */

.app {

    display: flex;

    min-height: 100vh;

}


/* =========================
   SIDEBAR
========================= */

.sidebar {

    width: 250px;

    min-height: 100vh;

    background: var(--surface);

    border-right: 1px solid var(--border);

    padding: 26px 18px;

    display: flex;

    flex-direction: column;

    position: fixed;

    left: 0;

    top: 0;

    bottom: 0;

}


.logo {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 0 8px;

    margin-bottom: 38px;

}


.logo-icon {

    width: 42px;

    height: 42px;

    border-radius: 12px;

    background: var(--primary);

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 20px;

    font-weight: 800;

}


.logo-text {

    display: flex;

    flex-direction: column;

    gap: 2px;

}


.logo-text strong {

    font-size: 15px;

}


.logo-text span {

    font-size: 9px;

    color: var(--text-secondary);

}


/* =========================
   NAVIGATION
========================= */

.navigation {

    display: flex;

    flex-direction: column;

    gap: 6px;

}


.nav-item {

    width: 100%;

    border: none;

    background: transparent;

    color: var(--text-secondary);

    padding: 12px 13px;

    border-radius: 11px;

    display: flex;

    align-items: center;

    gap: 12px;

    text-align: left;

    font-size: 13px;

    font-weight: 500;

    transition: 0.2s;

}


.nav-item:hover {

    background: var(--surface-soft);

    color: var(--text);

}


.nav-item.active {

    background: var(--primary-soft);

    color: var(--primary);

    font-weight: 700;

}


.nav-icon {

    width: 20px;

    text-align: center;

    font-size: 17px;

}


.sidebar-bottom {

    margin-top: auto;

}


.theme-toggle {

    width: 100%;

    border: none;

    background: transparent;

    color: var(--text-secondary);

    padding: 12px 13px;

    border-radius: 11px;

    display: flex;

    align-items: center;

    gap: 12px;

    font-size: 13px;

}


.theme-toggle:hover {

    background: var(--surface-soft);

}


/* =========================
   MAIN
========================= */

.main {

    margin-left: 250px;

    width: calc(100% - 250px);

    min-height: 100vh;

    padding: 28px 38px 50px;

}


/* =========================
   TOPBAR
========================= */

.topbar {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 35px;

}


.topbar-left {

    display: flex;

    flex-direction: column;

    gap: 6px;

}


.current-date {

    color: var(--text-secondary);

    font-size: 12px;

    text-transform: capitalize;

}


.topbar h1 {

    font-size: 28px;

    font-weight: 800;

    letter-spacing: -0.8px;

}


.add-task-button {

    border: none;

    background: var(--primary);

    color: white;

    padding: 12px 17px;

    border-radius: 11px;

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 12px;

    font-weight: 700;

    transition: 0.2s;

}


.add-task-button:hover {

    background: var(--primary-dark);

    transform: translateY(-1px);

}


.add-task-button span {

    font-size: 18px;

    line-height: 1;

}


/* =========================
   PAGES
========================= */

.page {

    display: none;

}


.page.active {

    display: block;

}


/* =========================
   WELCOME
========================= */

.welcome {

    background:
        linear-gradient(
            135deg,
            var(--primary-soft),
            var(--surface)
        );

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 28px;

    margin-bottom: 22px;

}


.section-label {

    display: block;

    color: var(--primary);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.2px;

    margin-bottom: 7px;

}


.welcome h2 {

    font-size: 23px;

    margin-bottom: 7px;

}


.welcome p {

    color: var(--text-secondary);

    font-size: 13px;

}


/* =========================
   STATS
========================= */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;

    margin-bottom: 22px;

}


.stat-card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 18px;

    display: flex;

    align-items: center;

    gap: 13px;

    box-shadow: var(--shadow);

}


.stat-icon {

    width: 40px;

    height: 40px;

    border-radius: 11px;

    background: var(--primary-soft);

    color: var(--primary);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 17px;

    font-weight: 700;

}


.stat-card > div:last-child {

    display: flex;

    flex-direction: column;

    gap: 4px;

}


.stat-label {

    font-size: 10px;

    color: var(--text-secondary);

}


.stat-card strong {

    font-size: 22px;

}


/* =========================
   DASHBOARD GRID
========================= */

.dashboard-grid {

    display: grid;

    grid-template-columns: 1.7fr 1fr;

    gap: 20px;

    margin-bottom: 20px;

}


/* =========================
   CARDS
========================= */

.card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 23px;

    box-shadow: var(--shadow);

}


.large-card {

    min-height: 420px;

}


.card-header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 22px;

}


.card-header h3 {

    font-size: 17px;

    font-weight: 700;

}


/* =========================
   WEEK OVERVIEW
========================= */

.week-section {

    margin-top: 5px;

}


.week-section-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 13px;

}


.week-section-header h4 {

    font-size: 14px;

    font-weight: 700;

}


.week-range {

    display: block;

    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 10px;

}


.week-task-list {

    display: flex;

    flex-direction: column;

    gap: 7px;

}


.week-divider {

    height: 1px;

    background: var(--border);

    margin: 23px 0;

}


/* =========================
   TASK LIST
========================= */

.task-list {

    display: flex;

    flex-direction: column;

    gap: 8px;

}


.task-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 11px;

    transition: 0.2s;

}


.task-item:hover {

    border-color: #d7d9e2;

    transform: translateY(-1px);

}


.task-item.completed {

    opacity: 0.58;

}


.task-item.completed .task-title {

    text-decoration: line-through;

}


.task-checkbox {

    width: 20px;

    height: 20px;

    min-width: 20px;

    border: 1.5px solid var(--border);

    border-radius: 6px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    font-size: 12px;

    color: white;

    background: var(--surface);

    transition: 0.2s;

}


.task-checkbox:hover {

    border-color: var(--primary);

}


.task-item.completed .task-checkbox {

    background: var(--green);

    border-color: var(--green);

}


.task-content {

    flex: 1;

    min-width: 0;

}


.task-title {

    font-size: 12px;

    font-weight: 700;

    margin-bottom: 6px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}


.task-meta {

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 6px;

}


.task-subject,
.task-date {

    font-size: 9px;

    color: var(--text-secondary);

    background: var(--surface-soft);

    padding: 4px 7px;

    border-radius: 6px;

}


.priority {

    font-size: 9px;

    padding: 4px 7px;

    border-radius: 6px;

    font-weight: 600;

}


.priority.low {

    background: var(--green-soft);

    color: var(--green);

}


.priority.medium {

    background: var(--orange-soft);

    color: var(--orange);

}


.priority.high {

    background: var(--red-soft);

    color: var(--red);

}


/* =========================
   CATEGORIES
========================= */

.category {

    display: inline-flex;

    align-items: center;

    padding: 4px 8px;

    border-radius: 7px;

    font-size: 9px;

    font-weight: 700;

    white-space: nowrap;

}


.category.exam {

    background: var(--red-soft);

    color: var(--red);

}


.category.homework {

    background: var(--blue-soft);

    color: var(--blue);

}


.category.other {

    background: var(--surface-soft);

    color: var(--text-secondary);

    border: 1px solid var(--border);

}


/* =========================
   DELETE
========================= */

.delete-task {

    border: none;

    background: transparent;

    color: var(--text-secondary);

    font-size: 19px;

    width: 28px;

    height: 28px;

    border-radius: 7px;

    display: flex;

    align-items: center;

    justify-content: center;

}


.delete-task:hover {

    background: var(--red-soft);

    color: var(--red);

}


/* =========================
   EMPTY STATE
========================= */

.empty-state {

    padding: 22px;

    border: 1px dashed var(--border);

    border-radius: 11px;

    text-align: center;

    color: var(--text-secondary);

    font-size: 11px;

}


/* =========================
   PROGRESS
========================= */

.progress-card {

    display: flex;

    flex-direction: column;

}


.progress-circle-container {

    display: flex;

    justify-content: center;

    padding: 18px 0 25px;

}


.progress-circle {

    width: 165px;

    height: 165px;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--primary) var(--progress, 0%),
            var(--surface-soft) var(--progress, 0%)
        );

    display: flex;

    align-items: center;

    justify-content: center;

}


.progress-circle-inner {

    width: 125px;

    height: 125px;

    border-radius: 50%;

    background: var(--surface);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

}


.progress-circle-inner strong {

    font-size: 28px;

}


.progress-circle-inner span {

    color: var(--text-secondary);

    font-size: 10px;

}


.progress-info {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;

    margin-top: auto;

}


.progress-info > div {

    background: var(--surface-soft);

    padding: 12px;

    border-radius: 10px;

    display: flex;

    flex-direction: column;

    gap: 4px;

}


.progress-info span {

    font-size: 9px;

    color: var(--text-secondary);

}


.progress-info strong {

    font-size: 17px;

}


/* =========================
   PAGE HEADER
========================= */

.page-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 25px;

}


.page-header h2 {

    font-size: 24px;

    margin-bottom: 6px;

}


.page-header p {

    color: var(--text-secondary);

    font-size: 12px;

}


/* =========================
   FILTERS
========================= */

.filters {

    display: flex;

    gap: 7px;

    margin-bottom: 18px;

}


.filter-button {

    border: 1px solid var(--border);

    background: var(--surface);

    color: var(--text-secondary);

    padding: 8px 13px;

    border-radius: 8px;

    font-size: 11px;

    font-weight: 600;

}


.filter-button:hover {

    color: var(--text);

}


.filter-button.active {

    background: var(--primary);

    border-color: var(--primary);

    color: white;

}


/* =========================
   CALENDAR
========================= */

.calendar-card {

    padding: 25px;

}


.calendar-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 22px;

}


.calendar-header h3 {

    font-size: 17px;

    text-transform: capitalize;

}


.calendar-nav {

    width: 34px;

    height: 34px;

    border: 1px solid var(--border);

    background: var(--surface);

    border-radius: 9px;

    font-size: 20px;

    color: var(--text);

}


.calendar-nav:hover {

    background: var(--surface-soft);

}


.calendar-weekdays {

    display: grid;

    grid-template-columns: repeat(7, 1fr);

    margin-bottom: 7px;

}


.calendar-weekdays span {

    text-align: center;

    font-size: 10px;

    color: var(--text-secondary);

    font-weight: 700;

    padding: 8px;

}


.calendar-grid {

    display: grid;

    grid-template-columns: repeat(7, 1fr);

    gap: 5px;

}


.calendar-day {

    min-height: 100px;

    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 9px;

    position: relative;

}


.calendar-day > span {

    font-size: 11px;

    font-weight: 700;

}


.calendar-day.today {

    border-color: var(--primary);

    background: var(--primary-soft);

}


.calendar-day.other-month {

    opacity: 0.35;

}


.calendar-tasks {

    margin-top: 7px;

    display: flex;

    flex-direction: column;

    gap: 3px;

}


.calendar-task {

    font-size: 8px;

    background: var(--primary-soft);

    color: var(--primary);

    padding: 4px 5px;

    border-radius: 5px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    cursor: pointer;

}


.calendar-task.completed {

    text-decoration: line-through;

    opacity: 0.6;

}


/* =========================
   SUBJECTS
========================= */

.subjects-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;

}


.subject-card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 22px;

    display: flex;

    align-items: center;

    gap: 14px;

    box-shadow: var(--shadow);

}


.subject-icon {

    width: 46px;

    height: 46px;

    border-radius: 12px;

    background: var(--primary-soft);

    color: var(--primary);

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: 800;

}


.subject-info {

    display: flex;

    flex-direction: column;

    gap: 4px;

}


.subject-info h3 {

    font-size: 14px;

}


.subject-info span {

    color: var(--text-secondary);

    font-size: 10px;

}


/* =========================
   STATISTICS
========================= */

.statistics-grid {

    display: grid;

    grid-template-columns: 1.4fr 1fr;

    gap: 20px;

}


.statistic-bars {

    display: flex;

    flex-direction: column;

    gap: 22px;

}


.statistic-bar-item {

    display: flex;

    flex-direction: column;

    gap: 8px;

}


.statistic-bar-label {

    display: flex;

    justify-content: space-between;

    font-size: 11px;

}


.statistic-bar-label span {

    color: var(--text-secondary);

}


.bar {

    width: 100%;

    height: 9px;

    background: var(--surface-soft);

    border-radius: 20px;

    overflow: hidden;

}


.bar-fill {

    height: 100%;

    width: 0;

    background: var(--primary);

    border-radius: 20px;

    transition: width 0.4s ease;

}


.subject-statistics {

    display: flex;

    flex-direction: column;

    gap: 9px;

}


.subject-stat-row {

    display: flex;

    justify-content: space-between;

    align-items: center;

    background: var(--surface-soft);

    padding: 12px;

    border-radius: 9px;

    font-size: 11px;

}


.subject-stat-row span {

    color: var(--text-secondary);

}


.subject-stat-row strong {

    font-size: 13px;

}


/* =========================
   MODAL
========================= */

.modal-overlay {

    position: fixed;

    inset: 0;

    background: rgba(10, 12, 20, 0.45);

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;

    z-index: 1000;

}


.modal-overlay.active {

    display: flex;

}


.modal {

    width: 100%;

    max-width: 530px;

    max-height: 90vh;

    overflow-y: auto;

    background: var(--surface);

    border-radius: 18px;

    padding: 25px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.2);

}


.modal-header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 25px;

}


.modal-header h2 {

    font-size: 20px;

}


.modal-close {

    width: 32px;

    height: 32px;

    border: none;

    background: var(--surface-soft);

    border-radius: 8px;

    font-size: 20px;

    color: var(--text-secondary);

}


.modal-close:hover {

    color: var(--red);

}


/* =========================
   FORMS
========================= */

.form-group {

    display: flex;

    flex-direction: column;

    gap: 7px;

    margin-bottom: 17px;

}


.form-group label {

    font-size: 11px;

    font-weight: 700;

}


.form-group input,
.form-group select,
.form-group textarea {

    width: 100%;

    border: 1px solid var(--border);

    background: var(--surface);

    color: var(--text);

    border-radius: 9px;

    padding: 11px 12px;

    font-size: 12px;

}


.form-group textarea {

    resize: vertical;

    min-height: 90px;

}


.form-group input::placeholder,
.form-group textarea::placeholder {

    color: #a2a5ae;

}


.form-row {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 13px;

}


/* =========================
   PRIORITY
========================= */

.priority-options {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 8px;

}


.priority-option {

    cursor: pointer;

}


.priority-option input {

    display: none;

}


.priority-option span {

    display: block;

    text-align: center;

    border: 1px solid var(--border);

    padding: 10px 7px;

    border-radius: 8px;

    font-size: 10px;

    font-weight: 600;

}


.priority-option input:checked + span {

    border-color: var(--primary);

    background: var(--primary-soft);

    color: var(--primary);

}


/* =========================
   MODAL BUTTONS
========================= */

.modal-actions {

    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 23px;

}


.button {

    border: none;

    padding: 11px 16px;

    border-radius: 9px;

    font-size: 11px;

    font-weight: 700;

}


.button.secondary {

    background: var(--surface-soft);

    color: var(--text-secondary);

}


.button.primary {

    background: var(--primary);

    color: white;

}


.button.primary:hover {

    background: var(--primary-dark);

}


/* =========================
   UPCOMING
========================= */

.upcoming-card {

    margin-bottom: 20px;

}


/* =========================
   DARK MODE
========================= */

body.dark {

    --background: #101217;

    --surface: #17191f;

    --surface-soft: #20232b;

    --text: #f3f4f7;

    --text-secondary: #969ba8;

    --border: #2b2e37;

    --primary-soft: #25264d;

    --green-soft: #193728;

    --red-soft: #402329;

    --orange-soft: #40331f;

    --blue-soft: #202f46;

}


body.dark .sidebar {

    background: var(--surface);

}


body.dark .welcome {

    background:
        linear-gradient(
            135deg,
            var(--primary-soft),
            var(--surface)
        );

}


body.dark .category.other {

    background: var(--surface);

}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {

    .stats-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .subjects-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .dashboard-grid {

        grid-template-columns: 1fr;

    }

}


@media (max-width: 800px) {

    .sidebar {

        width: 70px;

        padding: 20px 10px;

    }


    .logo {

        justify-content: center;

        padding: 0;

    }


    .logo-text {

        display: none;

    }


    .nav-item span:last-child,
    .theme-toggle span:last-child {

        display: none;

    }


    .nav-item,
    .theme-toggle {

        justify-content: center;

        padding: 12px;

    }


    .main {

        margin-left: 70px;

        width: calc(100% - 70px);

        padding: 22px;

    }


    .statistics-grid {

        grid-template-columns: 1fr;

    }

}


@media (max-width: 600px) {

    .main {

        padding: 18px;

    }


    .topbar {

        align-items: flex-start;

        gap: 15px;

    }


    .topbar h1 {

        font-size: 23px;

    }


    .add-task-button {

        padding: 10px 12px;

    }


    .add-task-button {

        font-size: 10px;

    }


    .stats-grid {

        grid-template-columns: 1fr;

    }


    .subjects-grid {

        grid-template-columns: 1fr;

    }


    .form-row {

        grid-template-columns: 1fr;

        gap: 0;

    }


    .calendar-card {

        overflow-x: auto;

    }


    .calendar-grid,
    .calendar-weekdays {

        min-width: 650px;

    }


    .calendar-day {

        min-height: 80px;

    }


    .modal {

        padding: 20px;

    }


    .task-meta {

        gap: 4px;

    }

}
